[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Nov 5 07:03:46 PST 2015
sw/inc/PostItMgr.hxx | 1 +
sw/inc/SidebarWin.hxx | 1 +
sw/source/core/view/viewsh.cxx | 3 +++
sw/source/uibase/docvw/PostItMgr.cxx | 15 +++++++++++++++
sw/source/uibase/docvw/SidebarTxtControl.cxx | 19 ++++++++++++++++---
sw/source/uibase/docvw/SidebarTxtControl.hxx | 1 +
sw/source/uibase/docvw/SidebarWin.cxx | 21 ++++++++++++++++++++-
7 files changed, 57 insertions(+), 4 deletions(-)
New commits:
commit d54aaea33bf2dab86c0ead4bd142c593d017f930
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Nov 5 15:58:55 2015 +0100
sw tiled rendering: initial annotation support
Change-Id: I4fcb05f8a58965341cf44a1b7e2367b5cbff981d
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 752cd2a..73d2deb 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -285,6 +285,7 @@ class SwPostItMgr: public SfxListener
std::vector< vcl::Window* >* pChildren );
void DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage);
+ void PaintTile(OutputDevice& rRenderContext, const Rectangle& rRect);
};
#endif
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index e01c269..556de93 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -177,6 +177,7 @@ class SwSidebarWin : public vcl::Window
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() override;
virtual void Draw(OutputDevice* pDev, const Point&, const Size&, DrawFlags) override;
+ void PaintTile(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
protected:
virtual void DataChanged( const DataChangedEvent& aEvent) override;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 02935a8..d424ebf 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1900,6 +1900,9 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// draw - works in logic coordinates
Paint(rDevice, aOutRect);
+ if (SwPostItMgr* pPostItMgr = GetPostItMgr())
+ pPostItMgr->PaintTile(rDevice, aOutRect);
+
// SwViewShell's output device tear down
mpOut = pSaveOut;
mbInLibreOfficeKitCallback = false;
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 44c6602..74a65c6 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -847,6 +847,21 @@ void SwPostItMgr::DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage)
}
}
+void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRect*/)
+{
+ for (SwSidebarItem* pItem : mvPostItFields)
+ {
+ SwSidebarWin* pPostIt = pItem->pPostIt;
+ if (!pPostIt)
+ continue;
+
+ Point aPoint(mpEditWin->PixelToLogic(pPostIt->GetPosPixel()));
+ Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
+ Rectangle aRectangle(aPoint, aSize);
+ pPostIt->PaintTile(rRenderContext, aRectangle);
+ }
+}
+
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/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index d864b40..e8d1d28 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -53,6 +53,7 @@
#include <shellres.hxx>
#include <SwRewriter.hxx>
#include <memory>
+#include <comphelper/lok.hxx>
namespace sw { namespace sidebarwindows {
@@ -151,25 +152,37 @@ void SidebarTextControl::Draw(OutputDevice* pDev, const Point& rPt, const Size&
}
}
+void SidebarTextControl::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
+{
+ Paint(rRenderContext, rRect);
+}
+
void SidebarTextControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
+ Point aPoint(0, 0);
+ if (comphelper::LibreOfficeKit::isActive())
+ aPoint = rRect.TopLeft();
+
if (!rRenderContext.GetSettings().GetStyleSettings().GetHighContrastMode())
{
if (mrSidebarWin.IsMouseOverSidebarWin() || HasFocus())
{
- rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
+ rRenderContext.DrawGradient(Rectangle(aPoint, rRenderContext.PixelToLogic(GetSizePixel())),
Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorDark(), mrSidebarWin.ColorDark()));
}
else
{
- rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
+ rRenderContext.DrawGradient(Rectangle(aPoint, rRenderContext.PixelToLogic(GetSizePixel())),
Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorLight(), mrSidebarWin.ColorDark()));
}
}
if (GetTextView())
{
- GetTextView()->Paint(rRect, &rRenderContext);
+ if (comphelper::LibreOfficeKit::isActive())
+ GetTextView()->GetOutliner()->Draw(&rRenderContext, rRect);
+ else
+ GetTextView()->Paint(rRect, &rRenderContext);
}
if (mrSidebarWin.GetLayoutStatus() == SwPostItHelper::DELETED)
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.hxx b/sw/source/uibase/docvw/SidebarTxtControl.hxx
index b5878fe..d7a0130 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -69,6 +69,7 @@ class SidebarTextControl : public Control
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() override;
virtual void Draw(OutputDevice* pDev, const Point&, const Size&, DrawFlags) override;
+ void PaintTile(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
};
} } // end of namespace sw::sidebarwindows
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 4cfc515..99c88bf 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -80,6 +80,7 @@
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
#include <memory>
+#include <comphelper/lok.hxx>
namespace sw { namespace sidebarwindows {
@@ -230,7 +231,25 @@ void SwSidebarWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rR
Size(GetMetaButtonAreaWidth(),
mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height()));
- rRenderContext.DrawRect(PixelToLogic(aRectangle));
+ if (comphelper::LibreOfficeKit::isActive())
+ aRectangle = rRect;
+ else
+ aRectangle = PixelToLogic(aRectangle);
+ rRenderContext.DrawRect(aRectangle);
+ }
+}
+
+void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
+{
+ Paint(rRenderContext, rRect);
+
+ for (sal_uInt16 i = 0; i < GetChildCount(); ++i)
+ {
+ vcl::Window* pChild = GetChild(i);
+ if (pChild == mpSidebarTextControl.get())
+ mpSidebarTextControl->PaintTile(rRenderContext, rRect);
+ else
+ SAL_WARN("sw.uibase", "SwSidebarWin::PaintTile: unhandled child " << pChild);
}
}
More information about the Libreoffice-commits
mailing list