[Libreoffice-commits] core.git: Branch 'feature/gsoc-tiled-rendering' - 124 commits - accessibility/source animations/source basctl/source basic/source bin/find-unused-defines.awk bin/find-unused-defines.sh bin/gbuild-to-ide chart2/source chart2/uiconfig comphelper/source config_host/config_version.h.in configmgr/source configure.ac connectivity/source cppcanvas/source cppuhelper/source cppuhelper/test cppu/qa cppu/source cui/source dbaccess/source desktop/source dtrans/source dtrans/test editeng/source external/clucene external/firebird filter/source forms/source formula/source fpicker/source framework/inc framework/source idl/inc include/basic include/comphelper include/editeng include/i18nlangtag include/LibreOfficeKit include/osl include/sfx2 include/svx include/toolkit include/tools include/tubes include/ucbhelper include/vcl io/test libreofficekit/qa libreofficekit/source offapi/com onlineupdate/source pyuno/source qadevOOo/tests reportbuilder/java RepositoryExternal.mk sal/qa sax/test sc/i nc scp2/inc sc/qa scripting/source sc/source sc/uiconfig sd/source sfx2/source solenv/gbuild solenv/gdb starmath/inc starmath/source stoc/source svl/source svx/inc svx/source svx/uiconfig sw/CppunitTest_sw_odfexport.mk sw/inc sw/qa sw/source toolkit/source ucb/source vbahelper/source vcl/inc vcl/opengl vcl/source vcl/unx vcl/win writerfilter/source xmlhelp/source xmloff/source

Pranav Kant pranavk at gnome.org
Wed Jul 29 09:13:37 PDT 2015


Rebased ref, commits from common ancestor:
commit 0f482ad82b57fd881935e939cbe7b674aab710ff
Author: Pranav Kant <pranavk at gnome.org>
Date:   Wed Jul 29 21:41:56 2015 +0530

    lokdocview: Don't use extern variable: lokThreadPool
    
    Change-Id: Ia208e3309bb64baf71ceb97cdf1b3b57b6120353

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index d13fb9b..47d75a3 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -49,6 +49,7 @@ struct _LOKDocViewPrivate
     LibreOfficeKitDocument* m_pDocument;
 
     TileBuffer m_aTileBuffer;
+    GThreadPool* lokThreadPool;
 
     gfloat m_fZoom;
     glong m_nDocumentWidthTwips;
@@ -151,8 +152,6 @@ G_DEFINE_TYPE_WITH_CODE (LOKDocView, lok_doc_view, GTK_TYPE_DRAWING_AREA,
 #pragma GCC diagnostic pop
 #endif
 
-GThreadPool* lokThreadPool;
-
 /// Helper struct used to pass the data from soffice thread -> main thread.
 struct CallbackData
 {
@@ -307,7 +306,7 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
         pLOEvent->m_nCharCode = nCharCode;
         pLOEvent->m_nKeyCode  = nKeyCode;
         g_task_set_task_data(task, pLOEvent, g_free);
-        g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+        g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
         g_object_unref(task);
     }
     else
@@ -318,7 +317,7 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
         pLOEvent->m_nCharCode = nCharCode;
         pLOEvent->m_nKeyCode  = nKeyCode;
         g_task_set_task_data(task, pLOEvent, g_free);
-        g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+        g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
         g_object_unref(task);
     }
 
@@ -486,7 +485,7 @@ setTilesInvalid (LOKDocView* pDocView, const GdkRectangle& rRectangle)
         for (int j = aStart.y; j < aEnd.y; j++)
         {
             GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
-            priv->m_aTileBuffer.setInvalid(i, j, priv->m_fZoom, task);
+            priv->m_aTileBuffer.setInvalid(i, j, priv->m_fZoom, task, priv->lokThreadPool);
             g_object_unref(task);
         }
     }
@@ -759,7 +758,7 @@ renderDocument(LOKDocView* pDocView, cairo_t* pCairo)
             if (bPaint)
             {
                 GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
-                Tile& currentTile = priv->m_aTileBuffer.getTile(nRow, nColumn, priv->m_fZoom, task);
+                Tile& currentTile = priv->m_aTileBuffer.getTile(nRow, nColumn, priv->m_fZoom, task, priv->lokThreadPool);
                 GdkPixbuf* pPixBuf = currentTile.getBuffer();
                 gdk_cairo_set_source_pixbuf (pCairo, pPixBuf,
                                              twipToPixel(aTileRectangleTwips.x, priv->m_fZoom),
@@ -897,7 +896,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
                 pLOEvent->m_nSetGraphicSelectionY = pixelToTwip(pEvent->y, priv->m_fZoom);
                 g_task_set_task_data(task, pLOEvent, g_free);
 
-                g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+                g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
                 g_object_unref(task);
 
                 return FALSE;
@@ -916,7 +915,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
             pLOEvent->m_nSetGraphicSelectionY = pixelToTwip(pEvent->y, priv->m_fZoom);
             g_task_set_task_data(task, pLOEvent, g_free);
 
-            g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+            g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
             g_object_unref(task);
 
             return FALSE;
@@ -965,7 +964,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
                     pLOEvent->m_nSetGraphicSelectionY = pixelToTwip(priv->m_aGraphicHandleRects[i].y + priv->m_aGraphicHandleRects[i].height / 2, priv->m_fZoom);
                     g_task_set_task_data(task, pLOEvent, g_free);
 
-                    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+                    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
                     g_object_unref(task);
 
                     return FALSE;
@@ -993,7 +992,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
         pLOEvent->m_nPostMouseEventCount = nCount;
         g_task_set_task_data(task, pLOEvent, g_free);
 
-        g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+        g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
         g_object_unref(task);
         break;
     }
@@ -1011,7 +1010,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
         pLOEvent->m_nPostMouseEventCount = nCount;
         g_task_set_task_data(task, pLOEvent, g_free);
 
-        g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+        g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
         g_object_unref(task);
         break;
     }
@@ -1098,7 +1097,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent)
         pLOEvent->m_nSetGraphicSelectionY = pixelToTwip(pEvent->y, priv->m_fZoom);
         g_task_set_task_data(task, pLOEvent, g_free);
 
-        g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+        g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
         g_object_unref(task);
 
         return FALSE;
