loplugin:mergeclasses ImplEESdrWriter with ImplEscherExSdr
Change-Id: Iea2241d9fc44b92e18101b3f367a643f03729183
This commit is contained in:
@@ -71,7 +71,6 @@ merge IXFAttrList with XFSaxAttrList
|
|||||||
merge IXFStream with XFSaxStream
|
merge IXFStream with XFSaxStream
|
||||||
merge IXFStyle with XFStyle
|
merge IXFStyle with XFStyle
|
||||||
merge IconChoicePage with SvxHyperlinkTabPageBase
|
merge IconChoicePage with SvxHyperlinkTabPageBase
|
||||||
merge ImplEESdrWriter with ImplEscherExSdr
|
|
||||||
merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstitution
|
merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstitution
|
||||||
merge ImplPreMatchFontSubstitution with FcPreMatchSubstitution
|
merge ImplPreMatchFontSubstitution with FcPreMatchSubstitution
|
||||||
merge LwpDLList with LwpParaProperty
|
merge LwpDLList with LwpParaProperty
|
||||||
|
@@ -4975,7 +4975,7 @@ EscherEx::EscherEx(const std::shared_ptr<EscherExGlobal>& rxGlobal, SvStream* pO
|
|||||||
mbOwnsStrm = true;
|
mbOwnsStrm = true;
|
||||||
}
|
}
|
||||||
mnStrmStartOfs = mpOutStrm->Tell();
|
mnStrmStartOfs = mpOutStrm->Tell();
|
||||||
mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
|
mpImplEESdrWriter.reset( new ImplEESdrWriter( *this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
EscherEx::~EscherEx()
|
EscherEx::~EscherEx()
|
||||||
@@ -5295,7 +5295,7 @@ sal_uInt32 EscherEx::EnterGroup( const OUString& rShapeName, const Rectangle* pB
|
|||||||
if ( mnGroupLevel > 1 )
|
if ( mnGroupLevel > 1 )
|
||||||
AddChildAnchor( aRect );
|
AddChildAnchor( aRect );
|
||||||
|
|
||||||
EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
|
EscherExHostAppData* pAppData = mpImplEESdrWriter->ImplGetHostData();
|
||||||
if( pAppData )
|
if( pAppData )
|
||||||
{
|
{
|
||||||
if ( mnGroupLevel <= 1 )
|
if ( mnGroupLevel <= 1 )
|
||||||
|
@@ -69,9 +69,13 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
|
|||||||
, mpPicStrm(nullptr)
|
, mpPicStrm(nullptr)
|
||||||
, mpHostAppData(nullptr)
|
, mpHostAppData(nullptr)
|
||||||
, mbIsTitlePossible(false)
|
, mbIsTitlePossible(false)
|
||||||
|
, mpSdrPage( nullptr )
|
||||||
|
, mpSolverContainer( nullptr )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint )
|
Point ImplEESdrWriter::ImplMapPoint( const Point& rPoint )
|
||||||
{
|
{
|
||||||
return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest );
|
return OutputDevice::LogicToLogic( rPoint, maMapModeSrc, maMapModeDest );
|
||||||
@@ -833,18 +837,9 @@ void ImplEESdrWriter::ImplWritePage(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImplEscherExSdr::ImplEscherExSdr( EscherEx& rEx )
|
ImplEESdrWriter::~ImplEESdrWriter()
|
||||||
:
|
|
||||||
ImplEESdrWriter( rEx ),
|
|
||||||
mpSdrPage( nullptr ),
|
|
||||||
mpSolverContainer( nullptr )
|
|
||||||
{
|
{
|
||||||
}
|
DBG_ASSERT( !mpSolverContainer, "ImplEESdrWriter::~ImplEESdrWriter: unwritten SolverContainer" );
|
||||||
|
|
||||||
|
|
||||||
ImplEscherExSdr::~ImplEscherExSdr()
|
|
||||||
{
|
|
||||||
DBG_ASSERT( !mpSolverContainer, "ImplEscherExSdr::~ImplEscherExSdr: unwritten SolverContainer" );
|
|
||||||
Reference<css::lang::XComponent> xComp(mXDrawPage, UNO_QUERY);
|
Reference<css::lang::XComponent> xComp(mXDrawPage, UNO_QUERY);
|
||||||
if (xComp.is())
|
if (xComp.is())
|
||||||
xComp->dispose();
|
xComp->dispose();
|
||||||
@@ -852,7 +847,7 @@ ImplEscherExSdr::~ImplEscherExSdr()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
|
bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
|
||||||
{
|
{
|
||||||
SvxDrawPage* pSvxDrawPage;
|
SvxDrawPage* pSvxDrawPage;
|
||||||
if ( mpSdrPage != &rPage || !mXDrawPage.is() )
|
if ( mpSdrPage != &rPage || !mXDrawPage.is() )
|
||||||
@@ -880,7 +875,7 @@ bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
|
|||||||
return pSvxDrawPage != nullptr;
|
return pSvxDrawPage != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
|
bool ImplEESdrWriter::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
|
||||||
{
|
{
|
||||||
// eventually write SolverContainer of current page, deletes the Solver
|
// eventually write SolverContainer of current page, deletes the Solver
|
||||||
ImplFlushSolverContainer();
|
ImplFlushSolverContainer();
|
||||||
@@ -899,7 +894,7 @@ bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImplEscherExSdr::ImplExitPage()
|
void ImplEESdrWriter::ImplExitPage()
|
||||||
{
|
{
|
||||||
// close all groups before the solver container is written
|
// close all groups before the solver container is written
|
||||||
while( mpEscherEx->GetGroupLevel() )
|
while( mpEscherEx->GetGroupLevel() )
|
||||||
@@ -910,7 +905,7 @@ void ImplEscherExSdr::ImplExitPage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ImplEscherExSdr::ImplFlushSolverContainer()
|
void ImplEESdrWriter::ImplFlushSolverContainer()
|
||||||
{
|
{
|
||||||
if ( mpSolverContainer )
|
if ( mpSolverContainer )
|
||||||
{
|
{
|
||||||
@@ -920,43 +915,43 @@ void ImplEscherExSdr::ImplFlushSolverContainer()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImplEscherExSdr::ImplWriteCurrentPage()
|
void ImplEESdrWriter::ImplWriteCurrentPage()
|
||||||
{
|
{
|
||||||
assert(mpSolverContainer && "ImplEscherExSdr::ImplWriteCurrentPage: no SolverContainer");
|
assert(mpSolverContainer && "ImplEESdrWriter::ImplWriteCurrentPage: no SolverContainer");
|
||||||
ImplWritePage( *mpSolverContainer );
|
ImplWritePage( *mpSolverContainer );
|
||||||
ImplExitPage();
|
ImplExitPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxmlExport )
|
sal_uInt32 ImplEESdrWriter::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxmlExport )
|
||||||
{
|
{
|
||||||
assert(mpSolverContainer && "ImplEscherExSdr::ImplWriteShape: no SolverContainer");
|
assert(mpSolverContainer && "ImplEESdrWriter::ImplWriteShape: no SolverContainer");
|
||||||
return ImplWriteShape( rObj, *mpSolverContainer, ooxmlExport );
|
return ImplWriteShape( rObj, *mpSolverContainer, ooxmlExport );
|
||||||
}
|
}
|
||||||
|
|
||||||
void EscherEx::AddSdrPage( const SdrPage& rPage )
|
void EscherEx::AddSdrPage( const SdrPage& rPage )
|
||||||
{
|
{
|
||||||
if ( mpImplEscherExSdr->ImplInitPage( rPage ) )
|
if ( mpImplEESdrWriter->ImplInitPage( rPage ) )
|
||||||
mpImplEscherExSdr->ImplWriteCurrentPage();
|
mpImplEESdrWriter->ImplWriteCurrentPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
|
void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
|
||||||
{
|
{
|
||||||
if ( mpImplEscherExSdr->ImplInitUnoShapes( rxShapes ) )
|
if ( mpImplEESdrWriter->ImplInitUnoShapes( rxShapes ) )
|
||||||
mpImplEscherExSdr->ImplWriteCurrentPage();
|
mpImplEESdrWriter->ImplWriteCurrentPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
|
sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
|
||||||
{
|
{
|
||||||
ImplEESdrObject aObj( *mpImplEscherExSdr, rObj, mbOOXML );
|
ImplEESdrObject aObj( *mpImplEESdrWriter, rObj, mbOOXML );
|
||||||
if( aObj.IsValid() )
|
if( aObj.IsValid() )
|
||||||
return mpImplEscherExSdr->ImplWriteTheShape( aObj, ooxmlExport );
|
return mpImplEESdrWriter->ImplWriteTheShape( aObj, ooxmlExport );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EscherEx::EndSdrObjectPage()
|
void EscherEx::EndSdrObjectPage()
|
||||||
{
|
{
|
||||||
mpImplEscherExSdr->ImplExitPage();
|
mpImplEESdrWriter->ImplExitPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
|
EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
|
||||||
@@ -999,7 +994,7 @@ const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
|
ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
|
||||||
const SdrObject& rObj, bool bOOXML ) :
|
const SdrObject& rObj, bool bOOXML ) :
|
||||||
mnShapeId( 0 ),
|
mnShapeId( 0 ),
|
||||||
mnTextSize( 0 ),
|
mnTextSize( 0 ),
|
||||||
|
@@ -29,7 +29,9 @@
|
|||||||
enum ImplEESdrPageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
|
enum ImplEESdrPageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
|
||||||
|
|
||||||
class ImplEESdrWriter;
|
class ImplEESdrWriter;
|
||||||
class ImplEscherExSdr;
|
class ImplEESdrWriter;
|
||||||
|
class SdrObject;
|
||||||
|
class SdrPage;
|
||||||
|
|
||||||
class ImplEESdrObject
|
class ImplEESdrObject
|
||||||
{
|
{
|
||||||
@@ -50,7 +52,7 @@ class ImplEESdrObject
|
|||||||
public:
|
public:
|
||||||
css::uno::Reference< css::beans::XPropertySet > mXPropSet;
|
css::uno::Reference< css::beans::XPropertySet > mXPropSet;
|
||||||
|
|
||||||
ImplEESdrObject( ImplEscherExSdr& rEx, const SdrObject& rObj, bool bOOXML = false );
|
ImplEESdrObject( ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML = false );
|
||||||
ImplEESdrObject( ImplEESdrWriter& rEx, const css::uno::Reference< css::drawing::XShape >& rShape );
|
ImplEESdrObject( ImplEESdrWriter& rEx, const css::uno::Reference< css::drawing::XShape >& rShape );
|
||||||
~ImplEESdrObject();
|
~ImplEESdrObject();
|
||||||
|
|
||||||
@@ -106,70 +108,43 @@ class EscherExHostAppData;
|
|||||||
|
|
||||||
class ImplEESdrWriter
|
class ImplEESdrWriter
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
EscherEx* mpEscherEx;
|
EscherEx* mpEscherEx;
|
||||||
MapMode maMapModeSrc;
|
MapMode maMapModeSrc;
|
||||||
MapMode maMapModeDest;
|
MapMode maMapModeDest;
|
||||||
|
|
||||||
css::uno::Reference< css::drawing::XDrawPage > mXDrawPage;
|
css::uno::Reference< css::drawing::XDrawPage > mXDrawPage;
|
||||||
css::uno::Reference< css::drawing::XShapes > mXShapes;
|
css::uno::Reference< css::drawing::XShapes > mXShapes;
|
||||||
|
|
||||||
SvStream* mpPicStrm;
|
SvStream* mpPicStrm;
|
||||||
|
|
||||||
// own extensions
|
// own extensions
|
||||||
|
|
||||||
EscherExHostAppData* mpHostAppData;
|
EscherExHostAppData* mpHostAppData;
|
||||||
|
|
||||||
bool mbIsTitlePossible;
|
bool mbIsTitlePossible;
|
||||||
|
|
||||||
|
|
||||||
explicit ImplEESdrWriter( EscherEx& rEx );
|
|
||||||
|
|
||||||
bool ImplInitPageValues();
|
|
||||||
|
|
||||||
void ImplWritePage(
|
|
||||||
EscherSolverContainer& rSolver );
|
|
||||||
|
|
||||||
sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
|
|
||||||
EscherSolverContainer& rSolver,
|
|
||||||
const bool bOOxmlExport = false ); // returns ShapeID
|
|
||||||
|
|
||||||
static void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
|
|
||||||
void ImplWriteAdditionalText(
|
|
||||||
ImplEESdrObject& rObj,
|
|
||||||
const Point& rTextRefPoint );
|
|
||||||
sal_uInt32 ImplEnterAdditionalTextGroup(
|
|
||||||
const css::uno::Reference< css::drawing::XShape >& rShape,
|
|
||||||
const Rectangle* pBoundRect );
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
Point ImplMapPoint( const Point& rPoint );
|
|
||||||
Size ImplMapSize( const Size& rSize );
|
|
||||||
EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
|
|
||||||
};
|
|
||||||
|
|
||||||
class SdrObject;
|
|
||||||
class SdrPage;
|
|
||||||
|
|
||||||
class ImplEscherExSdr : public ImplEESdrWriter
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
const SdrPage* mpSdrPage;
|
const SdrPage* mpSdrPage;
|
||||||
EscherSolverContainer* mpSolverContainer;
|
EscherSolverContainer* mpSolverContainer;
|
||||||
|
|
||||||
public:
|
bool ImplInitPageValues();
|
||||||
explicit ImplEscherExSdr( EscherEx& rEx );
|
void ImplWritePage( EscherSolverContainer& rSolver );
|
||||||
virtual ~ImplEscherExSdr();
|
sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
|
||||||
|
EscherSolverContainer& rSolver,
|
||||||
|
const bool bOOxmlExport = false ); // returns ShapeID
|
||||||
|
static void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
|
||||||
|
void ImplWriteAdditionalText(
|
||||||
|
ImplEESdrObject& rObj,
|
||||||
|
const Point& rTextRefPoint );
|
||||||
|
sal_uInt32 ImplEnterAdditionalTextGroup(
|
||||||
|
const css::uno::Reference< css::drawing::XShape >& rShape,
|
||||||
|
const Rectangle* pBoundRect );
|
||||||
|
void ImplFlushSolverContainer();
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ImplEESdrWriter( EscherEx& rEx );
|
||||||
|
~ImplEESdrWriter();
|
||||||
|
Point ImplMapPoint( const Point& rPoint );
|
||||||
|
Size ImplMapSize( const Size& rSize );
|
||||||
|
EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
|
||||||
bool ImplInitPage( const SdrPage& rPage );
|
bool ImplInitPage( const SdrPage& rPage );
|
||||||
bool ImplInitUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes );
|
bool ImplInitUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes );
|
||||||
void ImplWriteCurrentPage();
|
void ImplWriteCurrentPage();
|
||||||
|
|
||||||
sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj, bool ooxmlExport );
|
sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj, bool ooxmlExport );
|
||||||
|
|
||||||
void ImplExitPage();
|
void ImplExitPage();
|
||||||
void ImplFlushSolverContainer();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -966,7 +966,7 @@ public:
|
|||||||
void WriteDggAtom( SvStream& rStrm ) const;
|
void WriteDggAtom( SvStream& rStrm ) const;
|
||||||
|
|
||||||
/** Called if a picture shall be written and no picture stream is set at
|
/** Called if a picture shall be written and no picture stream is set at
|
||||||
class ImplEscherExSdr.
|
class ImplEESdrWriter.
|
||||||
|
|
||||||
On first invokation, this function calls the virtual member function
|
On first invokation, this function calls the virtual member function
|
||||||
ImplQueryPictureStream(). The return value will be cached internally
|
ImplQueryPictureStream(). The return value will be cached internally
|
||||||
@@ -1015,13 +1015,13 @@ private:
|
|||||||
|
|
||||||
class SdrObject;
|
class SdrObject;
|
||||||
class SdrPage;
|
class SdrPage;
|
||||||
class ImplEscherExSdr;
|
class ImplEESdrWriter;
|
||||||
|
|
||||||
class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
|
class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<EscherExGlobal> mxGlobal;
|
std::shared_ptr<EscherExGlobal> mxGlobal;
|
||||||
::std::unique_ptr< ImplEscherExSdr > mpImplEscherExSdr;
|
::std::unique_ptr< ImplEESdrWriter > mpImplEESdrWriter;
|
||||||
SvStream* mpOutStrm;
|
SvStream* mpOutStrm;
|
||||||
bool mbOwnsStrm;
|
bool mbOwnsStrm;
|
||||||
sal_uInt32 mnStrmStartOfs;
|
sal_uInt32 mnStrmStartOfs;
|
||||||
@@ -1056,7 +1056,7 @@ public:
|
|||||||
EscherGraphicProvider& GetGraphicProvider() { return *mxGlobal; }
|
EscherGraphicProvider& GetGraphicProvider() { return *mxGlobal; }
|
||||||
|
|
||||||
/** Called if a picture shall be written and no picture stream is set at
|
/** Called if a picture shall be written and no picture stream is set at
|
||||||
class ImplEscherExSdr.
|
class ImplEESdrWriter.
|
||||||
*/
|
*/
|
||||||
inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
|
inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user