[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 10 commits - include/oox include/tools include/vcl nlpsolver/src oox/source pyuno/source sc/source sd/qa sd/source svx/sdi svx/source vcl/source vcl/unx

Xisco Fauli xiscofauli at libreoffice.org
Fri Jul 6 08:45:19 UTC 2018


 include/oox/export/shapes.hxx                                              |    2 
 include/tools/wintypes.hxx                                                 |    3 
 include/vcl/ppdparser.hxx                                                  |    2 
 nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java |    6 
 oox/source/export/shapes.cxx                                               |   71 +++-------
 pyuno/source/module/pyuno_impl.hxx                                         |    2 
 pyuno/source/module/pyuno_type.cxx                                         |    2 
 pyuno/source/module/pyuno_util.cxx                                         |    2 
 sc/source/ui/optdlg/tpcalc.cxx                                             |    2 
 sd/qa/unit/export-tests.cxx                                                |   56 +++++++
 sd/qa/unit/import-tests.cxx                                                |   56 -------
 sd/source/ui/func/fuinsert.cxx                                             |   18 --
 svx/sdi/svx.sdi                                                            |    2 
 svx/source/gallery2/galbrws2.cxx                                           |    2 
 vcl/source/control/button.cxx                                              |    1 
 vcl/unx/generic/printer/jobdata.cxx                                        |    3 
 vcl/unx/generic/printer/ppdparser.cxx                                      |   12 -
 vcl/unx/gtk3/gtk3gtkframe.cxx                                              |   44 +++++-
 18 files changed, 148 insertions(+), 138 deletions(-)

New commits:
commit 0cf87845767393f92bc86f403a3e490441404b78
Author: Xisco Fauli <xiscofauli at libreoffice.org>
Date:   Tue Jul 3 16:34:49 2018 +0200

    tdf#118506: Disable orientation page in read only
    
    Change-Id: I30994b95e65ddd70df7872f5cc41c339bf906f19
    Reviewed-on: https://gerrit.libreoffice.org/56875
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    (cherry picked from commit 0c3f7154f4d2919f7d28a5db9578fc308f2c0d02)
    Reviewed-on: https://gerrit.libreoffice.org/56999
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 3aaca9586a566a52210212bd2c8b54f2b6e358ab)

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index eed15720caa9..e1532468af95 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -6214,7 +6214,7 @@ SvxPageItem Orientation SID_ATTR_PAGE_ORIENTATION
 [
     AutoUpdate = FALSE,
     FastCall = FALSE,
-    ReadOnlyDoc = TRUE,
+    ReadOnlyDoc = FALSE,
     Toggle = FALSE,
     Container = FALSE,
     RecordAbsolute = FALSE,
commit 19c922c86eac577513c1da9ece891adfddb3f502
Author: Justin Luth <justin.luth at collabora.com>
Date:   Tue Jun 19 11:35:21 2018 +0300

    tdf#104199 sd: export non-borders as noFill
    
    ...followup to commit 76505bbd862b17b9b02a2d6e68bac308890dec70
    which made the border invisible by setting the color to COL_AUTO.
    
    But being invisible isn't good enough because on a round-trip
    we are now losing the "noFill" attribute and saving a defined
    border. However, COL_AUTO is turned into white during import,
    in both LO and in MSO, so round-tripping displayed a
    white border instead of an invisible one.
    
    Reviewed-on: https://gerrit.libreoffice.org/55658
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit 4087130d0531a31456310bfe5c41a028dacd5a4d)
    
    Change-Id: If6cb513ca6e4336e49bc56a9509aede2e1937063
    Reviewed-on: https://gerrit.libreoffice.org/56751
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit fb043986ca8d2d1b7b6179ef7e2412aa677d5c7d)

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 63705ff0cc9f..4989f86e6fad 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1737,7 +1737,10 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
     if ( nBorderWidth > 0 )
     {
         mpFS->startElementNS( XML_a, XML_line, XML_w, I32S(nBorderWidth), FSEND );
-        DrawingML::WriteSolidFill( util::Color(rBorderLine.Color) );
+        if ( rBorderLine.Color == sal_Int32( COL_AUTO ) )
+            mpFS->singleElementNS( XML_a, XML_noFill, FSEND );
+        else
+            DrawingML::WriteSolidFill( util::Color(rBorderLine.Color) );
         mpFS->endElementNS( XML_a, XML_line );
     }
 }
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 679394c5f941..3d7b692a985e 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -82,6 +82,7 @@ public:
     void testTdf97630();
     void testSwappedOutImageExport();
     void testOOoXMLAnimations();