@@ -1114,7 +1113,7 @@ lok_doc_view_signal_motion (GtkWidget* pWidget, GdkEventMotion* pEvent)
     pLOEvent->m_nPostMouseEventCount = 1;
     g_task_set_task_data(task, pLOEvent, g_free);
 
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 
     return FALSE;
@@ -1352,6 +1351,12 @@ static void lok_doc_view_init (LOKDocView* pDocView)
                           |GDK_BUTTON_MOTION_MASK
                           |GDK_KEY_PRESS_MASK
                           |GDK_KEY_RELEASE_MASK);
+
+    priv->lokThreadPool = g_thread_pool_new(lokThreadFunc,
+                                            NULL,
+                                            1,
+                                            FALSE,
+                                            NULL);
 }
 
 static void lok_doc_view_set_property (GObject* object, guint propId, const GValue *value, GParamSpec *pspec)
@@ -1720,12 +1725,6 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
                      g_cclosure_marshal_VOID__STRING,
                      G_TYPE_NONE, 1,
                      G_TYPE_STRING);
-
-    lokThreadPool = g_thread_pool_new(lokThreadFunc,
-                                      NULL,
-                                      1,
-                                      FALSE,
-                                      NULL);
 }
 
 /**
@@ -1788,7 +1787,7 @@ lok_doc_view_open_document (LOKDocView* pDocView,
     priv->m_aDocPath = pPath;
     g_task_set_task_data(task, pLOEvent, g_free);
 
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 }
 
@@ -1860,12 +1859,14 @@ lok_doc_view_get_part (LOKDocView* pDocView)
 SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_set_part (LOKDocView* pDocView, int nPart)
 {
+    LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private (pDocView));
     GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
     LOEvent* pLOEvent = new LOEvent(LOK_SET_PART);
+
     pLOEvent->m_nPart = nPart;
     g_task_set_task_data(task, pLOEvent, g_free);
 
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 }
 
@@ -1880,12 +1881,13 @@ SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_set_partmode(LOKDocView* pDocView,
                           int nPartMode)
 {
+    LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private (pDocView));
     GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
     LOEvent* pLOEvent = new LOEvent(LOK_SET_PARTMODE);
     pLOEvent->m_nPartMode = nPartMode;
     g_task_set_task_data(task, pLOEvent, g_free);
 
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 }
 
@@ -1908,12 +1910,13 @@ SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_set_edit(LOKDocView* pDocView,
                       gboolean bEdit)
 {
+    LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private (pDocView));
     GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
     LOEvent* pLOEvent = new LOEvent(LOK_SET_EDIT);
     pLOEvent->m_bEdit = bEdit;
     g_task_set_task_data(task, pLOEvent, g_free);
 
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 }
 
@@ -1943,14 +1946,14 @@ lok_doc_view_post_command (LOKDocView* pDocView,
                            const gchar* pCommand,
                            const gchar* pArguments)
 {
-
+    LOKDocViewPrivate* priv = static_cast<LOKDocViewPrivate*>(lok_doc_view_get_instance_private (pDocView));
     GTask* task = g_task_new(pDocView, NULL, NULL, NULL);
     LOEvent* pLOEvent = new LOEvent(LOK_POST_COMMAND);
     pLOEvent->m_pCommand = pCommand;
     pLOEvent->m_pArguments  = g_strdup(pArguments);
 
     g_task_set_task_data(task, pLOEvent, g_free);
-    g_thread_pool_push(lokThreadPool, g_object_ref(task), NULL);
+    g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), NULL);
     g_object_unref(task);
 }
 
diff --git a/libreofficekit/source/gtk/tilebuffer.cxx b/libreofficekit/source/gtk/tilebuffer.cxx
index 21ea58b..85f6eb0 100644
--- a/libreofficekit/source/gtk/tilebuffer.cxx
+++ b/libreofficekit/source/gtk/tilebuffer.cxx
@@ -13,8 +13,6 @@
 #define g_info(...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__)
 #endif
 
-extern GThreadPool* lokThreadPool;
-
 /* ------------------
    Utility functions
    ------------------
@@ -62,7 +60,8 @@ void TileBuffer::resetAllTiles()
     }
 }
 
-void TileBuffer::setInvalid(int x, int y, float fZoom, GTask* task)
+void TileBuffer::setInvalid(int x, int y, float fZoom, GTask* task,
+                            GThreadPool* lokThreadPool)
 {
     int index = x * m_nWidth + y;
     g_info("Setting tile invalid (%d, %d)", x, y);
@@ -79,7 +78,8 @@ void TileBuffer::setInvalid(int x, int y, float fZoom, GTask* task)
     }
 }
 
-Tile& TileBuffer::getTile(int x, int y, float fZoom, GTask* task)
+Tile& TileBuffer::getTile(int x, int y, float fZoom, GTask* task,
+                          GThreadPool* lokThreadPool)
 {
     int index = x * m_nWidth + y;
 
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index dabf72f..4f0fc33 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -103,11 +103,15 @@ class TileBuffer
 
        @param x the tile along the x-axis of the buffer
        @param y the tile along the y-axis of the buffer
-       @param aZoom This function needs the zoom factor to draw the tile using paintTile()
+       @param aZoom current zoom factor of the document
+       @param task GTask object containing the necessary data
+       @param pool GThreadPool managed by the widget instance used for all the
+       LOK calls made by widget. It is needed here because getTile invokes one
+       of the LOK call : paintTile.
 
        @return the tile at the mentioned position (x, y)
      */
-    Tile& getTile(int x, int y, float aZoom, GTask* task);
+    Tile& getTile(int x, int y, float aZoom, GTask* task, GThreadPool* pool);
     /// Destroys all the tiles in the tile buffer; also frees the memory allocated
     /// for all the Tile objects.
     void resetAllTiles();
@@ -117,8 +121,13 @@ class TileBuffer
 
        @param x the position of tile along x-axis
        @param y the position of tile along y-axis
+       @param zoom zoom factor of the document
+       @param task GTask object containing the necessary data
+       @param pool GThreadPool managed by the widget instance used for all the
+       LOK calls made by widget. It is needed here because setInvalid() invokes one
+       of the LOK call : paintTile.
      */
-    void setInvalid(int x, int y, float zoom, GTask* task);
+    void setInvalid(int x, int y, float zoom, GTask* task, GThreadPool*);
 
     /// Contains the reference to the LOK Document that this tile buffer is for.
     LibreOfficeKitDocument *m_pLOKDocument;
commit 2d4223e32628d12b9b256b532819e6cced79178e
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue Jul 28 17:34:20 2015 +0200

    Some (mostly HIG) tweaks to chart data series panel
    
    Additional tweak: use 'Data series %1' as frame label, substitute
    %1 by real series name
    
    Change-Id: Id5bee4c2e52ccd98fa40649ec539b3efdee55962
    Reviewed-on: https://gerrit.libreoffice.org/17387
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 644766d..85336ff 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -302,9 +302,11 @@ ChartSeriesPanel::ChartSeriesPanel(
     get(mpRBPrimaryAxis, "radiobutton_primary_axis");
     get(mpRBSecondaryAxis, "radiobutton_secondary_axis");
 
+    get(mpBoxLabelPlacement, "datalabel_box");
     get(mpLBLabelPlacement, "comboboxtext_label");
 
     get(mpFTSeriesName, "label_series_name");
+    get(mpFTSeriesTemplate, "label_series_tmpl");
 
     Initialize();
 }
@@ -330,9 +332,11 @@ void ChartSeriesPanel::dispose()
     mpRBPrimaryAxis.clear();
     mpRBSecondaryAxis.clear();
 
+    mpBoxLabelPlacement.clear();
     mpLBLabelPlacement.clear();
 
     mpFTSeriesName.clear();
+    mpFTSeriesTemplate.clear();
 
     PanelLayout::dispose();
 }
@@ -374,10 +378,12 @@ void ChartSeriesPanel::updateData()
     mpRBPrimaryAxis->Check(bPrimaryAxis);
     mpRBSecondaryAxis->Check(!bPrimaryAxis);
 
-    mpLBLabelPlacement->Enable(bLabelVisible);
+    mpBoxLabelPlacement->Enable(bLabelVisible);
     mpLBLabelPlacement->SelectEntryPos(getDataLabelPlacement(mxModel, aCID));
 
-    mpFTSeriesName->SetText(getSeriesLabel(mxModel, aCID));
+    OUString aFrameLabel = mpFTSeriesTemplate->GetText();
+    aFrameLabel = aFrameLabel.replaceFirst("%1", getSeriesLabel(mxModel, aCID));
+    mpFTSeriesName->SetText(aFrameLabel);
 }
 
 VclPtr<vcl::Window> ChartSeriesPanel::Create (
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
index 156bbc7..d125c2f 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
@@ -23,6 +23,7 @@
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
 #include <svx/sidebar/PanelLayout.hxx>
+#include <vcl/layout.hxx>
 
 #include "ChartSidebarModifyListener.hxx"
 #include "ChartSidebarSelectionListener.hxx"
@@ -91,9 +92,11 @@ private:
     VclPtr<RadioButton> mpRBPrimaryAxis;
     VclPtr<RadioButton> mpRBSecondaryAxis;
 
+    VclPtr<VclHBox> mpBoxLabelPlacement;
     VclPtr<ListBox> mpLBLabelPlacement;
 
     VclPtr<FixedText> mpFTSeriesName;
+    VclPtr<FixedText> mpFTSeriesTemplate;
 
     css::uno::Reference<css::frame::XFrame> mxFrame;
 
diff --git a/chart2/uiconfig/ui/sidebarseries.ui b/chart2/uiconfig/ui/sidebarseries.ui
index 88180b5..bdaca87 100644
--- a/chart2/uiconfig/ui/sidebarseries.ui
+++ b/chart2/uiconfig/ui/sidebarseries.ui
@@ -5,147 +5,297 @@
   <object class="GtkGrid" id="ChartSeriesPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <property name="border_width">6</property>
     <child>
-      <object class="GtkGrid" id="grid2">
+      <object class="GtkBox" id="box1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
         <child>
-          <object class="GtkLabel" id="label_series_name">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">label</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_label">
-            <property name="label" translatable="yes">Show data label</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_trendline">
-            <property name="label" translatable="yes">Trendline</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label2">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Axis:</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkRadioButton" id="radiobutton_primary_axis">
-            <property name="label" translatable="yes">Primary Y-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="active">True</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkRadioButton" id="radiobutton_secondary_axis">
-            <property name="label" translatable="yes">Secondary Y-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0.49000000953674316</property>
-            <property name="active">True</property>
-            <property name="draw_indicator">True</property>
-            <property name="group">radiobutton_primary_axis</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_y_error">
-            <property name="label" translatable="yes">Y Error Bars</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">5</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_x_error">
-            <property name="label" translatable="yes">X Error Bars</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">5</property>
-          </packing>
+          <placeholder/>
         </child>
         <child>
-          <object class="GtkComboBoxText" id="comboboxtext_label">
+          <object class="GtkFrame" id="frame1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <items>
-              <item translatable="yes">Above</item>
-              <item translatable="yes">Below</item>
-              <item translatable="yes">Center</item>
-              <item translatable="yes">Outside</item>
-              <item translatable="yes">Inside</item>
-              <item translatable="yes">Near origin</item>
-            </items>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkBox" id="box2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkBox" id="box3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkCheckButton" id="checkbutton_label">
+                            <property name="label" translatable="yes">Show data labels</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkBox" id="datalabel_box">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="margin_left">12</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkLabel" id="label_box">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">P_lacement:</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">comboboxtext_label</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBoxText" id="comboboxtext_label">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <items>
+                                  <item translatable="yes">Above</item>
+                                  <item translatable="yes">Below</item>
+                                  <item translatable="yes">Center</item>
+                                  <item translatable="yes">Outside</item>
+                                  <item translatable="yes">Inside</item>
+                                  <item translatable="yes">Near origin</item>
+                                </items>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_trendline">
+                        <property name="label" translatable="yes">Show trendline</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="top_padding">6</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkBox" id="box6">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <object class="GtkCheckButton" id="checkbutton_y_error">
+                                    <property name="label" translatable="yes">Y error bars</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="checkbutton_x_error">
+                                    <property name="label" translatable="yes">X error bars</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Error Bars</property>
+                            <attributes>
+                              <attribute name="weight" value="bold"/>
+                            </attributes>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="top_padding">6</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkBox" id="box5">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <object class="GtkRadioButton" id="radiobutton_primary_axis">
+                                    <property name="label" translatable="yes">Primary Y axis</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="radiobutton_secondary_axis">
+                                    <property name="label" translatable="yes">Secondary Y axis</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="axis_label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Align Series to Axis</property>
+                            <attributes>
+                              <attribute name="weight" value="bold"/>
+                            </attributes>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label_series_tmpl">
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Data series '%1'</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">5</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label_series_name">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label">label</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">1</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
           </packing>
         </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
       </object>
       <packing>
         <property name="left_attach">0</property>
commit 93d301a287141013c28556570d67ffc9d3286b2a
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue Jul 28 16:19:59 2015 +0200

    Some (mostly HIG) tweaks to chart elements panel
    
    As I wanted to represent subsections as frames (it looks kinda
    better with bold labels), I tried to emulate grid behaviour by
    putting widgets into 2 size groups
    
    Other tweaks include disabling legend position listbox when legend
    is not to be shown and missing clear() of that listbox
    
    Change-Id: I0b635fe5aba1580542cf982e2e6be02eb0056352
    Reviewed-on: https://gerrit.libreoffice.org/17386
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index fd498ff..08d1fea 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -310,6 +310,7 @@ ChartElementsPanel::ChartElementsPanel(
     get(mpCBGridHorizontalMinor,  "checkbutton_gridline_horizontal_minor");
 
     get(mpLBLegendPosition, "comboboxtext_legend");
+    get(mpBoxLegend, "box_legend");
 
     Initialize();
 }
@@ -342,6 +343,9 @@ void ChartElementsPanel::dispose()
     mpCBGridVerticalMinor.clear();
     mpCBGridHorizontalMinor.clear();
 
+    mpLBLegendPosition.clear();
+    mpBoxLegend.clear();
+
     PanelLayout::dispose();
 }
 
