summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/UnoGraphicExporter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/unodraw/UnoGraphicExporter.cxx')
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx54
1 files changed, 53 insertions, 1 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index ebd8f83e00f0..1e191f3125c1 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -618,6 +618,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
VirtualDevice aVDev;
const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
+#ifndef NEWPBG
// create a view
SdrView* pView;
@@ -633,17 +634,25 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
pView->SetBordVisible( FALSE );
pView->SetPageVisible( FALSE );
pView->ShowSdrPage( pPage );
+#endif
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl();
rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) );
+#ifdef NEWPBG
+ rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() );
+#else
rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) );
+#endif
// #i102251#
const sal_uInt32 nOldCntrl(rOutl.GetControlWord());
sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING;
rOutl.SetControlWord(nCntrl);
+#ifdef NEWPBG
+ SdrObject* pTempBackgroundShape = 0;
+#endif
std::vector< SdrObject* > aShapes;
bool bRet = true;
@@ -652,6 +661,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
if( rSettings.mbExportOnlyBackground )
{
+#ifdef NEWPBG
+ pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
+ pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet());
+ pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ aShapes.push_back(pTempBackgroundShape);
+#else
SdrObject* pShape = 0;
if( pPage->IsMasterPage() )
{
@@ -665,6 +680,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if( pShape )
aShapes.push_back( pShape );
+#endif
}
else
{
@@ -741,8 +757,26 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
aVDev.EnableOutput( FALSE );
aMtf.Record( &aVDev );
-
Size aNewSize;
+
+#ifdef NEWPBG
+ // create a view
+ SdrView* pView;
+
+ if( PTR_CAST( FmFormModel, mpDoc ) )
+ {
+ pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
+ }
+ else
+ {
+ pView = new SdrView( mpDoc, &aVDev );
+ }
+
+ pView->SetBordVisible( FALSE );
+ pView->SetPageVisible( FALSE );
+ pView->ShowSdrPage( pPage );
+#endif
+
if ( pView && pPage )
{
pView->SetBordVisible( FALSE );
@@ -783,6 +817,13 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aGraphic = Graphic(aMtf);
}
+#ifdef NEWPBG
+ if ( pView )
+ {
+ pView->HideSdrPage();
+ delete pView;
+ }
+#endif
if( rSettings.mbTranslucent )
{
Size aOutSize;
@@ -907,6 +948,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
// calculate bound rect for all shapes
Rectangle aBound;
+#ifndef NEWPBG
if(rSettings.mbExportOnlyBackground)
{
// shape is MPBGO and if it's not yet set, it's size will
@@ -916,6 +958,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aBound = Rectangle(Point(0,0), pPage->GetSize());
}
else
+#endif
{
std::vector< SdrObject* >::iterator aIter = aShapes.begin();
const std::vector< SdrObject* >::iterator aEnd = aShapes.end();
@@ -989,11 +1032,20 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
}
}
+#ifndef NEWPBG
if ( pView )
{
pView->HideSdrPage();
delete pView;
}
+#endif
+
+#ifdef NEWPBG
+ if(pTempBackgroundShape)
+ {
+ SdrObject::Free(pTempBackgroundShape);
+ }
+#endif
rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl );