summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/PostItMgr.hxx1
-rw-r--r--sw/inc/SidebarWin.hxx1
-rw-r--r--sw/source/core/view/viewsh.cxx3
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx15
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx19
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.hxx1
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx21
7 files changed, 57 insertions, 4 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 752cd2a01f92..73d2deb8d7a5 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 e01c269327c4..556de93e49bf 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 02935a84ace9..d424ebf43ae6 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 44c6602999e0..74a65c66f9a1 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 d864b40114c4..e8d1d28e219c 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 b5878feb73ba..d7a0130dfc50 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 4cfc515c1619..99c88bfd867d 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);
}
}