@@ -491,7 +495,10 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
     else if (pCheckBox == mpCB2ndYAxisTitle.get())
         setTitleVisible(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCBLegend.get())
+    {
+        mpBoxLegend->Enable( bChecked );
         setLegendVisible(mxModel, bChecked);
+    }
     else if (pCheckBox == mpCBGridVerticalMajor.get())
         setGridVisible(mxModel, GridType::VERT_MAJOR, bChecked);
     else if (pCheckBox == mpCBGridHorizontalMajor.get())
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 766915c..47265fb 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -23,6 +23,7 @@
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
 #include <svx/sidebar/PanelLayout.hxx>
+#include <vcl/layout.hxx>
 #include "ChartSidebarModifyListener.hxx"
 
 #include <com/sun/star/util/XModifyListener.hpp>
@@ -95,6 +96,7 @@ private:
     VclPtr<CheckBox> mpCBGridHorizontalMinor;
 
     VclPtr<ListBox> mpLBLegendPosition;
+    VclPtr<VclHBox> mpBoxLegend;
 
     css::uno::Reference<css::frame::XFrame> mxFrame;
     ::sfx2::sidebar::EnumContext            maContext;
diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui
index 94d1ff0..8250d6e 100644
--- a/chart2/uiconfig/ui/sidebarelements.ui
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -5,338 +5,487 @@
   <object class="GtkGrid" id="ChartElementsPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <property name="border_width">6</property>
     <child>
-      <object class="GtkGrid" id="container">
+      <object class="GtkBox" id="container">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="resize_mode">immediate</property>
-        <property name="row_homogeneous">True</property>
-        <property name="column_homogeneous">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
         <child>
-          <object class="GtkCheckButton" id="checkbutton_subtitle">
-            <property name="label" translatable="yes">Subtitle</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_x_axis">
-            <property name="label" translatable="yes">X-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label_axes">
+          <object class="GtkFrame" id="frame1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">Axes</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="row_spacing">6</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_subtitle">
+                        <property name="label" translatable="yes">Subtitle</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_title">
+                        <property name="label" translatable="yes">Title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="l">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Title</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">2</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkCheckButton" id="checkbutton_title">
-            <property name="label" translatable="yes">Title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label_title">
+          <object class="GtkFrame" id="frame2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">Title</property>
-            <property name="justify">right</property>
-            <property name="ellipsize">end</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_x_axis_title">
-            <property name="label" translatable="yes">X-axis title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="row_spacing">6</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_x_axis">
+                        <property name="label" translatable="yes">X axis</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_x_axis_title">
+                        <property name="label" translatable="yes">X axis title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_y_axis">
+                        <property name="label" translatable="yes">Y axis</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_y_axis_title">
+                        <property name="label" translatable="yes">Y axis title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_z_axis">
+                        <property name="label" translatable="yes">Z axis</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_z_axis_title">
+                        <property name="label" translatable="yes">Z axis title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_2nd_x_axis">
+                        <property name="label" translatable="yes">2nd X axis</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_2nd_x_axis_title">
+                        <property name="label" translatable="yes">2nd X axis title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_2nd_y_axis">
+                        <property name="label" translatable="yes">2nd Y axis</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_2nd_y_axis_title">
+                        <property name="label" translatable="yes">2nd Y axis title</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">4</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label_axes">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Axes</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">3</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkCheckButton" id="checkbutton_y_axis">
-            <property name="label" translatable="yes">Y-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_y_axis_title">
-            <property name="label" translatable="yes">Y-axis title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_z_axis">
-            <property name="label" translatable="yes">Z-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0.47999998927116394</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">5</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_z_axis_title">
-            <property name="label" translatable="yes">Z-axis title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">5</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_2nd_x_axis_title">
-            <property name="label" translatable="yes">2nd X-axis title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">6</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_2nd_x_axis">
-            <property name="label" translatable="yes">2nd X-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">6</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_2nd_y_axis">
-            <property name="label" translatable="yes">2nd Y-Axis</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0.54000002145767212</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">7</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_2nd_y_axis_title">
-            <property name="label" translatable="yes">2nd Y-axis title</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">7</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label_legend">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">Legend</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">8</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_legend">
-            <property name="label" translatable="yes">Show</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">9</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkComboBoxText" id="comboboxtext_legend">
+          <object class="GtkFrame" id="frame3">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <items>
-              <item translatable="yes">Bottom</item>
-              <item translatable="yes">Left</item>
-              <item translatable="yes">Right</item>
-              <item translatable="yes">Top</item>
-              <item translatable="yes">Manual</item>
-            </items>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkBox" id="box2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_legend">
+                        <property name="label" translatable="yes">Show legend</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkBox" id="box_legend">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkLabel" id="placement_label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">end</property>
+                            <property name="label" translatable="yes">_Placement:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">comboboxtext_legend</property>
+                            <property name="ellipsize">end</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkComboBoxText" id="comboboxtext_legend">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <items>
+                              <item translatable="yes">Bottom</item>
+                              <item translatable="yes">Left</item>
+                              <item translatable="yes">Right</item>
+                              <item translatable="yes">Top</item>
+                              <item translatable="yes">Manual</item>
+                            </items>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label_legen">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Legend</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">9</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label_grid">
+          <object class="GtkFrame" id="frame4">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes">Gridlines</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">10</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_gridline_vertical_major">
-            <property name="label" translatable="yes">Vertical Major</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="row_spacing">6</property>
+                    <property name="column_spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_gridline_vertical_major">
+                        <property name="label" translatable="yes">Vertical major</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_gridline_vertical_minor">
+                        <property name="label" translatable="yes">Vertical minor</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_major">
+                        <property name="label" translatable="yes">Horizontal major</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_minor">
+                        <property name="label" translatable="yes">Horizontal minor</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label_gri">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Gridlines</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">11</property>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_gridline_vertical_minor">
-            <property name="label" translatable="yes">Vertical minor</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">11</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_major">
-            <property name="label" translatable="yes">Horizontal Major</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0.56000000238418579</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">0</property>
-            <property name="top_attach">12</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="checkbutton_gridline_horizontal_minor">
-            <property name="label" translatable="yes">Horizontal major</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">12</property>
-          </packing>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
       </object>
       <packing>
         <property name="left_attach">0</property>