+    void testBnc480256();
     void testUnknownAttributes();
     void testTdf80020();
     void testLinkedGraphicRT();
@@ -104,6 +105,7 @@ public:
     CPPUNIT_TEST(testTdf97630);
     CPPUNIT_TEST(testSwappedOutImageExport);
     CPPUNIT_TEST(testOOoXMLAnimations);
+    CPPUNIT_TEST(testBnc480256);
     CPPUNIT_TEST(testUnknownAttributes);
     CPPUNIT_TEST(testTdf80020);
     CPPUNIT_TEST(testLinkedGraphicRT);
@@ -442,6 +444,60 @@ void SdExportTest::testOOoXMLAnimations()
     assertXPath(pXmlDoc, "//anim:par", 223);
 }
 
+void SdExportTest::testBnc480256()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
+    // In the document, there are two tables with table background properties.
+    // Make sure colors are set properly for individual cells.
+
+    // TODO: If you are working on improving table background support, expect
+    // this unit test to fail. In that case, feel free to change the numbers.
+
+    const SdrPage *pPage = GetPage( 1, xDocShRef );
+
+    sdr::table::SdrTableObj *pTableObj;
+    uno::Reference< table::XCellRange > xTable;
+    uno::Reference< beans::XPropertySet > xCell;
+    sal_Int32 nColor;
+    table::BorderLine2 aBorderLine;
+
+    pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+    CPPUNIT_ASSERT( pTableObj );
+    xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+
+    xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("FillColor") >>= nColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
+    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
+
+    xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("FillColor") >>= nColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
+    xCell->getPropertyValue("TopBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
+
+    pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
+    CPPUNIT_ASSERT( pTableObj );
+    xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
+
+    xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("FillColor") >>= nColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
+    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
+
+    xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("FillColor") >>= nColor;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
+
+    xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
+    xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
+    CPPUNIT_ASSERT_EQUAL(util::Color(COL_AUTO), aBorderLine.Color);
+
+    xDocShRef->DoClose();
+}
+
 void SdExportTest::testUnknownAttributes()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), FODP);
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index d8e2245a02b5..c331b078dac7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -122,7 +122,6 @@ public:
     void testN862510_4();
     void testBnc870237();
     void testBnc887225();
-    void testBnc480256();
     void testBnc591147();
     void testCreationDate();
     void testBnc584721_1();
@@ -201,7 +200,6 @@ public:
     CPPUNIT_TEST(testN862510_4);
     CPPUNIT_TEST(testBnc870237);
     CPPUNIT_TEST(testBnc887225);
-    CPPUNIT_TEST(testBnc480256);
     CPPUNIT_TEST(testBnc591147);
     CPPUNIT_TEST(testCreationDate);
     CPPUNIT_TEST(testBnc584721_1);
@@ -851,60 +849,6 @@ void SdImportTest::testBnc887225()
     xDocShRef->DoClose();
 }
 
