Make styles contexts members if SvXMLImport

This commit is contained in:
Michael Brauer 2000-12-15 11:14:46 +00:00
parent 910dd340a1
commit 075ad4280f
2 changed files with 98 additions and 4 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: xmlimp.cxx,v $
*
* $Revision: 1.13 $
* $Revision: 1.14 $
*
* last change: $Author: mib $ $Date: 2000-12-03 10:16:56 $
* last change: $Author: mib $ $Date: 2000-12-15 12:12:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -89,6 +89,9 @@
#ifndef _XMLOFF_XMLKYWD_HXX
#include "xmlkywd.hxx"
#endif
#ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
#include "XMLFontStylesContext.hxx"
#endif
#ifndef _XMLOFF_XMLICTXT_HXX
#include "xmlictxt.hxx"
@ -253,6 +256,15 @@ SvXMLImport::~SvXMLImport() throw ()
delete pNumImport;
if (pProgressBarHelper)
delete pProgressBarHelper;
if( xFontDecls.Is() )
((SvXMLStylesContext *)&xFontDecls)->Clear();
if( xStyles.Is() )
((SvXMLStylesContext *)&xStyles)->Clear();
if( xAutoStyles.Is() )
((SvXMLStylesContext *)&xAutoStyles)->Clear();
if( xMasterStyles.Is() )
((SvXMLStylesContext *)&xMasterStyles)->Clear();
}
// XUnoTunnel & co
@ -659,3 +671,67 @@ const Reference< container::XNameContainer > & SvXMLImport::GetDashHelper()
return sRet;
}
void SvXMLImport::SetFontDecls( XMLFontStylesContext *pFontDecls )
{
xFontDecls = pFontDecls;
GetTextImport()->SetFontDecls( pFontDecls );
}
void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles )
{
xStyles = pStyles;
}
void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles )
{
xAutoStyles = pAutoStyles;
GetTextImport()->SetAutoStyles( pAutoStyles );
GetShapeImport()->SetAutoStylesContext( pAutoStyles );
}
void SvXMLImport::SetMasterStyles( SvXMLStylesContext *pMasterStyles )
{
xMasterStyles = pMasterStyles;
}
XMLFontStylesContext *SvXMLImport::GetFontDecls()
{
return (XMLFontStylesContext *)&xFontDecls;
}
SvXMLStylesContext *SvXMLImport::GetStyles()
{
return (SvXMLStylesContext *)&xStyles;
}
SvXMLStylesContext *SvXMLImport::GetAutoStyles()
{
return (SvXMLStylesContext *)&xAutoStyles;
}
SvXMLStylesContext *SvXMLImport::GetMasterStyles()
{
return (SvXMLStylesContext *)&xMasterStyles;
}
const XMLFontStylesContext *SvXMLImport::GetFontDecls() const
{
return (const XMLFontStylesContext *)&xFontDecls;
}
const SvXMLStylesContext *SvXMLImport::GetStyles() const
{
return (const SvXMLStylesContext *)&xStyles;
}
const SvXMLStylesContext *SvXMLImport::GetAutoStyles() const
{
return (const SvXMLStylesContext *)&xAutoStyles;
}
const SvXMLStylesContext *SvXMLImport::GetMasterStyles() const
{
return (const SvXMLStylesContext *)&xMasterStyles;
}

View file

@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyle.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: dvo $ $Date: 2000-12-11 19:14:25 $
* last change: $Author: mib $ $Date: 2000-12-15 12:12:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -407,6 +407,7 @@ public:
}
inline void AddStyle( SvXMLStyleContext *pStyle );
void Clear();
const SvXMLStyleContext *FindStyleChildContext( sal_uInt16 nFamily,
sal_uInt16 nSubFamily,
@ -448,6 +449,18 @@ inline void SvXMLStylesContext_Impl::AddStyle( SvXMLStyleContext *pStyle )
FlushIndex();
}
void SvXMLStylesContext_Impl::Clear()
{
FlushIndex();
while( aStyles.Count() )
{
SvXMLStyleContext *pStyle = aStyles.GetObject(0);
aStyles.Remove( 0UL );
pStyle->ReleaseRef();
}
}
const SvXMLStyleContext *SvXMLStylesContext_Impl::FindStyleChildContext(
sal_uInt16 nFamily,
sal_uInt16 nSubFamily,
@ -945,6 +958,11 @@ void SvXMLStylesContext::AddStyle(SvXMLStyleContext& rNew)
pImpl->AddStyle( &rNew );
}
void SvXMLStylesContext::Clear()
{
pImpl->Clear();
}
void SvXMLStylesContext::CopyStylesToDoc( sal_Bool bOverwrite,
sal_Bool bFinish )
{