-        <property name="top_attach">0</property>
+        <property name="top_attach">1</property>
       </packing>
     </child>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+  <object class="GtkSizeGroup" id="sizegroup1">
+    <widgets>
+      <widget name="checkbutton_title"/>
+      <widget name="checkbutton_x_axis"/>
+      <widget name="checkbutton_y_axis"/>
+      <widget name="checkbutton_z_axis"/>
+      <widget name="checkbutton_2nd_x_axis"/>
+      <widget name="checkbutton_2nd_y_axis"/>
+      <widget name="placement_label"/>
+      <widget name="checkbutton_gridline_vertical_major"/>
+      <widget name="checkbutton_gridline_horizontal_major"/>
+    </widgets>
+  </object>
+  <object class="GtkSizeGroup" id="sizegroup2">
+    <widgets>
+      <widget name="checkbutton_subtitle"/>
+      <widget name="checkbutton_x_axis_title"/>
+      <widget name="checkbutton_y_axis_title"/>
+      <widget name="checkbutton_z_axis_title"/>
+      <widget name="checkbutton_2nd_x_axis_title"/>
+      <widget name="checkbutton_2nd_y_axis_title"/>
+      <widget name="comboboxtext_legend"/>
+      <widget name="checkbutton_gridline_vertical_minor"/>
+      <widget name="checkbutton_gridline_horizontal_minor"/>
+    </widgets>
   </object>
 </interface>
commit 09aa0d142e9573fac898ea270d659e3ed7ef019c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Jul 29 15:16:55 2015 +0300

    This OWNERDRAW thing has been commented-out since 2003
    
    Change-Id: I3170dec0578e0e54a2edb85e0a3a8fcd796b94ae

diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx
index 422701a..0b623e2 100644
--- a/vcl/win/source/window/salmenu.cxx
+++ b/vcl/win/source/window/salmenu.cxx
@@ -31,11 +31,6 @@
 #include <impbmp.hxx>
 #include <salgdi.hxx>
 
-// uncomment the following line to have ownerdrawn menus, ie, with bitmaps
-// however, this is incompatible with OLE inplace editing
-// so it is not activated by default
-//#define OWNERDRAW
-
 static DWORD myerr=0;
 
 bool SalData::IsKnownMenuHandle( HMENU hMenu )
@@ -98,11 +93,6 @@ SalMenuItem* WinSalInstance::CreateMenuItem( const SalItemParams* pItemData )
 
         pSalMenuItem->mInfo.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID | MIIM_DATA;
         pSalMenuItem->mInfo.fType = MFT_STRING;
-#ifdef OWNERDRAW
-        if( pItemData->pMenu && !pItemData->pMenu->IsMenuBar() )
-            pSalMenuItem->mInfo.fType |= MFT_OWNERDRAW;
-        pSalMenuItem->mInfo.fState = MFS_ENABLED;
-#endif
         pSalMenuItem->mInfo.dwTypeData = (LPWSTR) pSalMenuItem->mText.getStr();
         pSalMenuItem->mInfo.cch = pSalMenuItem->mText.getLength();
 
@@ -310,10 +300,6 @@ void WinSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OU
         pWItem->mText = pWItem->mText.replaceAll( "~", "&" );
         pWItem->mInfo.fMask = MIIM_TYPE | MIIM_DATA;
         pWItem->mInfo.fType = MFT_STRING;
-#ifdef OWNERDRAW
-        if( pWItem->mpMenu && !((Menu*) pWItem->mpMenu)->IsMenuBar() )
-            pWItem->mInfo.fType |= MFT_OWNERDRAW;
-#endif
 
         // combine text and accelerator text
         OUString aStr( pWItem->mText );
@@ -339,10 +325,7 @@ void WinSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const
         pWItem->mAccelText = rKeyName;
         pWItem->mInfo.fMask = MIIM_TYPE | MIIM_DATA;
         pWItem->mInfo.fType = MFT_STRING;
-#ifdef OWNERDRAW
-        if( pWItem->mpMenu && !((Menu*)pWItem->mpMenu)->IsMenuBar() )
-            pWItem->mInfo.fType |= MFT_OWNERDRAW;
-#endif
+
         // combine text and accelerator text
         OUString aStr( pWItem->mText );
         if( pWItem->mAccelText.getLength() )
