[Libreoffice-commits] core.git: 3 commits - libreofficekit/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Nov 6 04:34:07 PST 2015
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 2 +-
sw/source/uibase/docvw/PostItMgr.cxx | 11 +++++++++--
sw/source/uibase/docvw/SidebarTxtControl.cxx | 19 +++----------------
sw/source/uibase/docvw/SidebarTxtControl.hxx | 1 -
sw/source/uibase/docvw/SidebarWin.cxx | 19 +++++++++++++++----
5 files changed, 28 insertions(+), 24 deletions(-)
New commits:
commit 8fc6aafcb4769271bc7b208e9b9b430b875b6104
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Nov 6 13:30:54 2015 +0100
sw lok annotations: disable the scrollbar for now
Change-Id: I7493eaab55c23c79ca0878c34a97dfb4af857260
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 064a735..112a12d 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -246,6 +246,12 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
for (sal_uInt16 i = 0; i < GetChildCount(); ++i)
{
vcl::Window* pChild = GetChild(i);
+
+ // This would at the moment just draw a gray rectangle at the top right
+ // corner, need to sort out later.
+ if (pChild == mpVScrollbar.get())
+ continue;
+
rRenderContext.Push(PushFlags::MAPMODE);
Point aOffset(PixelToLogic(pChild->GetPosPixel()));
MapMode aMapMode(rRenderContext.GetMapMode());
commit 2dba3c1b403e10f5725723193127c3e0fffd3d64
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Nov 6 10:58:18 2015 +0100
gtktiledviewer: larger default window size
So comments in an otherwise empty Writer doc are immediately visible.
Change-Id: I189c4eff6e83274f609ce016f9610c307c47ff16
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index a0bf1f8..903dc9b 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -903,7 +903,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
{
GtkWidget *pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(pWindow), "LibreOfficeKit GTK Tiled Viewer");
- gtk_window_set_default_size(GTK_WINDOW(pWindow), 1024, 768);
+ gtk_window_set_default_size(GTK_WINDOW(pWindow), 1280, 720);
g_signal_connect(pWindow, "destroy", G_CALLBACK(gtk_main_quit), 0);
rWindow.m_pVBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
commit 177e375d2e63f1c3db9f5ab41e4281af740625fb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Nov 6 10:29:38 2015 +0100
sw lok annotations: paint all child window
And use map modes to get the painting to the correct position instead of
manually adjusting each and every Paint() method.
Change-Id: I66798321b8bbf2c7968d6ac1edebb1f8df60bce8
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index d2d0214..5d0408a 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -855,10 +855,17 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRe
if (!pPostIt)
continue;
- Point aPoint(mpEditWin->PixelToLogic(pPostIt->GetPosPixel()));
+ rRenderContext.Push(PushFlags::MAPMODE);
+ Point aOffset(mpEditWin->PixelToLogic(pPostIt->GetPosPixel()));
+ MapMode aMapMode(rRenderContext.GetMapMode());
+ aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
+ rRenderContext.SetMapMode(aMapMode);
Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
- Rectangle aRectangle(aPoint, aSize);
+ Rectangle aRectangle(Point(0, 0), aSize);
+
pPostIt->PaintTile(rRenderContext, aRectangle);
+
+ rRenderContext.Pop();
}
}
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index e8d1d28..d864b40 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -53,7 +53,6 @@
#include <shellres.hxx>
#include <SwRewriter.hxx>
#include <memory>
-#include <comphelper/lok.hxx>
namespace sw { namespace sidebarwindows {
@@ -152,37 +151,25 @@ 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(aPoint, rRenderContext.PixelToLogic(GetSizePixel())),
+ rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorDark(), mrSidebarWin.ColorDark()));
}
else
{
- rRenderContext.DrawGradient(Rectangle(aPoint, rRenderContext.PixelToLogic(GetSizePixel())),
+ rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorLight(), mrSidebarWin.ColorDark()));
}
}
if (GetTextView())
{
- if (comphelper::LibreOfficeKit::isActive())
- GetTextView()->GetOutliner()->Draw(&rRenderContext, rRect);
- else
- GetTextView()->Paint(rRect, &rRenderContext);
+ 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 3897182..51243ed 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -69,7 +69,6 @@ class SidebarTextControl : public Control
virtual css::uno::Reference< css::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 99c88bf..064a735 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -246,10 +246,15 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
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);
+ rRenderContext.Push(PushFlags::MAPMODE);
+ Point aOffset(PixelToLogic(pChild->GetPosPixel()));
+ MapMode aMapMode(rRenderContext.GetMapMode());
+ aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
+ rRenderContext.SetMapMode(aMapMode);
+
+ pChild->Paint(rRenderContext, rRect);
+
+ rRenderContext.Pop();
}
}
More information about the Libreoffice-commits
mailing list