summaryrefslogtreecommitdiff
path: root/sw/source/core/uibase/docvw
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/uibase/docvw')
-rw-r--r--sw/source/core/uibase/docvw/PostItMgr.cxx16
-rw-r--r--sw/source/core/uibase/docvw/SidebarTxtControl.cxx40
-rw-r--r--sw/source/core/uibase/docvw/SidebarTxtControl.hxx2
-rw-r--r--sw/source/core/uibase/docvw/SidebarWin.cxx55
4 files changed, 113 insertions, 0 deletions
diff --git a/sw/source/core/uibase/docvw/PostItMgr.cxx b/sw/source/core/uibase/docvw/PostItMgr.cxx
index 4193ad61c7e3..e63ce8b7b2cf 100644
--- a/sw/source/core/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/core/uibase/docvw/PostItMgr.cxx
@@ -823,6 +823,22 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
return false;
}
+void SwPostItMgr::DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage)
+{
+ assert(nPage < mPages.size());
+ if (nPage >= mPages.size())
+ return;
+ for(SwSidebarItem_iterator i = mPages[nPage]->mList->begin(); i != mPages[nPage]->mList->end(); ++i)
+ {
+ SwSidebarWin* pPostIt = (*i)->pPostIt;
+ if (!pPostIt)
+ continue;
+ Point aPoint(mpEditWin->PixelToLogic(pPostIt->GetPosPixel()));
+ Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
+ pPostIt->Draw(pOutDev, aPoint, aSize, 0);
+ }
+}
+
void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
{
OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
diff --git a/sw/source/core/uibase/docvw/SidebarTxtControl.cxx b/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
index 421bd0a8f3f0..4e84a0be9333 100644
--- a/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
@@ -119,6 +119,46 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt)
}
}
+void SidebarTxtControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong)
+{
+ if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ if ( mrSidebarWin.IsMouseOverSidebarWin() ||
+ HasFocus() )
+ {
+ pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
+ Gradient( GradientStyle_LINEAR,
+ mrSidebarWin.ColorDark(),
+ mrSidebarWin.ColorDark() ) );
+ }
+ else
+ {
+ pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
+ Gradient( GradientStyle_LINEAR,
+ mrSidebarWin.ColorLight(),
+ mrSidebarWin.ColorDark()));
+ }
+ }
+
+ if ( GetTextView() )
+ {
+ GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, rSz));
+ }
+
+ if ( mrSidebarWin.GetLayoutStatus()==SwPostItHelper::DELETED )
+ {
+ SetLineColor(mrSidebarWin.GetChangeColor());
+ pDev->DrawLine( PixelToLogic( GetPosPixel(), pDev->GetMapMode() ),
+ PixelToLogic( GetPosPixel() +
+ Point( GetSizePixel().Width(),
+ GetSizePixel().Height() ), pDev->GetMapMode() ) );
+ pDev->DrawLine( PixelToLogic( GetPosPixel() +
+ Point( GetSizePixel().Width(),0), pDev->GetMapMode() ),
+ PixelToLogic( GetPosPixel() +
+ Point( 0, GetSizePixel().Height() ), pDev->GetMapMode() ) );
+ }
+}
+
void SidebarTxtControl::Paint( const Rectangle& rRect)
{
if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
diff --git a/sw/source/core/uibase/docvw/SidebarTxtControl.hxx b/sw/source/core/uibase/docvw/SidebarTxtControl.hxx
index ae524a094f71..edb9efd8b9d2 100644
--- a/sw/source/core/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/core/uibase/docvw/SidebarTxtControl.hxx
@@ -66,6 +66,8 @@ class SidebarTxtControl : public Control
DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
+
+ virtual void Draw(OutputDevice* pDev, const Point&, const Size&, sal_uLong) SAL_OVERRIDE;
};
} } // end of namespace sw::sidebarwindows
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,