commit a33e0379bbe2c7651315f5cdc5925adab33b573b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jul 29 12:40:49 2015 +0200

    tdf#92982 vcl rendercontext: move buffer from PaintHelper to ImplFrameData
    
    With this, code that wants to take a persistent render context (e.g.
    vcl::Cursor) will be able to do so. This commit just moves the buffer,
    though: it's still created / deleted by PaintHelper.
    
    Having it in ImplFrameData means that we'll have one buffer / one
    system window: i.e. toplevel window and its sub-widgets share a buffer.
    
    Change-Id: Ic37220a2a483a7389aa04cd4313b6fc61a5408bf

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index f700794..d67b898 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -729,11 +729,8 @@ private:
         This function is kind of recursive - it may be called from the
         PaintHelper destructor; and on the other hand it creates PaintHelper
         that (when destructed) calls other ImplCallPaint()'s.
-
-        @param rBuffer VirtualDevice for double-buffering.  It is only passed
-        here, the actual handling happens in the PaintHelper.
     */
-    SAL_DLLPRIVATE void                 ImplCallPaint(const VclPtr<VirtualDevice>& rBuffer, const vcl::Region* pRegion, sal_uInt16 nPaintFlags);
+    SAL_DLLPRIVATE void                 ImplCallPaint(const vcl::Region* pRegion, sal_uInt16 nPaintFlags);
 
     SAL_DLLPRIVATE void                 ImplCallOverlapPaint();
     SAL_DLLPRIVATE void                 ImplPostPaint();
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 0748760..39b94c0 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -179,6 +179,7 @@ struct ImplFrameData
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
 
     bool                mbInternalDragGestureRecognizer;
+    VclPtr<VirtualDevice> mpBuffer; ///< Buffer for the double-buffering
 };
 
 struct ImplAccessibleInfos
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index a47c042..a94e3d0 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -44,7 +44,6 @@ class PaintHelper
 {
 private:
     VclPtr<vcl::Window> m_pWindow;
-    VclPtr<VirtualDevice> m_pBuffer; ///< Buffer for the double-buffering
     vcl::Region* m_pChildRegion;
     Rectangle m_aSelectionRect;
     Rectangle m_aPaintRect;
@@ -55,7 +54,7 @@ private:
     bool m_bRestoreCursor : 1;
     bool m_bCreatedBuffer : 1; ///< This PaintHelper created the buffer for the double-buffering, and should dispose it when being destructed (if it is still alive by then).
 public:
-    PaintHelper(vcl::Window* pWindow, const VclPtr<VirtualDevice>& rBuffer, sal_uInt16 nPaintFlags);
+    PaintHelper(vcl::Window* pWindow, sal_uInt16 nPaintFlags);
     void SetPop()
     {
         m_bPop = true;
@@ -86,10 +85,10 @@ public:
     }
     void DoPaint(const vcl::Region* pRegion);
 
-    /// Create m_pBuffer, and set it up to have the same settings as m_pWindow.
+    /// Create the buffer, and set it up to have the same settings as m_pWindow.
     void CreateBuffer();
 
-    /// Setup m_pBuffer according to the settings of the current m_pWindow.
+    /// Setup the buffer according to the settings of the current m_pWindow.
     void SetupBuffer();
 
     /// Paint the content of the buffer to the current m_pWindow.
@@ -98,9 +97,8 @@ public:
     ~PaintHelper();
 };
 
-PaintHelper::PaintHelper(vcl::Window *pWindow, const VclPtr<VirtualDevice>& rBuffer, sal_uInt16 nPaintFlags)
+PaintHelper::PaintHelper(vcl::Window *pWindow, sal_uInt16 nPaintFlags)
     : m_pWindow(pWindow)
-    , m_pBuffer(rBuffer)
     , m_pChildRegion(NULL)
     , m_nPaintFlags(nPaintFlags)
     , m_bPop(false)
