summaryrefslogtreecommitdiff
path: root/sw/source/core/uibase/docvw/SidebarWin.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-15 09:42:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-16 11:16:05 +0100
commiteb1c0480050a1328287c4a85468afbec50b0e29d (patch)
tree044b94745a027b1620ebb5320731275dc86e7b18 /sw/source/core/uibase/docvw/SidebarWin.cxx
parent253ffdf2b0c22247e6208e0881838b1896c63116 (diff)
Resolves: fdo#36815 enable printing WYSIWYG sidewindow comments
in order for that to happen the document has to be scaled down so that the comments outside the border of the sheet of paper can be brought inside the printable area Change-Id: Ifafb8eec10a4ea3ea0014097728888603e61e5a4
Diffstat (limited to 'sw/source/core/uibase/docvw/SidebarWin.cxx')
-rw-r--r--sw/source/core/uibase/docvw/SidebarWin.cxx55
1 files changed, 55 insertions, 0 deletions
diff --git a/sw/source/core/uibase/docvw/SidebarWin.cxx b/sw/source/core/uibase/docvw/SidebarWin.cxx
index 930b95b9a460..ef6d4d35faf1 100644
--- a/sw/source/core/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/core/uibase/docvw/SidebarWin.cxx
@@ -72,10 +72,12 @@
#include <ndtxt.hxx>
#include <sw_primitivetypes2d.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/primitive2d/primitivetools2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
namespace sw { namespace sidebarwindows {
@@ -224,6 +226,59 @@ void SwSidebarWin::Paint( const Rectangle& rRect)
}
}
+void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong nInFlags)
+{
+ if (mpMetadataAuthor->IsVisible() )
+ {
+ //draw left over space
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ pDev->SetFillColor(COL_BLACK);
+ }
+ else
+ {
+ pDev->SetFillColor(mColorDark);
+ }
+ pDev->SetLineColor();
+ pDev->DrawRect( Rectangle( rPt, rSz ) );
+ }
+
+ if (mpMetadataAuthor->IsVisible())
+ {
+ Font aOrigFont(mpMetadataAuthor->GetControlFont());
+ Size aSize(PixelToLogic(mpMetadataAuthor->GetSizePixel()));
+ Point aPos(PixelToLogic(mpMetadataAuthor->GetPosPixel()));
+ aPos += rPt;
+ Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() );
+ mpMetadataAuthor->SetControlFont( aFont );
+ mpMetadataAuthor->Draw(pDev, aPos, aSize, nInFlags);
+ mpMetadataAuthor->SetControlFont( aOrigFont );
+ }
+
+ if (mpMetadataDate->IsVisible())
+ {
+ Font aOrigFont(mpMetadataDate->GetControlFont());
+ Size aSize(PixelToLogic(mpMetadataDate->GetSizePixel()));
+ Point aPos(PixelToLogic(mpMetadataDate->GetPosPixel()));
+ aPos += rPt;
+ Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
+ mpMetadataDate->SetControlFont( aFont );
+ mpMetadataDate->Draw(pDev, aPos, aSize, nInFlags);
+ mpMetadataDate->SetControlFont( aOrigFont );
+ }
+
+ mpSidebarTxtControl->Draw(pDev, rPt, rSz, nInFlags);
+
+ const drawinglayer::primitive2d::Primitive2DSequence& rSequence = mpAnchor->getOverlayObjectPrimitive2DSequence();
+ const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
+ drawinglayer::processor2d::BaseProcessor2D * pProcessor =
+ drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
+ *pDev, aNewViewInfos );
+
+ pProcessor->process(rSequence);
+ delete pProcessor;
+}
+
void SwSidebarWin::SetPosSizePixelRect( long nX,
long nY,
long nWidth,