-void SdImportTest::testBnc480256()
-{
-    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/bnc480256.pptx"), PPTX);
-    // In the document, there are two tables with table background properties.
-    // Make sure colors are set properly for individual cells.
-
-    // TODO: If you are working on improving table background support, expect
-    // this unit test to fail. In that case, feel free to change the numbers.
-
-    const SdrPage *pPage = GetPage( 1, xDocShRef );
-
-    sdr::table::SdrTableObj *pTableObj;
-    uno::Reference< table::XCellRange > xTable;
-    uno::Reference< beans::XPropertySet > xCell;
-    sal_Int32 nColor;
-    table::BorderLine2 aBorderLine;
-
-    pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
-    CPPUNIT_ASSERT( pTableObj );
-    xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
-
-    xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
-    xCell->getPropertyValue("FillColor") >>= nColor;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(10208238), nColor);
-    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
-    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
-
-    xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
-    xCell->getPropertyValue("FillColor") >>= nColor;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(13032959), nColor);
-    xCell->getPropertyValue("TopBorder") >>= aBorderLine;
-    CPPUNIT_ASSERT_EQUAL(util::Color(5609427), aBorderLine.Color);
-
-    pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1));
-    CPPUNIT_ASSERT( pTableObj );
-    xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
-
-    xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
-    xCell->getPropertyValue("FillColor") >>= nColor;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(7056614), nColor);
-    xCell->getPropertyValue("LeftBorder") >>= aBorderLine;
-    CPPUNIT_ASSERT_EQUAL(util::Color(12505062), aBorderLine.Color);
-
-    xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
-    xCell->getPropertyValue("FillColor") >>= nColor;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(4626400), nColor);
-
-    xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
-    xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
-    CPPUNIT_ASSERT_EQUAL(util::Color(COL_AUTO), aBorderLine.Color);
-
-    xDocShRef->DoClose();
-}
-
 void SdImportTest::testBnc584721_1()
 {
     // Title text shape on the master page contained wrong text.
commit 1e1b6fab2cde6dce8a398621bf7a40c143516ef6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 21 09:14:33 2018 +0100

    Resolves: tdf#115816 second 'Insert' menu is paste
    
    reuse existing translation to be backportable wrt no new translations
    
    Change-Id: I1fb94f66d696f836e8f6a10ba2d6933f69cfac95
    Reviewed-on: https://gerrit.libreoffice.org/56245
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 74b897f9c578cb0b64124ef9563f2355680c8d84)

diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 897e63e520e1..7a984389cc41 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -259,7 +259,8 @@ enum class StandardButtonType
     Ignore       = 8,
     Abort        = 9,
     Less         = 10,
-    Count        = 11,
+    Paste        = 11,
+    Count        = 12,
 };
 
 // prominent place for ListBox window types
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 0a77441323f4..add5495ed895 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -259,6 +259,8 @@ void GalleryThemePopup::ExecutePopup( vcl::Window *pWindow, const ::Point &aPos
         mpPopupMenu->EnableItem(mpPopupMenu->GetItemId("paste"));
     }
 
+    mpPopupMenu->SetItemText(mpPopupMenu->GetItemId("paste"), Button::GetStandardText(StandardButtonType::Paste));
+
     // update status
     css::uno::Reference< css::frame::XDispatchProvider> xDispatchProvider(
         GalleryBrowser2::GetFrame(), css::uno::UNO_QUERY );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d39a9f72de1b..a4948e6c833a 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -146,6 +146,7 @@ OUString Button::GetStandardText(StandardButtonType eButton)
         SV_BUTTONTEXT_IGNORE,
         SV_BUTTONTEXT_ABORT,
         SV_BUTTONTEXT_LESS,
+        SV_BUTTONTEXT_PASTE,
     };
 
     return VclResId(aResIdAry[(sal_uInt16)eButton]);
commit 8c192eb98671e804518215e9e278523d974856a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 5 14:57:19 2018 +0100

    tdf#117981 translate embedded video window mouse events to parent coordinates
    
    Change-Id: I0d8fb6c6adc44389332434f9f6a8396a4d1817cf
    Reviewed-on: https://gerrit.libreoffice.org/55339
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 89c8673755646e631469f8031a9785cdcc99ff75)

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 2e4f447f69b5..49ec49862164 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2612,11 +2612,28 @@ void GtkSalFrame::closePopup()
     pSVData->maWinData.mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
 }
 