@@ -111,9 +109,10 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, const VclPtr<VirtualDevice>& rBuf
 
 void PaintHelper::CreateBuffer()
 {
-    assert(!m_pBuffer);
+    ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
+    assert(!pFrameData->mpBuffer);
 
-    m_pBuffer = VclPtrInstance<VirtualDevice>();
+    pFrameData->mpBuffer = VclPtrInstance<VirtualDevice>();
     m_bCreatedBuffer = true;
 
     SetupBuffer();
@@ -122,52 +121,54 @@ void PaintHelper::CreateBuffer()
     m_aPaintRectMapMode = m_pWindow->GetMapMode();
 
     // update the output size now, after all the settings were copied
-    m_pBuffer->SetOutputSize(m_pWindow->GetOutputSize());
+    pFrameData->mpBuffer->SetOutputSize(m_pWindow->GetOutputSize());
 
     // we need to remember the mnOutOffX / mnOutOffY, but actually really
     // set it just temporarily for the subwidgets - so we are setting it here
     // only to remember the value & to be able to pass it to the descendants
     // FIXME: once everything's double-buffered, this is (hopefully) not
-    // necessary as the m_pBuffer is always created for the main window.
-    m_pBuffer->mnOutOffX = m_pWindow->GetOutOffXPixel();
-    m_pBuffer->mnOutOffY = m_pWindow->GetOutOffYPixel();
+    // necessary as the buffer is always created for the main window.
+    pFrameData->mpBuffer->mnOutOffX = m_pWindow->GetOutOffXPixel();
+    pFrameData->mpBuffer->mnOutOffY = m_pWindow->GetOutOffYPixel();
 }
 
 void PaintHelper::SetupBuffer()
 {
+    ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
     // transfer various settings
     // FIXME: this must disappear as we move to RenderContext only,
     // the painting must become state-less, so that no actual
     // vcl::Window setting affects this
     if (m_pWindow->IsBackground())
-        m_pBuffer->SetBackground(m_pWindow->GetBackground());
+        pFrameData->mpBuffer->SetBackground(m_pWindow->GetBackground());
     //else
         //SAL_WARN("vcl.doublebuffering", "the root of the double-buffering hierarchy should not have a transparent background");
 
-    m_pBuffer->SetClipRegion(m_pWindow->GetClipRegion());
-    m_pBuffer->SetFillColor(m_pWindow->GetFillColor());
-    m_pBuffer->SetFont(m_pWindow->GetFont());
-    m_pBuffer->SetLineColor(m_pWindow->GetLineColor());
-    m_pBuffer->SetMapMode(m_pWindow->GetMapMode());
-    m_pBuffer->SetRefPoint(m_pWindow->GetRefPoint());
-    m_pBuffer->SetSettings(m_pWindow->GetSettings());
-    m_pBuffer->SetTextColor(m_pWindow->GetTextColor());
-    m_pBuffer->SetTextLineColor(m_pWindow->GetTextLineColor());
-    m_pBuffer->SetOverlineColor(m_pWindow->GetOverlineColor());
-    m_pBuffer->SetTextFillColor(m_pWindow->GetTextFillColor());
-    m_pBuffer->SetTextAlign(m_pWindow->GetTextAlign());
-    m_pBuffer->SetRasterOp(m_pWindow->GetRasterOp());
-    m_pBuffer->SetLayoutMode(m_pWindow->GetLayoutMode());
-    m_pBuffer->SetDigitLanguage(m_pWindow->GetDigitLanguage());
+    pFrameData->mpBuffer->SetClipRegion(m_pWindow->GetClipRegion());
+    pFrameData->mpBuffer->SetFillColor(m_pWindow->GetFillColor());
+    pFrameData->mpBuffer->SetFont(m_pWindow->GetFont());
+    pFrameData->mpBuffer->SetLineColor(m_pWindow->GetLineColor());
+    pFrameData->mpBuffer->SetMapMode(m_pWindow->GetMapMode());
+    pFrameData->mpBuffer->SetRefPoint(m_pWindow->GetRefPoint());
+    pFrameData->mpBuffer->SetSettings(m_pWindow->GetSettings());
+    pFrameData->mpBuffer->SetTextColor(m_pWindow->GetTextColor());
+    pFrameData->mpBuffer->SetTextLineColor(m_pWindow->GetTextLineColor());
+    pFrameData->mpBuffer->SetOverlineColor(m_pWindow->GetOverlineColor());
+    pFrameData->mpBuffer->SetTextFillColor(m_pWindow->GetTextFillColor());
+    pFrameData->mpBuffer->SetTextAlign(m_pWindow->GetTextAlign());
+    pFrameData->mpBuffer->SetRasterOp(m_pWindow->GetRasterOp());
+    pFrameData->mpBuffer->SetLayoutMode(m_pWindow->GetLayoutMode());
+    pFrameData->mpBuffer->SetDigitLanguage(m_pWindow->GetDigitLanguage());
 }
 
 void PaintHelper::PaintBuffer()
 {
-    assert(m_pBuffer);
+    ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
+    assert(pFrameData->mpBuffer);
     assert(m_bCreatedBuffer);
 
-    m_pBuffer->mnOutOffX = 0;
-    m_pBuffer->mnOutOffY = 0;
+    pFrameData->mpBuffer->mnOutOffX = 0;
+    pFrameData->mpBuffer->mnOutOffY = 0;
 
     // copy the buffer content to the actual window
     // export VCL_DOUBLEBUFFERING_AVOID_PAINT=1 to see where we are
@@ -176,11 +177,11 @@ void PaintHelper::PaintBuffer()
     // window either above or in eg. an event handler]
     if (!getenv("VCL_DOUBLEBUFFERING_AVOID_PAINT"))
     {
-        // The map mode of m_pWindow and/or m_pBuffer may have changed since
+        // The map mode of m_pWindow and/or the buffer may have changed since
         // CreateBuffer(), set it back to what it was, otherwise unwanted
         // scaling or translating may happen.
         m_pWindow->SetMapMode(m_aPaintRectMapMode);
-        m_pBuffer->SetMapMode(m_aPaintRectMapMode);
+        pFrameData->mpBuffer->SetMapMode(m_aPaintRectMapMode);
 
         // Make sure that the +1 value GetSize() adds to the size is in pixels.
         Size aPaintRectSize;
@@ -194,7 +195,7 @@ void PaintHelper::PaintBuffer()
             aPaintRectSize = m_pWindow->PixelToLogic(aRectanglePixel.GetSize());
         }
 
-        m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), aPaintRectSize, m_aPaintRect.TopLeft(), aPaintRectSize, *m_pBuffer.get());
+        m_pWindow->DrawOutDev(m_aPaintRect.TopLeft(), aPaintRectSize, m_aPaintRect.TopLeft(), aPaintRectSize, *pFrameData->mpBuffer.get());
     }
 }
 
