[Libreoffice-commits] core.git: include/svx libreofficekit/qa sd/source svx/source sw/source

Marco Cecchetti marco.cecchetti at collabora.com
Fri Jan 8 01:34:55 PST 2016


 include/svx/svdpntv.hxx                               |    5 ++++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx   |   21 ++++++++++++------
 sd/source/ui/unoidl/unomodel.cxx                      |   11 +++++++--
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx |    5 ++++
 svx/source/svdraw/svdpntv.cxx                         |    1 
 sw/source/uibase/uno/unotxdoc.cxx                     |    2 +
 6 files changed, 36 insertions(+), 9 deletions(-)

New commits:
commit 6b7d41094d06bbb4c248927d02318cf1b5faba0a
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Thu Jan 7 15:57:21 2016 +0100

    lool - page border shadow can be disabled
    
    Support for text documents and presentations.
    
    Added a command line option for gtktiledviewer:
    --hide-page-shadow.
    
    Reviewed on:
    	https://gerrit.libreoffice.org/21210
    
    Change-Id: I1e427693d7af40cb5731d1730ac5b7c486d45c29

diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 49029ce..3b52d2a 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -162,6 +162,7 @@ protected:
     SvtOptionsDrawinglayer      maDrawinglayerOpt;
 
     bool                        mbPageVisible : 1;
+    bool                        mbPageShadowVisible : 1;
     bool                        mbPageBorderVisible : 1;
     bool                        mbBordVisible : 1;
     bool                        mbGridVisible : 1;
@@ -372,6 +373,9 @@ public:
     /// Draw Page as a white area or not
     bool IsPageVisible() const { return mbPageVisible; }
 
+    /// Draw Page shadow or not
+    bool IsPageShadowVisible() const { return mbPageShadowVisible; }
+
     /// Draw Page as a white area or not
     bool IsPageBorderVisible() const { return mbPageBorderVisible; }
 
@@ -392,6 +396,7 @@ public:
 
     Color GetGridColor() const { return maGridColor;}
     void SetPageVisible(bool bOn = true) { mbPageVisible=bOn; InvalidateAllWin(); }
+    void SetPageShadowVisible(bool bOn = true) { mbPageShadowVisible=bOn; InvalidateAllWin(); }
     void SetPageBorderVisible(bool bOn = true) { mbPageBorderVisible=bOn; InvalidateAllWin(); }
     void SetBordVisible(bool bOn = true) { mbBordVisible=bOn; InvalidateAllWin(); }
     void SetGridVisible(bool bOn = true) { mbGridVisible=bOn; InvalidateAllWin(); }
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 04d74d6..7c2cc56 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -32,8 +32,9 @@ static int help()
 {
     fprintf(stderr, "Usage: gtktiledviewer <absolute-path-to-libreoffice-install's-program-directory> <path-to-document> [<options> ... ]\n\n");
     fprintf(stderr, "Options:\n\n");
-    fprintf(stderr, "--hide-whitespace: Hide whitespace between pages in text documents.\n");
     fprintf(stderr, "--background-color <color>: Set custom background color, e.g. 'yellow'.\n");
+    fprintf(stderr, "--hide-page-shadow: Hide page/slide shadow.\n");
+    fprintf(stderr, "--hide-whitespace: Hide whitespace between pages in text documents.\n");
     return 1;
 }
 
@@ -507,12 +508,7 @@ static void createModelAndView(const char* pLOPath, const char* pDocPath, const
     for (size_t i = 0; i < rArguments.size(); ++i)
     {
         const std::string& rArgument = rArguments[i];
-        if (rArgument == "--hide-whitespace")
-        {
-            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/type", '/'), "boolean");
-            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/value", '/'), true);
-        }
-        else if (rArgument == "--background-color" && i + 1 < rArguments.size())
+        if (rArgument == "--background-color" && i + 1 < rArguments.size())
         {
             GdkRGBA color;
             gdk_rgba_parse(&color, rArguments[i + 1].c_str());
@@ -520,7 +516,18 @@ static void createModelAndView(const char* pLOPath, const char* pDocPath, const
             gtk_widget_override_background_color(gtk_widget_get_toplevel(pDocView), GTK_STATE_FLAG_NORMAL, &color);
             SAL_WNODEPRECATED_DECLARATIONS_POP
         }
+        else if (rArgument == "--hide-page-shadow")
+        {
+            aTree.put(boost::property_tree::ptree::path_type(".uno:ShowBorderShadow/type", '/'), "boolean");
+            aTree.put(boost::property_tree::ptree::path_type(".uno:ShowBorderShadow/value", '/'), false);
+        }
+        else if (rArgument == "--hide-whitespace")
+        {
+            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/type", '/'), "boolean");
+            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/value", '/'), true);
+        }
     }
+
     std::stringstream aStream;
     boost::property_tree::write_json(aStream, aTree);
     std::string aArguments = aStream.str();
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 6e23890..36fbeec 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2359,7 +2359,7 @@ Size SdXImpressDocument::getDocumentSize()
     return Size(convertMm100ToTwip(aSize.getWidth()), convertMm100ToTwip(aSize.getHeight()));
 }
 
-void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
+void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
 {
     SolarMutexGuard aGuard;
 
@@ -2371,6 +2371,13 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
 
     if (DrawViewShell* pViewShell = GetViewShell())
     {
+        DrawView* pDrawView = pViewShell->GetDrawView();
+        for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
+        {
+            const beans::PropertyValue& rValue = rArguments[i];
+            if (rValue.Name == ".uno:ShowBorderShadow" && rValue.Value.has<bool>())
+                pDrawView->SetPageShadowVisible(rValue.Value.get<bool>());
+        }
         // Disable map mode, so that it's possible to send mouse event coordinates
         // in logic units.
         if (sd::Window* pWindow = pViewShell->GetActiveWindow())
@@ -2383,7 +2390,7 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
         // (whereas with async loading images start being loaded after
         //  we have painted the tile, resulting in an invalidate, followed
         //  by the tile being rerendered - which is wasteful and ugly).
-        pViewShell->GetDrawView()->SetSwapAsynchron(false);
+        pDrawView->SetSwapAsynchron(false);
     }
 }
 
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index fcf2ae1..27f951f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -266,6 +266,11 @@ bool ViewObjectContactOfPageShadow::isPrimitiveVisible(const DisplayInfo& rDispl
         return false;
     }
 
+    if(!pSdrPageView->GetView().IsPageShadowVisible())
+    {
+        return false;
+    }
+
     // no page shadow for preview renderers
     if(GetObjectContact().IsPreviewRenderer())
     {
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 27eba2b..b14262d 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -163,6 +163,7 @@ void SdrPaintView::ImpClearVars()
     mpItemBrowser=nullptr;
 #endif
     mbPageVisible=true;
+    mbPageShadowVisible=true;
     mbPageBorderVisible=true;
     mbBordVisible=true;
     mbGridVisible=true;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 26f9b69..2a7d9d2 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3225,6 +3225,8 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
         const beans::PropertyValue& rValue = rArguments[i];
         if (rValue.Name == ".uno:HideWhitespace" && rValue.Value.has<bool>())
             aViewOption.SetHideWhitespaceMode(rValue.Value.get<bool>());
+        else if (rValue.Name == ".uno:ShowBorderShadow" && rValue.Value.has<bool>())
+            SwViewOption::SetAppearanceFlag(VIEWOPT_SHADOW , rValue.Value.get<bool>());
     }
     pViewShell->ApplyViewOptions(aViewOption);
 


More information about the Libreoffice-commits mailing list