+namespace
+{
+    //tdf#117981 translate embedded video window mouse events to parent coordinates
+    void translate_coords(GdkWindow* pSourceWindow, GtkWidget* pTargetWidget, int& rEventX, int& rEventY)
+    {
+        gpointer user_data=nullptr;
+        gdk_window_get_user_data(pSourceWindow, &user_data);
+        GtkWidget* pRealEventWidget = static_cast<GtkWidget*>(user_data);
+        if (pRealEventWidget)
+        {
+            gtk_widget_translate_coordinates(pRealEventWidget, pTargetWidget, rEventX, rEventY, &rEventX, &rEventY);
+        }
+    }
+}
+
 gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer frame )
 {
     UpdateLastInputEventTime(pEvent->time);
 
     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+    GtkWidget* pEventWidget = pThis->getMouseEventWidget();
+    bool bDifferentEventWindow = pEvent->window != widget_get_window(pEventWidget);
 
     SalMouseEvent aEvent;
     SalEvent nEventType = SalEvent::NONE;
@@ -2645,7 +2662,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
     {
         //rhbz#1505379 if the window that got the event isn't our one, or there's none
         //of our windows under the mouse then close this popup window
-        if (pEvent->window != widget_get_window(pThis->getMouseEventWidget()) ||
+        if (bDifferentEventWindow ||
             gdk_device_get_window_at_position(pEvent->device, nullptr, nullptr) == nullptr)
         {
             if (pEvent->type == GDK_BUTTON_PRESS)
@@ -2655,10 +2672,16 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
         }
     }
 
+    int nEventX = pEvent->x;
+    int nEventY = pEvent->y;
+
+    if (bDifferentEventWindow)
+        translate_coords(pEvent->window, pEventWidget, nEventX, nEventY);
+
     if (!aDel.isDeleted())
     {
-        int frame_x = (int)(pEvent->x_root - pEvent->x);
-        int frame_y = (int)(pEvent->y_root - pEvent->y);
+        int frame_x = static_cast<int>(pEvent->x_root - nEventX);
+        int frame_y = static_cast<int>(pEvent->y_root - nEventY);
         if (pThis->m_bGeometryIsProvisional || frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY)
         {
             pThis->m_bGeometryIsProvisional = false;
@@ -2872,18 +2895,27 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
     UpdateLastInputEventTime(pEvent->time);
 
     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+    GtkWidget* pEventWidget = pThis->getMouseEventWidget();
+    bool bDifferentEventWindow = pEvent->window != widget_get_window(pEventWidget);
 
     //If a menu, e.g. font name dropdown, is open, then under wayland moving the
     //mouse in the top left corner of the toplevel window in a
     //0,0,float-width,float-height area generates motion events which are
     //delivered to the dropdown
-    if (pThis->isFloatGrabWindow() && pEvent->window != widget_get_window(pThis->getMouseEventWidget()))
+    if (pThis->isFloatGrabWindow() && bDifferentEventWindow)
         return true;
 
     vcl::DeletionListener aDel( pThis );
 
-    int frame_x = (int)(pEvent->x_root - pEvent->x);
-    int frame_y = (int)(pEvent->y_root - pEvent->y);
+    int nEventX = pEvent->x;
+    int nEventY = pEvent->y;
+
+    if (bDifferentEventWindow)
+        translate_coords(pEvent->window, pEventWidget, nEventX, nEventY);
+
+    int frame_x = static_cast<int>(pEvent->x_root - nEventX);
+    int frame_y = static_cast<int>(pEvent->y_root - nEventY);
+
     if (pThis->m_bGeometryIsProvisional || frame_x != pThis->maGeometry.nX || frame_y != pThis->maGeometry.nY)
     {
         pThis->m_bGeometryIsProvisional = false;
commit aa7908cdadc3933fa40d74c8eaa9478329115594
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jun 24 21:35:06 2018 +0200

    tdf#43388: add missing info for Evolutionary Algorithm Solver
    
    Add SolverConstraintOperator.INTEGER_value case and in the same time
    the also missing SolverConstraintOperator.BINARY_value case
    
    Change-Id: I18b826e74a2381dedaea3090919118b8d5dad072
    Reviewed-on: https://gerrit.libreoffice.org/56359
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 02a66f29fec36aed5fb1e800a08c1390d3674b59)
    Reviewed-on: https://gerrit.libreoffice.org/56435
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 12e092b414208ba4342f20fe190681d73d9c6ff9)

diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
index 701e6ba63226..c0b10c2f4951 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
@@ -105,6 +105,12 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
                     case SolverConstraintOperator.LESS_EQUAL_value:
                         setDefaultYAt(i + 1, BasicBound.MINDOUBLE, constraint.Data);
                         break;
+                    case SolverConstraintOperator.INTEGER_value:
+                        setDefaultYAt(i + 1, BasicBound.MINDOUBLE, BasicBound.MAXDOUBLE);
+                        break;
+                    case SolverConstraintOperator.BINARY_value:
+                        setDefaultYAt(i + 1, 0, 1);
+                        break;
                 }
             }
 
commit e81d65e6b0d3fbad66f11e073f6ebc9a31949ca4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jul 3 08:33:34 2018 +0200

    const fixes for python3-devel-3.7.0-1.fc29.x86_64
    
    Change-Id: Ia16a8b828e11ce36e9bb77ecf9e8a1179bd9b90c
    Reviewed-on: https://gerrit.libreoffice.org/56841
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 76a29148be63cb006a7e25e312dc93acc93e071f)
    Reviewed-on: https://gerrit.libreoffice.org/56913
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 19ff1064c84f1e5e5081ff624b3abd5e6ad99367)

diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index ea0e419ffb1b..73acabdf4a16 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -80,7 +80,7 @@ inline PyObject* PyStr_FromString(const char *string)
     return PyUnicode_FromString(string);
 }
 
-inline char * PyStr_AsString(PyObject *object)
+inline char const * PyStr_AsString(PyObject *object)
 {
     return PyUnicode_AsUTF8(object);
 }
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index e54400ba6d8d..3c09e24243b6 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -157,7 +157,7 @@ Any PyEnum2Enum( PyObject *obj )
     }
 
     OUString strTypeName( OUString::createFromAscii( PyStr_AsString( typeName.get() ) ) );
-    char *stringValue = PyStr_AsString( value.get() );
+    char const *stringValue = PyStr_AsString( value.get() );
 
     TypeDescription desc( strTypeName );
     if( !desc.is() )
diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx
index e92dad2e8bca..9bb48cf38747 100644
--- a/pyuno/source/module/pyuno_util.cxx
+++ b/pyuno/source/module/pyuno_util.cxx
@@ -69,7 +69,7 @@ OUString pyString2ustring( PyObject *pystr )
 #else
 #if PY_MAJOR_VERSION >= 3
     Py_ssize_t size(0);
-    char *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size));
+    char const *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size));
     ret = OUString(pUtf8, size, RTL_TEXTENCODING_UTF8);
 #else
     PyObject* pUtf8 = PyUnicode_AsUTF8String(pystr);
commit f2947d8502144271ceabf59f5bed90e92ee653ce
Author: Gabor Kelemen <kelemeng at ubuntu.com>
Date:   Tue Jul 3 07:41:47 2018 +0200

    tdf#118452 Don't crash when multi thread calculation is disabled
    
    ...by default configuration.
    
    Change-Id: If6075ae66537f613434dd38766324436f2426517
    Reviewed-on: https://gerrit.libreoffice.org/56840
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit e119194aeec907f3d02cb914e5afde5ac763df7c)
    Reviewed-on: https://gerrit.libreoffice.org/56856
    (cherry picked from commit 41a780a589151afa1159403231c59c57bc8a1bc8)

diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 4ec601a23ac6..764d55d98e57 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -183,7 +183,7 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
         m_pEdPrec->SetValue(nPrec);
     }
 