@@ -202,7 +203,8 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
 {
     WindowImpl* pWindowImpl = m_pWindow->ImplGetWindowImpl();
     vcl::Region* pWinChildClipRegion = m_pWindow->ImplGetWinChildClipRegion();
-    if (pWindowImpl->mnPaintFlags & IMPL_PAINT_PAINTALL || m_pBuffer)
+    ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
+    if (pWindowImpl->mnPaintFlags & IMPL_PAINT_PAINTALL || pFrameData->mpBuffer)
     {
         pWindowImpl->maInvalidateRegion = *pWinChildClipRegion;
     }
@@ -229,36 +231,36 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
         m_pWindow->BeginPaint();
 
         // double-buffering: setup the buffer if it does not exist
-        if (!m_pBuffer && m_pWindow->SupportsDoubleBuffering())
+        if (!pFrameData->mpBuffer && m_pWindow->SupportsDoubleBuffering())
             CreateBuffer();
 
         // double-buffering: if this window does not support double-buffering,
         // but we are in the middle of double-buffered paint, we might be
         // losing information
-        if (m_pBuffer && !m_pWindow->SupportsDoubleBuffering())
+        if (pFrameData->mpBuffer && !m_pWindow->SupportsDoubleBuffering())
             SAL_WARN("vcl.doublebuffering", "non-double buffered window in the double-buffered hierarchy, painting directly: " << typeid(*m_pWindow.get()).name());
 
-        if (m_pBuffer && m_pWindow->SupportsDoubleBuffering())
+        if (pFrameData->mpBuffer && m_pWindow->SupportsDoubleBuffering())
         {
             // double-buffering
             SetupBuffer();
-            m_pWindow->ApplySettings(*m_pBuffer.get());
+            m_pWindow->ApplySettings(*pFrameData->mpBuffer.get());
 
             // temporarily decrease the mnOutOffX/Y of the buffer for the
-            // subwidgets (because the m_pBuffer is our base here)
+            // subwidgets (because the buffer is our base here)
             // FIXME: once everything's double-buffered, this is (hopefully) not
-            // necessary as the m_pBuffer is always created for the main window.
-            long nOutOffX = m_pBuffer->mnOutOffX;
-            long nOutOffY = m_pBuffer->mnOutOffY;
-            m_pBuffer->mnOutOffX = m_pWindow->GetOutOffXPixel() - m_pBuffer->mnOutOffX;
-            m_pBuffer->mnOutOffY = m_pWindow->GetOutOffYPixel() - m_pBuffer->mnOutOffY;
+            // necessary as the buffer is always created for the main window.
+            long nOutOffX = pFrameData->mpBuffer->mnOutOffX;
+            long nOutOffY = pFrameData->mpBuffer->mnOutOffY;
+            pFrameData->mpBuffer->mnOutOffX = m_pWindow->GetOutOffXPixel() - pFrameData->mpBuffer->mnOutOffX;
+            pFrameData->mpBuffer->mnOutOffY = m_pWindow->GetOutOffYPixel() - pFrameData->mpBuffer->mnOutOffY;
 
-            m_pWindow->PushPaintHelper(this, *m_pBuffer.get());
-            m_pWindow->Paint(*m_pBuffer.get(), m_aPaintRect);
+            m_pWindow->PushPaintHelper(this, *pFrameData->mpBuffer.get());
+            m_pWindow->Paint(*pFrameData->mpBuffer.get(), m_aPaintRect);
 
             // restore the mnOutOffX/Y value
-            m_pBuffer->mnOutOffX = nOutOffX;
-            m_pBuffer->mnOutOffY = nOutOffY;
+            pFrameData->mpBuffer->mnOutOffX = nOutOffX;
+            pFrameData->mpBuffer->mnOutOffY = nOutOffY;
         }
         else
         {
@@ -495,6 +497,7 @@ PaintHelper::~PaintHelper()
         m_pWindow->PopPaintHelper(this);
     }
 
+    ImplFrameData* pFrameData = m_pWindow->mpWindowImpl->mpFrameData;
     if ( m_nPaintFlags & (IMPL_PAINT_PAINTALLCHILDREN | IMPL_PAINT_PAINTCHILDREN) )
     {
         // Paint from the bottom child window and frontward.
@@ -502,7 +505,7 @@ PaintHelper::~PaintHelper()
         while (pTempWindow)
         {
             if (pTempWindow->mpWindowImpl->mbVisible)
-                pTempWindow->ImplCallPaint(m_pBuffer, m_pChildRegion, m_nPaintFlags);
+                pTempWindow->ImplCallPaint(m_pChildRegion, m_nPaintFlags);
             pTempWindow = pTempWindow->mpWindowImpl->mpPrev;
         }
     }
@@ -515,10 +518,10 @@ PaintHelper::~PaintHelper()
 
     // double-buffering: paint in case we created the buffer, the children are
     // already painted inside
-    if (m_bCreatedBuffer && m_pBuffer)
+    if (m_bCreatedBuffer && pFrameData->mpBuffer)
     {
         PaintBuffer();
-        m_pBuffer.disposeAndClear();
+        pFrameData->mpBuffer.disposeAndClear();
     }
 
     // #98943# draw toolbox selection
@@ -530,7 +533,7 @@ PaintHelper::~PaintHelper()
 
 namespace vcl {
 
-void Window::ImplCallPaint(const VclPtr<VirtualDevice>& rBuffer, const vcl::Region* pRegion, sal_uInt16 nPaintFlags)
+void Window::ImplCallPaint(const vcl::Region* pRegion, sal_uInt16 nPaintFlags)
 {
     // call PrePaint. PrePaint may add to the invalidate region as well as
     // other parameters used below.
@@ -560,7 +563,7 @@ void Window::ImplCallPaint(const VclPtr<VirtualDevice>& rBuffer, const vcl::Regi
 
     nPaintFlags = mpWindowImpl->mnPaintFlags & ~(IMPL_PAINT_PAINT);
 
-    PaintHelper aHelper(this, rBuffer, nPaintFlags);
+    PaintHelper aHelper(this, nPaintFlags);
 
     if (mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINT)
         aHelper.DoPaint(pRegion);
@@ -588,7 +591,7 @@ void Window::ImplCallOverlapPaint()
         //         because we were called from the Sal layer
         OutputDevice *pOutDev = GetOutDev();
         pOutDev->BeginPaint();
-        ImplCallPaint(NULL, NULL, mpWindowImpl->mnPaintFlags /*| IMPL_PAINT_CHECKRTL */);
+        ImplCallPaint(NULL, mpWindowImpl->mnPaintFlags /*| IMPL_PAINT_CHECKRTL */);
         pOutDev->EndPaint();
     }
 }
@@ -974,7 +977,7 @@ void Window::ImplUpdateAll( bool bOverlapWindows )
     else
     {
         if (pWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTCHILDREN))
-            pWindow->ImplCallPaint(NULL, NULL, pWindow->mpWindowImpl->mnPaintFlags);
+            pWindow->ImplCallPaint(NULL, pWindow->mpWindowImpl->mnPaintFlags);
     }
 
     if ( bFlush )
@@ -1304,7 +1307,7 @@ void Window::Update()
              pUpdateOverlapWindow = pUpdateOverlapWindow->mpWindowImpl->mpNext;
          }
 
-        pUpdateWindow->ImplCallPaint(NULL, NULL, pUpdateWindow->mpWindowImpl->mnPaintFlags);
+        pUpdateWindow->ImplCallPaint(NULL, pUpdateWindow->mpWindowImpl->mnPaintFlags);
 
         if (aDogTag.IsDead())
            return;
commit 00269d39f655bb0ecb38c043a9516b4faefe6708
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 29 13:51:49 2015 +0200

    svx: remove duplicate "Kuerzen" function
    
    Change-Id: I319ba12684398bcdfcd8d8ede1648e1d213e75a7

diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx
index f70bfed..e54c745 100644
--- a/include/svx/svdtrans.hxx
+++ b/include/svx/svdtrans.hxx
@@ -249,12 +249,6 @@ SVX_DLLPUBLIC void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho)
 // Calculation and intermediate values are in BigInt
 SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
 
-// Lossy cancellation of a fraction
-// nDigits specifies, how many significant digits the numerator
-// and denominator should at least be retained
-void Kuerzen(Fraction& rF, unsigned nDigits);
-
-
 class FrPair {
     Fraction aX;
     Fraction aY;
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list