-    m_pBtnThread->Enable();
+    m_pBtnThread->Enable( !officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::isReadOnly() );
     m_pBtnThread->Check( officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get() );
 
     CheckClickHdl(m_pBtnIterate);
commit f24142d8b7ed8eb117ce531d89c2df0f11c7e7e1
Author: Paul Trojahn <paul.trojahn at gmail.com>
Date:   Thu Jun 21 15:51:05 2018 +0200

    tdf#115233 Don't reset crop when replacing a graphic
    
    When passing DND_ACTION_MOVE to View::InsertGraphic, the whole object gets
    replaced. DND_ACTION_LINK should be used, because it just replaces the
    graphic and keeps crop information.
    Marking the object is not needed, because InsertObjectAtView and
    ReplaceObjectAtView already take care of that.
    
    Change-Id: I0d829ec39a9d484a7c8946252e90eddb12ea9756
    Reviewed-on: https://gerrit.libreoffice.org/56401
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 3f3c16e433f727bf52a6f894956b489187ab6dce)
    Reviewed-on: https://gerrit.libreoffice.org/56838
    Reviewed-by: Paul Trojahn <paul.trojahn at gmail.com>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit f066b54fb4af1d3f08242d81dd08100b7266eaaf)

diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 9204c5ba6ffe..eda1ef85eddc 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -155,18 +155,13 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
         if( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) !=  nullptr)
         {
             sal_Int8    nAction = DND_ACTION_COPY;
-            SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
-            bool bSelectionReplaced(false);
+            SdrObject* pPickObj;
 
-            if( pPickObj )
+            if( ( ( pPickObj = mpView->GetSelectedSingleObject( mpView->GetPage() ) ) && mbReplaceExistingImage ) || (pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC ) ) )
             {
                 nAction = DND_ACTION_LINK;
-            }
-            else if(mbReplaceExistingImage && mpView->GetMarkedObjectCount() == 1)
-            {
-                pPickObj = mpView->GetMarkedObjectByIndex(0);
-                nAction = DND_ACTION_MOVE;
-                bSelectionReplaced = true;
+            } else {
+                pPickObj = nullptr;
             }
 
             Point aPos = mpWindow->GetVisibleCenter();
@@ -189,11 +184,6 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
                 }
                 pGrafObj->SetGraphicLink(aFileName, aReferer, aFilterName);
             }
-
-            if(bSelectionReplaced && pGrafObj)
-            {
-                mpView->MarkObj(pGrafObj, mpView->GetSdrPageView());
-            }
         }
     }
     else
commit 49d2b6bb1174079fef114bab99a72ca7bfa39eee
Author: Justin Luth <justin.luth at collabora.com>
Date:   Tue Jun 19 11:02:07 2018 +0300

    NFC oox export shape: move replicated code into function
    
    Reviewed-on: https://gerrit.libreoffice.org/56083
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit 3ef18b28ade43a38bb46a2400e4e81a9ae8796bc)
    Reviewed-on: https://gerrit.libreoffice.org/56137
    
    Change-Id: I1d306769bee8390626b513c63c5b889ba3d3d3d6
    Reviewed-on: https://gerrit.libreoffice.org/56750
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit aadbe0e83c0ae0190e1bc36360893fce8f8a2b68)

diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
index 5c1d7d860ca7..e56bd570512c 100644
--- a/include/oox/export/shapes.hxx
+++ b/include/oox/export/shapes.hxx
@@ -25,6 +25,7 @@
 #include <unordered_map>
 
 #include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/uno/Reference.hxx>
 #include <oox/dllapi.h>
 #include <oox/export/drawingml.hxx>
@@ -216,6 +217,7 @@ public:
 
     void WriteTableCellProperties(const css::uno::Reference< css::beans::XPropertySet >& rXPropSet);
 
+    void WriteBorderLine(const sal_Int32 XML_line, const css::table::BorderLine2& rBorderLine);
     void WriteTableCellBorders(const css::uno::Reference< css::beans::XPropertySet >& rXPropSet);
 
     sal_Int32 GetNewShapeID( const css::uno::Reference< css::drawing::XShape >& rShape );
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 3fcd9d714df7..63705ff0cc9f 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -76,7 +76,6 @@
 #include <com/sun/star/table/XMergeableCell.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/table/BorderLine2.hpp>
 #include <tools/stream.hxx>
 #include <tools/globname.hxx>
 #include <comphelper/classids.hxx>
@@ -1727,68 +1726,41 @@ void ShapeExport::WriteTableCellProperties(const Reference< XPropertySet>& xCell
     mpFS->endElementNS( XML_a, XML_tcPr );
 }
 
-void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& xCellPropSet)
+void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& rBorderLine)
 {
-    BorderLine2 aBorderLine;
-
-// lnL - Left Border Line Properties of table cell
-    xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine;
-    sal_Int32 nLeftBorder = aBorderLine.LineWidth;
-    util::Color aLeftBorderColor = aBorderLine.Color;
-
 // While importing the table cell border line width, it converts EMU->Hmm then divided result by 2.
 // To get original value of LineWidth need to multiple by 2.
-    nLeftBorder = nLeftBorder*2;
-    nLeftBorder = oox::drawingml::convertHmmToEmu( nLeftBorder );
+    sal_Int32 nBorderWidth = rBorderLine.LineWidth;
+    nBorderWidth *= 2;
+    nBorderWidth = oox::drawingml::convertHmmToEmu( nBorderWidth );
 
-    if(nLeftBorder > 0)
+    if ( nBorderWidth > 0 )
     {
-        mpFS->startElementNS( XML_a, XML_lnL, XML_w, I32S(nLeftBorder), FSEND );
-        DrawingML::WriteSolidFill(aLeftBorderColor);
-        mpFS->endElementNS( XML_a, XML_lnL );
+        mpFS->startElementNS( XML_a, XML_line, XML_w, I32S(nBorderWidth), FSEND );
+        DrawingML::WriteSolidFill( util::Color(rBorderLine.Color) );
+        mpFS->endElementNS( XML_a, XML_line );
     }
+}
+
+void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& xCellPropSet)
+{
+    BorderLine2 aBorderLine;
+
+// lnL - Left Border Line Properties of table cell
+    xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine;
+    WriteBorderLine( XML_lnL, aBorderLine );
 
 // lnR - Right Border Line Properties of table cell
     xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine;
-    sal_Int32 nRightBorder = aBorderLine.LineWidth;
-    util::Color aRightBorderColor = aBorderLine.Color;
-    nRightBorder = nRightBorder * 2 ;
-    nRightBorder = oox::drawingml::convertHmmToEmu( nRightBorder );
-
-    if(nRightBorder > 0)
-    {
-        mpFS->startElementNS( XML_a, XML_lnR, XML_w, I32S(nRightBorder), FSEND);
-        DrawingML::WriteSolidFill(aRightBorderColor);
-        mpFS->endElementNS( XML_a, XML_lnR);
-    }
+    WriteBorderLine( XML_lnR, aBorderLine );
 
 // lnT - Top Border Line Properties of table cell
     xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine;
-    sal_Int32 nTopBorder = aBorderLine.LineWidth;
-    util::Color aTopBorderColor = aBorderLine.Color;
-    nTopBorder = nTopBorder * 2;
-    nTopBorder = oox::drawingml::convertHmmToEmu( nTopBorder );
-
-    if(nTopBorder > 0)
-    {
-        mpFS->startElementNS( XML_a, XML_lnT, XML_w, I32S(nTopBorder), FSEND);
-        DrawingML::WriteSolidFill(aTopBorderColor);
-        mpFS->endElementNS( XML_a, XML_lnT);
-    }
+    WriteBorderLine( XML_lnT, aBorderLine );
 
 // lnB - Bottom Border Line Properties of table cell
     xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
-    sal_Int32 nBottomBorder = aBorderLine.LineWidth;
-    util::Color aBottomBorderColor = aBorderLine.Color;
-    nBottomBorder = nBottomBorder * 2;
-    nBottomBorder = oox::drawingml::convertHmmToEmu( nBottomBorder );
-
-    if(nBottomBorder > 0)
-    {
-        mpFS->startElementNS( XML_a, XML_lnB, XML_w, I32S(nBottomBorder), FSEND);
-        DrawingML::WriteSolidFill(aBottomBorderColor);
-        mpFS->endElementNS( XML_a, XML_lnB);
-    }
+    WriteBorderLine( XML_lnB, aBorderLine );
 }
 
 ShapeExport& ShapeExport::WriteTableShape( const Reference< XShape >& xShape )
commit 8cf564b81e37991c11b871dc59f17bfe0e10bc77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 19 21:43:43 2018 +0100

    forcepoint#50 fix end detection
    
    rBuffer.size() of 26, nBytes of 25, rBuffer[25] is the first zero
    so aLine.getLength() of 25, nBytes reduced by aLine.getLength()+1 and
    nRun increased by same, so nBytes wraps and nRun is 26.
    
    contains...
    
    forcepoint: rework to explore loop
    
    Change-Id: I14f6a3269fc3347a9976d899519e74f58d5975c8
    Reviewed-on: https://gerrit.libreoffice.org/56125
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 6e5e83025c948b699bb65839ef810a45a98ba014)
    
    Change-Id: Ia9f4789e081e6b77a21321f37d71cabfc7c84550
    Reviewed-on: https://gerrit.libreoffice.org/56481
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 0cefb4f0552a9d1ec3afd64e695596480a1c9757)

diff --git a/include/vcl/ppdparser.hxx b/include/vcl/ppdparser.hxx
index a3a04b86fdff..2cac587cd1c0 100644
--- a/include/vcl/ppdparser.hxx
+++ b/include/vcl/ppdparser.hxx
@@ -269,7 +269,7 @@ public:
 
     // for printer setup
     char*   getStreamableBuffer( sal_uLong& rBytes ) const;
-    void    rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes );
+    void    rebuildFromStreamBuffer(const std::vector<char> &rBuffer);
 
     // convenience
     int getRenderResolution() const;
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 92f9204b51e2..43e33bc22d0d 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -279,8 +279,9 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
                     nBytes = aStream.ReadBytes(aRemain.data(), nBytes);
                     if (nBytes)
                     {
+                        aRemain.resize(nBytes+1);
                         aRemain[nBytes] = 0;
-                        rJobData.m_aContext.rebuildFromStreamBuffer(aRemain.data(), nBytes);
+                        rJobData.m_aContext.rebuildFromStreamBuffer(aRemain);
                         bContext = true;
                     }
                 }
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index b81359c8fea5..65a1b1cf30e3 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1926,17 +1926,18 @@ char* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
     return pBuffer;
 }
 
-void PPDContext::rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes )
+void PPDContext::rebuildFromStreamBuffer(const std::vector<char> &rBuffer)
 {
     if( ! m_pParser )
         return;
 
     m_aCurrentValues.clear();
 
-    char* pRun = pBuffer;
-    while( nBytes && *pRun )
+    const size_t nBytes = rBuffer.size() - 1;
+    size_t nRun = 0;
+    while (nRun < nBytes && rBuffer[nRun])
     {
-        OString aLine( pRun );
+        OString aLine(rBuffer.data() + nRun);
         sal_Int32 nPos = aLine.indexOf(':');
         if( nPos != -1 )
         {
@@ -1955,8 +1956,7 @@ void PPDContext::rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes )
                     << " }");
             }
         }
-        nBytes -= aLine.getLength()+1;
-        pRun += aLine.getLength()+1;
+        nRun += aLine.getLength()+1;
     }
 }
 


More information about the Libreoffice-commits mailing list