[Libreoffice-commits] core.git: 16 commits - desktop/qa desktop/source filter/source include/LibreOfficeKit include/svx include/vcl sc/source sd/qa sd/source svx/sdi svx/source sw/source vcl/headless vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 7 10:54:33 UTC 2018


 desktop/qa/desktop_lib/test_desktop_lib.cxx  |    4 
 desktop/source/lib/init.cxx                  |   48 +++++++++++
 filter/source/svg/svgexport.cxx              |  112 +++++++++++++++------------
 filter/source/svg/svgfilter.cxx              |    1 
 include/LibreOfficeKit/LibreOfficeKit.h      |    3 
 include/LibreOfficeKit/LibreOfficeKit.hxx    |   10 ++
 include/svx/svxids.hrc                       |    1 
 include/vcl/button.hxx                       |   10 +-
 include/vcl/salnativewidgets.hxx             |    4 
 sc/source/ui/view/tabvwsh2.cxx               |    9 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   36 ++++----
 sd/source/ui/view/drviewse.cxx               |   14 +++
 svx/sdi/svx.sdi                              |    2 
 svx/source/svdraw/svdedtv1.cxx               |   22 ++++-
 svx/source/svdraw/svdmrkv.cxx                |   13 +--
 sw/source/uibase/shells/frmsh.cxx            |   26 ++++--
 sw/source/uibase/uiview/viewdraw.cxx         |    8 +
 vcl/headless/CustomWidgetDraw.cxx            |    2 
 vcl/inc/WidgetThemeLibrary.hxx               |    4 
 vcl/source/control/button.cxx                |    6 -
 vcl/source/control/combobox.cxx              |   10 +-
 vcl/source/control/listbox.cxx               |    9 +-
 vcl/source/window/builder.cxx                |   13 +--
 23 files changed, 257 insertions(+), 110 deletions(-)

New commits:
commit ec1b227b435a555464cb2a9fe747631485ebdbf1
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Nov 28 22:21:57 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:35 2018 +0100

    custom widgets: Rename 'stock' to 'action'.
    
    If the button has this property, it means it is located in the action
    area, not that it is a stock button per se.
    
    Change-Id: Ia57ad24d8cd4ff1d7b74d7ef82da0f352fe3deb3

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 98ac3ea9f7e9..c078c921a35a 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -160,14 +160,14 @@ public:
     virtual bool    set_property(const OString &rKey, const OUString &rValue) override;
     virtual void    ShowFocus(const tools::Rectangle& rRect) override;
 
-    void setStock(bool bIsStock)
+    void setAction(bool bIsAction)
     {
-        mbIsStock = bIsStock;
+        mbIsAction = bIsAction;
     }
 
-    bool isStock()
+    bool isAction()
     {
-        return mbIsStock;
+        return mbIsAction;
     }
 
 protected:
@@ -206,7 +206,7 @@ private:
     SymbolType      meSymbol;
     TriState        meState;
     bool            mbPressed;
-    bool            mbIsStock;
+    bool            mbIsAction;
 };
 
 inline void PushButton::Check( bool bCheck )
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 9ccfa0319057..a9a572731e3c 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -497,7 +497,7 @@ public:
         : ImplControlValue( ControlType::Pushbutton, 0 )
         , mbBevelButton(false)
         , mbSingleLine(true)
-        , mbIsStock(false)
+        , mbIsAction(false)
     {}
 
     virtual ~PushButtonValue() override;
@@ -510,7 +510,7 @@ public:
 
     bool mbBevelButton:1; // only used on OSX
     bool mbSingleLine:1;  // only used on OSX
-    bool mbIsStock:1;
+    bool mbIsAction:1;
 };
 
 
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index 8a920af1ee55..9e49390b0f3a 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -97,7 +97,7 @@ bool CustomWidgetDraw::drawNativeControl(ControlType eType, ControlPart ePart,
         {
             const PushButtonValue* pPushButtonValue = static_cast<const PushButtonValue*>(&rValue);
             if (pPushButtonValue)
-                aParameters.bIsStock = pPushButtonValue->mbIsStock;
+                aParameters.bIsAction = pPushButtonValue->mbIsAction;
             bOK = s_pWidgetImplementation->drawPushButton(aParameters, nWidth, nHeight);
         }
         break;
diff --git a/vcl/inc/WidgetThemeLibrary.hxx b/vcl/inc/WidgetThemeLibrary.hxx
index ccb804cf1b6a..ed4260226a80 100644
--- a/vcl/inc/WidgetThemeLibrary.hxx
+++ b/vcl/inc/WidgetThemeLibrary.hxx
@@ -79,7 +79,7 @@ struct ControlDrawParameters
         , ePart(i_ePart)
         , eState(i_eState)
         , eButtonValue(ButtonValue::DontKnow)
-        , bIsStock(false)
+        , bIsAction(false)
         , nValue(0)
     {
     }
@@ -89,7 +89,7 @@ struct ControlDrawParameters
     ControlPart ePart;
     ControlState eState;
     ButtonValue eButtonValue;
-    bool bIsStock;
+    bool bIsAction;
     int64_t nValue;
 };
 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index b8dea3f8ee73..5e294019c36c 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -615,7 +615,7 @@ void PushButton::ImplInitPushButtonData()
     mnDDStyle       = PushButtonDropdownStyle::NONE;
     mbIsActive    = false;
     mbPressed       = false;
-    mbIsStock       = false;
+    mbIsAction      = false;
 }
 
 namespace
@@ -1026,7 +1026,7 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
     if (bNativeOK)
     {
         PushButtonValue aControlValue;
-        aControlValue.mbIsStock = isStock();
+        aControlValue.mbIsAction = isAction();
 
         tools::Rectangle aCtrlRegion(aInRect);
         ControlState nState = ControlState::NONE;
@@ -1682,7 +1682,7 @@ void PushButton::ShowFocus(const tools::Rectangle& rRect)
     if (IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
     {
         PushButtonValue aControlValue;
-        aControlValue.mbIsStock = isStock();
+        aControlValue.mbIsAction = isAction();
         tools::Rectangle aInRect(Point(), GetOutputSizePixel());
         GetOutDev()->DrawNativeControl(ControlType::Pushbutton, ControlPart::Focus, aInRect,
                                        ControlState::FOCUSED, aControlValue, OUString());
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2f788ce989c4..8ff3f0621d2a 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2806,7 +2806,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader)
                             if (bIsButtonBox)
                             {
                                 if (PushButton* pPushButton = dynamic_cast<PushButton*>(pChild))
-                                    pPushButton->setStock(true);
+                                    pPushButton->setAction(true);
                             }
 
                             aChilds.push_back(pChild);
commit bb05164545cfe7101db8fe300dde22d8bac3fc7d
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Nov 28 22:12:00 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:35 2018 +0100

    custom widgets: Better way to find out whether to use the 'stock' theming.
    
    Change-Id: I75ea7b2d407d3acfd3094f17509c89240c48f50a

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 210c867c8e38..2f788ce989c4 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1200,9 +1200,6 @@ namespace
                 xWindow = VclPtr<PushButton>::Create(pParent, nBits);
                 xWindow->SetText(getStockText(sType));
             }
-            PushButton* pPushButton = dynamic_cast<PushButton*>(xWindow.get());
-            if (pPushButton)
-                pPushButton->setStock(true);
         }
 
         if (!xWindow)
@@ -2798,17 +2795,23 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader)
                             }
                         }
 
+                        bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr;
+
                         //To-Do make reorder a virtual in Window, move this foo
                         //there and see above
                         std::vector<vcl::Window*> aChilds;
                         for (vcl::Window* pChild = pCurrentChild->GetWindow(GetWindowType::FirstChild); pChild;
                             pChild = pChild->GetWindow(GetWindowType::Next))
                         {
+                            if (bIsButtonBox)
+                            {
+                                if (PushButton* pPushButton = dynamic_cast<PushButton*>(pChild))
+                                    pPushButton->setStock(true);
+                            }
+
                             aChilds.push_back(pChild);
                         }
 
-                        bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr;
-
                         //sort child order within parent so that tabbing
                         //between controls goes in a visually sensible sequence
                         std::stable_sort(aChilds.begin(), aChilds.end(), sortIntoBestTabTraversalOrder(this));
commit 173953dd0ede08ad5972e48286f0d10e0d588733
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 23 13:01:02 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:35 2018 +0100

    lok: Right rotation calculation in case of delta angle
    
    Change-Id: Ia7d0a573c1902fba3fc1e69f425bbf2dc93a1c82

diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 25fa84e0520a..784cbc462215 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1506,7 +1506,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
 
     // rotation
     if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) {
-        nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() + nOldRotateAngle;
+        nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
         bRotate = (nRotateAngle != 0);
     }
 
commit 83b24d74b0934461d89ec40f6bc08f12b7c168a4
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 23 12:14:49 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:34 2018 +0100

    Avoid moving the shape by rotation
    
    The difference between Impress and Writer is the used
    unit. We can assume that SID_ATTR_TRANSFORM_ROT_X and
    SID_ATTR_TRANSFORM_ROT_Y contains the values in twips.
    
    Change-Id: I44ba9532348200742b2c7c369b89eb2545295684

diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 9b30ccc4417d..25fa84e0520a 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -62,7 +62,8 @@
 #include <svx/xlnedwit.hxx>
 #include <svx/xlnstwit.hxx>
 #include <svx/xlnwtit.hxx>
-
+#include <svx/svdview.hxx>
+#include <comphelper/lok.hxx>
 
 // EditView
 
@@ -1600,6 +1601,15 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
 
         if(GetSdrPageView())
         {
+            const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+            if(bTiledRendering) {
+                // We gets the position in twips
+                if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
+                {
+                    if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+                        aRef = OutputDevice::LogicToLogic(aRef, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM));
+                }
+            }
             GetSdrPageView()->PagePosToLogic(aRef);
         }
 
commit e86f5a07efbb533a072aca841d040771484d388b
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Fri Nov 23 00:00:28 2018 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:34 2018 +0100

    LOK: dialogs: limit listbox/combobox drop-down length
    
    Dialogs routed to the LOK client have limited real
    estate on the screen because dialogs are rendered
    on a canvas. When the listbox drop-down bleeds outside
    the dialog area, on the desktop it's no problem, but
    in the browser, that requires a larger canvas and
    that brings a host of problems.
    
    Here we limit the maximum length of listbox/combobox
    drop-down lists to avoid this situation.
    
    This would ideally be configured via ListBoxMaximumLineCount
    alas it doesn't work.
    
    Change-Id: I55fff28dbfc59dec36714e221f76cf4160ba1505

diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 9d34f9001182..3eca5c6f0598 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -34,7 +34,7 @@
 #include <svdata.hxx>
 #include <listbox.hxx>
 #include <controldata.hxx>
-
+#include <comphelper/lok.hxx>
 
 struct ComboBoxBounds
 {
@@ -530,8 +530,12 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
 
 void ComboBox::AdaptDropDownLineCountToMaximum()
 {
-    // adapt to maximum allowed number
-    SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
+    // Adapt to maximum allowed number.
+    // Limit for LOK as we can't render outside of the dialog canvas.
+    if (comphelper::LibreOfficeKit::isActive())
+        SetDropDownLineCount(11);
+    else
+        SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
 }
 
 sal_uInt16 ComboBox::GetDropDownLineCount() const
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 5de0f2fe1a0b..52960a762d17 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -35,6 +35,7 @@
 #include <controldata.hxx>
 #include <listbox.hxx>
 #include <dndeventdispatcher.hxx>
+#include <comphelper/lok.hxx>
 
 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
 
@@ -537,8 +538,12 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
 
 void ListBox::AdaptDropDownLineCountToMaximum()
 {
-    // adapt to maximum allowed number
-    SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
+    // Adapt to maximum allowed number.
+    // Limit for LOK as we can't render outside of the dialog canvas.
+    if (comphelper::LibreOfficeKit::isActive())
+        SetDropDownLineCount(11);
+    else
+        SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
 }
 
 sal_uInt16 ListBox::GetDropDownLineCount() const
commit 50dccc1d59bc851f1c877d4cf2e060f3e4c60ca2
Author:     Marco Cecchetti <mrcekets at gmail.com>
AuthorDate: Thu Nov 22 19:40:35 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:33 2018 +0100

    lok: get correct handlers for a single rotated shape
    
    Change-Id: I74668ca8079d8d56b8c3f2c4513e2a2ec95872c6

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 46c93e985716..8c4be9154284 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -561,10 +561,13 @@ void SdrMarkView::showMarkHandles()
 
 bool SdrMarkView::ImpIsFrameHandles() const
 {
+    // There can be multiple mark views, but we're only interested in the one that has a window associated.
+    const bool bTiledRendering = comphelper::LibreOfficeKit::isActive() && GetFirstOutputDevice() && GetFirstOutputDevice()->GetOutDevType() == OUTDEV_WINDOW;
+
     const size_t nMarkCount=GetMarkedObjectCount();
     bool bFrmHdl=nMarkCount>static_cast<size_t>(mnFrameHandlesLimit) || mbForceFrameHandles;
     bool bStdDrag=meDragMode==SdrDragMode::Move;
-    if (nMarkCount==1 && bStdDrag && bFrmHdl)
+    if (!bTiledRendering && nMarkCount==1 && bStdDrag && bFrmHdl)
     {
         const SdrObject* pObj=GetMarkedObjectByIndex(0);
         if (pObj->GetObjInventor()==SdrInventor::Default)
@@ -638,12 +641,15 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
     if(areMarkHandlesHidden())
         return;
 
+    // There can be multiple mark views, but we're only interested in the one that has a window associated.
+    const bool bTiledRendering = comphelper::LibreOfficeKit::isActive() && GetFirstOutputDevice() && GetFirstOutputDevice()->GetOutDevType() == OUTDEV_WINDOW;
+
     const size_t nMarkCount=GetMarkedObjectCount();
     bool bStdDrag=meDragMode==SdrDragMode::Move;
     bool bSingleTextObjMark=false;
     bool bLimitedRotation(false);
 
-    if (nMarkCount==1)
+    if (!bTiledRendering && nMarkCount==1)
     {
         mpMarkedObj=GetMarkedObjectByIndex(0);
 
@@ -675,9 +681,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
         }
     }
 
-    // There can be multiple mark views, but we're only interested in the one that has a window associated.
-    const bool bTiledRendering = comphelper::LibreOfficeKit::isActive() && GetFirstOutputDevice() && GetFirstOutputDevice()->GetOutDevType() == OUTDEV_WINDOW;
-
     // check if text edit or ole is active and handles need to be suppressed. This may be the case
     // when a single object is selected
     // Using a strict return statement is okay here; no handles means *no* handles.
commit d02fdce7852a08e09b1e72903c08e79b8747a1c3
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Nov 22 12:34:06 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:33 2018 +0100

    lok sd: Insert the new shapes in the center of the slide.
    
    Change-Id: I134f86dc0c49ddf26e7a3cfe790c49ab200de9e9

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 0d89b22eb3bd..33384160e7fa 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -613,6 +613,12 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 
         // calc position and size
         ::tools::Rectangle aVisArea = GetActiveWindow()->PixelToLogic(::tools::Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel()));
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            // aVisArea is nonsensical in the LOK case, use the slide size
+            aVisArea = ::tools::Rectangle(Point(), getCurrentPage()->GetSize());
+        }
+
         Point aPagePos = aVisArea.Center();
         aPagePos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) );
         aPagePos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) );
commit 4c8756127917020e83e2ea83ee5118e30309bda9
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 23 15:59:04 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:32 2018 +0100

    LOK: Update failing unit tests
    
    Change-Id: Ib30be297d87fa40c03974e0a97f243812dc488f3

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index f46b8ca0b63a..34e5b16f2e80 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -867,11 +867,11 @@ void SdTiledRenderingTest::testResizeTable()
     auto pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(pObject);
     CPPUNIT_ASSERT(pTableObject);
 
-    // Select the table by marking it + starting and ending text edit.
-    SdrView* pView = pViewShell->GetView();
-    pView->MarkObj(pObject, pView->GetSdrPageView());
-    pView->SdrBeginTextEdit(pObject);
-    pView->SdrEndTextEdit();
+    SdrHdlList handleList(nullptr);
+    pObject->AddToHdlList(handleList);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), handleList.GetHdlCount());
+    // Take the top left handle
+    SdrHdl* pHdl = handleList.GetHdl(0);
 
     // Remember the original row heights.
     uno::Reference<table::XColumnRowRange> xTable(pTableObject->getTable(), uno::UNO_QUERY);
@@ -882,15 +882,14 @@ void SdTiledRenderingTest::testResizeTable()
     sal_Int32 nExpectedRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
 
     // Resize the upper row, decrease its height by 1 cm.
-    Point aInnerRowEdge = pObject->GetSnapRect().Center();
-    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY()));
-    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY() - 1000));
+    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY()));
+    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY() + 1000));
 
     // Remember the resized row heights.
     sal_Int32 nResizedRow1 = xRow1->getPropertyValue("Size").get<sal_Int32>();
     CPPUNIT_ASSERT(nResizedRow1 < nExpectedRow1);
     sal_Int32 nResizedRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
-    CPPUNIT_ASSERT_EQUAL(nExpectedRow2, nResizedRow2);
+    CPPUNIT_ASSERT(nResizedRow2 < nExpectedRow2);
 
     // Now undo the resize.
     pXImpressDocument->GetDocShell()->GetUndoManager()->Undo();
@@ -900,7 +899,7 @@ void SdTiledRenderingTest::testResizeTable()
     CPPUNIT_ASSERT_EQUAL(nExpectedRow1, nActualRow1);
     sal_Int32 nActualRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
     // Expected was 4000, actual was 4572, i.e. the second row after undo was larger than expected.
-    CPPUNIT_ASSERT_EQUAL(nExpectedRow2, nActualRow2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(nExpectedRow2, nActualRow2, 1.0);
     comphelper::LibreOfficeKit::setActive(false);
 }
 
@@ -915,11 +914,11 @@ void SdTiledRenderingTest::testResizeTableColumn()
     auto pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(pObject);
     CPPUNIT_ASSERT(pTableObject);
 
-    // Select the table by marking it + starting and ending text edit.
-    SdrView* pView = pViewShell->GetView();
-    pView->MarkObj(pObject, pView->GetSdrPageView());
-    pView->SdrBeginTextEdit(pObject);
-    pView->SdrEndTextEdit();
+    SdrHdlList handleList(nullptr);
+    pObject->AddToHdlList(handleList);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), handleList.GetHdlCount());
+    // Take the top left handle
+    SdrHdl* pHdl = handleList.GetHdl(0);
 
     // Remember the original cell widths.
     xmlDocPtr pXmlDoc = parseXmlDump();
@@ -930,16 +929,15 @@ void SdTiledRenderingTest::testResizeTableColumn()
     pXmlDoc = nullptr;
 
     // Resize the left column, decrease its width by 1 cm.
-    Point aInnerRowEdge = pObject->GetSnapRect().Center();
-    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY()));
-    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(aInnerRowEdge.getX() - 1000), convertMm100ToTwip(aInnerRowEdge.getY()));
+    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY()));
+    pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(pHdl->GetPos().getX() + 1000), convertMm100ToTwip(pHdl->GetPos().getY()));
 
     // Remember the resized column widths.
     pXmlDoc = parseXmlDump();
     sal_Int32 nResizedColumn1 = getXPath(pXmlDoc, aPrefix + "TableLayouter_Layout[1]", "size").toInt32();
     CPPUNIT_ASSERT(nResizedColumn1 < nExpectedColumn1);
     sal_Int32 nResizedColumn2 = getXPath(pXmlDoc, aPrefix + "TableLayouter_Layout[2]", "size").toInt32();
-    CPPUNIT_ASSERT(nResizedColumn2 > nExpectedColumn2);
+    CPPUNIT_ASSERT(nResizedColumn2 < nExpectedColumn2);
     xmlFreeDoc(pXmlDoc);
     pXmlDoc = nullptr;
 
commit e75c67bd552d8599126374e231c3a6ea15c25f40
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Nov 22 12:12:07 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:32 2018 +0100

    lok: Insert shapes directly into the document.
    
    Change-Id: I182aa395ce0f4e4185c9c85a866dec89499842f9

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index ea962224f9a8..531aa9052f9c 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <comphelper/lok.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <svl/aeitem.hxx>
@@ -210,6 +211,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 
     assert(nNewId != SID_DRAW_CHART); //#i71254# handled already above
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch (nNewId)
     {
         case SID_OBJECT_SELECT:
@@ -279,6 +283,9 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_CS_ID :
         {
             pTabView->SetDrawFuncPtr(new FuConstCustomShape(*this, pWin, pView, pDoc, aNewReq));
+
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             if ( nNewId != SID_DRAW_CS_ID )
             {
                 const SfxStringItem* pEnumCommand = rReq.GetArg<SfxStringItem>(nNewId);
@@ -309,7 +316,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
     // with qualifier construct directly
     FuPoor* pFuActual = GetDrawFuncPtr();
 
-    if(pFuActual && (rReq.GetModifier() & KEY_MOD1))
+    if(pFuActual && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly))
     {
         // Create default drawing objects via keyboard
         const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 4645d63f6212..0d89b22eb3bd 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/uno/Any.hxx>
 
+#include <comphelper/lok.hxx>
 #include <undo/undomanager.hxx>
 #include <vcl/waitobj.hxx>
 #include <svl/aeitem.hxx>
@@ -227,6 +228,9 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
         rBind.Update(nOldSId);
     }
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch ( nSId )
     {
         case SID_TEXTEDIT:  // BASIC ???
@@ -521,6 +525,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
             SetCurrentFunction( FuConstructCustomShape::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq, bPermanent ) );
             rReq.Done();
 
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             if ( nSId != SID_DRAW_CS_ID )
             {
                 SfxBindings& rBind = GetViewFrame()->GetBindings();
@@ -598,7 +604,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
     }
 
     // with qualifier construct directly
-    if(HasCurrentFunction() && (rReq.GetModifier() & KEY_MOD1))
+    if(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly))
     {
         // get SdOptions
         SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 5a836876255b..8420e9f3a9f5 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -229,6 +229,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
     std::unique_ptr<SwDrawBase> pFuncPtr;
 
+    // for LibreOfficeKit - choosing a shape should construct it directly
+    bool bCreateDirectly = false;
+
     switch (nSlotId)
     {
         case SID_OBJECT_SELECT:
@@ -300,6 +303,9 @@ void SwView::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_CS_ID :
         {
             pFuncPtr.reset( new ConstCustomShape(m_pWrtShell.get(), m_pEditWin, this, rReq ) );
+
+            bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
             m_nDrawSfxId = nSlotId;
             if ( nSlotId != SID_DRAW_CS_ID )
             {
@@ -334,7 +340,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
 
         pTempFuncPtr->Activate(nSlotId);
         NoRotate();
-        if(rReq.GetModifier() == KEY_MOD1)
+        if(rReq.GetModifier() == KEY_MOD1 || bCreateDirectly)
         {
             if(SID_OBJECT_SELECT == m_nDrawSfxId )
             {
commit 25adc4fb5a655906ff62174d90804e50aa1f345e
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Nov 14 12:50:55 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:32 2018 +0100

    Avoid writing out unneeded data to SVG file in SelectionOnly mode
    
    Change-Id: I6d0ce089be051667e965aff45a63f6b1a8342952

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index be852f01fe85..d54de1a52b17 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -785,6 +785,7 @@ bool SVGFilter::implExportDocument()
     mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", true, true );
 
     // Create a ClipPath element that will be used for cutting bitmaps and other elements that could exceed the page margins.
+    if(!mbExportShapeSelection)
     {
         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "ClipPathGroup" );
         SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
@@ -803,7 +804,6 @@ bool SVGFilter::implExportDocument()
         }
         // Create a ClipPath element applied to the leaving slide in order
         // to avoid that slide borders are visible during transition
-        if(!mbExportShapeSelection)
         {
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation_clip_path_shrink" );
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" );
@@ -1189,6 +1189,9 @@ void SVGFilter::implExportAnimations()
 
 void SVGFilter::implExportTextShapeIndex()
 {
+    if(mbExportShapeSelection)
+        return;
+
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextShapeIndex" );
     SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
 
@@ -1487,66 +1490,77 @@ void SVGFilter::implExportDrawPages( const std::vector< Reference< css::drawing:
         }
     }
 
-    // We wrap all slide in a group element with class name "SlideGroup".
-    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "SlideGroup" );
-    SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
-
-    for( sal_Int32 i = nFirstPage; i <= nLastPage; ++i )
+    if(!mbExportShapeSelection)
     {
-        Reference< css::drawing::XShapes > xShapes;
+        // We wrap all slide in a group element with class name "SlideGroup".
+        mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "SlideGroup" );
+        SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
 
-        if (mbExportShapeSelection)
-        {
-            // #i124608# export a given object selection
-            xShapes = maShapeSelection;
-        }
-        else
+        for( sal_Int32 i = nFirstPage; i <= nLastPage; ++i )
         {
-            xShapes.set( rxPages[i], UNO_QUERY );
-        }
+            Reference< css::drawing::XShapes > xShapes;
 
-        if( xShapes.is() )
-        {
-            // Insert the <g> open tag related to the svg element for
-            // handling a slide visibility.
-            // In case the exported slides are more than one the initial
-            // visibility of each slide is set to 'hidden'.
-            if( mbPresentation )
+            if (mbExportShapeSelection)
             {
-                mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" );
+                // #i124608# export a given object selection
+                xShapes = maShapeSelection;
+            }
+            else
+            {
+                xShapes.set( rxPages[i], UNO_QUERY );
             }
-            SvXMLElementExport aGElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
-
 
+            if( xShapes.is() )
             {
-                // Insert a further inner the <g> open tag for handling elements
-                // inserted before or after a slide: that is used for some
-                // when switching from the last to the first slide.
-                const OUString & sPageId = implGetValidIDFromInterface( rxPages[i] );
-                OUString sContainerId = "container-";
-                sContainerId += sPageId;
-                mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sContainerId );
-                SvXMLElementExport aContainerExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+                // Insert the <g> open tag related to the svg element for
+                // handling a slide visibility.
+                // In case the exported slides are more than one the initial
+                // visibility of each slide is set to 'hidden'.
+                if( mbPresentation )
+                {
+                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" );
+                }
+                SvXMLElementExport aGElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+
 
                 {
-                    // add id attribute
-                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId );
+                    // Insert a further inner the <g> open tag for handling elements
+                    // inserted before or after a slide: that is used for some
+                    // when switching from the last to the first slide.
+                    const OUString & sPageId = implGetValidIDFromInterface( rxPages[i] );
+                    OUString sContainerId = "container-";
+                    sContainerId += sPageId;
+                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sContainerId );
+                    SvXMLElementExport aContainerExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
 
-                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Slide" );
+                    {
+                        // add id attribute
+                        mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPageId );
 
-                    // Adding a clip path to each exported slide , so in case
-                    // bitmaps or other elements exceed the slide margins, they are
-                    // trimmed, even when they are shown inside a thumbnail view.
-                    OUString sClipPathAttrValue = "url(#" + msClipPathId + ")";
-                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
+                        mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Slide" );
 
-                    SvXMLElementExport aSlideElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+                        // Adding a clip path to each exported slide , so in case
+                        // bitmaps or other elements exceed the slide margins, they are
+                        // trimmed, even when they are shown inside a thumbnail view.
+                        OUString sClipPathAttrValue = "url(#" + msClipPathId + ")";
+                        mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
 
-                    implExportPage( sPageId, rxPages[i], xShapes, false /* is not a master page */ );
-                }
-            } // append the </g> closing tag related to inserted elements
-        } // append the </g> closing tag related to the svg element handling the slide visibility
+                        SvXMLElementExport aSlideElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+
+                        implExportPage( sPageId, rxPages[i], xShapes, false /* is not a master page */ );
+                    }
+                } // append the </g> closing tag related to inserted elements
+            } // append the </g> closing tag related to the svg element handling the slide visibility
+        }
     }
+    else
+    {
+        assert(maShapeSelection.is());
+        assert(rxPages.size() == 1);
+
+        const OUString & sPageId = implGetValidIDFromInterface( rxPages[0] );
+        implExportPage( sPageId, rxPages[0], maShapeSelection, false /* is not a master page */ );
+     }
 }
 
 
commit a92733b33f969acffe57ea51f603bc98d7c15395
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Nov 13 22:31:25 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:31 2018 +0100

    add parameter TransformRotationDeltaAngle to .uno:TransformDialog
    
    Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 9662124b339a..da6e743e272e 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -240,6 +240,7 @@ class SfxStringItem;
 #define SID_ATTR_TRANSFORM_ROT_X                        TypedWhichId<SfxInt32Item>( SID_SVX_START + 93 )
 #define SID_ATTR_TRANSFORM_ROT_Y                        TypedWhichId<SfxInt32Item>( SID_SVX_START + 94 )
 #define SID_ATTR_TRANSFORM_ANGLE                        TypedWhichId<SfxInt32Item>( SID_SVX_START + 95 )
+#define SID_ATTR_TRANSFORM_DELTA_ANGLE                  TypedWhichId<SfxInt32Item>( SID_SVX_START + 96 )
 #define SID_SIZE_ALL                                    ( SID_SVX_START + 101 )
 #define SID_DRAW_LINE                                   ( SID_SVX_START + 102 )
 #define SID_DRAW_XLINE                                  ( SID_SVX_START + 103 )
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 8ef5efab6432..694b9d01d172 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE
 
 
 SfxVoidItem TransformDialog SID_ATTR_TRANSFORM
-(SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y)
+(SfxUInt32Item TransformRotationDeltaAngle SID_ATTR_TRANSFORM_DELTA_ANGLE,SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y)
 [
     AutoUpdate = FALSE,
     FastCall = TRUE,
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 1acf37cd3771..9b30ccc4417d 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1504,8 +1504,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
     }
 
     // rotation
-    if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem)) {
-        nRotateAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-nOldRotateAngle;
+    if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) {
+        nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() + nOldRotateAngle;
+        bRotate = (nRotateAngle != 0);
+    }
+
+    // rotation
+    if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE, true, &pPoolItem)) {
+        nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - nOldRotateAngle;
         bRotate = (nRotateAngle != 0);
     }
 
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index b2a6d4a0885a..31a599b4defc 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -362,20 +362,30 @@ void SwFrameShell::Execute(SfxRequest &rReq)
                 bApplyNewSize = true;
             }
 
-            // RotGrfFlyFrame: Get Value and disable is in SwGrfShell::GetAttrStateForRotation, but the
-            // value setter uses SID_ATTR_TRANSFORM and a group of three values. Rotation is
-            // added now, so use it in this central place. Do no forget to convert angle from
-            // 100th degrees in SID_ATTR_TRANSFORM_ANGLE to 10th degrees in RES_GRFATR_ROTATION
-            if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_ANGLE, false, &pItem))
+            if (pArgs && (pArgs->HasItem(SID_ATTR_TRANSFORM_ANGLE) || pArgs->HasItem(SID_ATTR_TRANSFORM_DELTA_ANGLE)))
             {
-                const sal_uInt32 nNewRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
                 SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
                 rSh.GetCurAttr(aSet);
                 const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
                 const sal_uInt32 nOldRot(rRotation.GetValue());
 
-                // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available
-                aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize());
+                if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, false, &pItem))
+                {
+                    const sal_uInt32 nDeltaRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
+                    aMgr.SetRotation(nOldRot, nOldRot + nDeltaRot, rRotation.GetUnrotatedSize());
+                }
+
+                // RotGrfFlyFrame: Get Value and disable is in SwGrfShell::GetAttrStateForRotation, but the
+                // value setter uses SID_ATTR_TRANSFORM and a group of three values. Rotation is
+                // added now, so use it in this central place. Do no forget to convert angle from
+                // 100th degrees in SID_ATTR_TRANSFORM_ANGLE to 10th degrees in RES_GRFATR_ROTATION
+                if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_ANGLE, false, &pItem))
+                {
+                    const sal_uInt32 nNewRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
+
+                    // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available
+                    aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize());
+                }
             }
 
             if ( bApplyNewSize )
commit ad5fb8798b295e9ad706a3836ffb53a0630f752f
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Nov 13 01:24:40 2018 -0500
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:31 2018 +0100

    LOK: Fix API for renderShapeSelection
    
    Unlike C++, C doesn't allow reference-to-pointer types,
    and we do have C code that wouldn't compile with ref-to-ptr.
    Had to change to ptr-to-ptr, which is the proper way of
    having output arrays.
    
    For the same reason, we cannot use new/delete, rather we
    must use malloc/free.
    
    Another (lesser) issue was that we used the renderShapeSelection
    API to echo back an array we give it as prefix. This made
    the API unecessarily complex (in undocumented ways) and
    forced the implementation to both worry about user-data
    and managing the input memory. This logic is best moved
    to the client and the API simply returns the output data.
    
    Speaking of returning data, the API now returns the size
    of the array it allocated and wrote to, so the client
    can do a simple check on the return value directly.
    
    Change-Id: Ida216c10d5b37efd1e0861e26b72cabb25c568e6

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 81a51de8cde9..5bf343b8c825 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2459,6 +2459,7 @@ void DesktopLOKTest::testInsertCertificatePEM()
 
     comphelper::LibreOfficeKit::setActive(false);
 }
+
 namespace {
 
 constexpr size_t documentClassOffset(int i)
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 72af9accb971..90994a92c257 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -751,7 +751,7 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
 
 static int doc_getSignatureState(LibreOfficeKitDocument* pThis);
 
-static void doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char*& pOutput, size_t& nOutputSize);
+static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput);
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent)
     : mxComponent(xComponent)
@@ -2602,35 +2602,47 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n
     }
 }
 
-static void doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char*& pOutput, size_t& nOutputSize)
+static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput)
 {
     SolarMutexGuard aGuard;
     if (gImpl)
         gImpl->maLastExceptionMsg.clear();
 
-    LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
-
-    uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
+    try
+    {
+        LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
-    SvMemoryStream aOutStream;
-    uno::Reference < io::XOutputStream > xOut = new utl::OOutputStreamWrapper( aOutStream );
+        uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
 
-    utl::MediaDescriptor aMediaDescriptor;
-    aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export");
-    aMediaDescriptor["SelectionOnly"] <<= true;
-    aMediaDescriptor["OutputStream"] <<= xOut;
+        SvMemoryStream aOutStream;
+        uno::Reference<io::XOutputStream> xOut = new utl::OOutputStreamWrapper(aOutStream);
 
-    xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
+        utl::MediaDescriptor aMediaDescriptor;
+        aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export");
+        aMediaDescriptor["SelectionOnly"] <<= true;
+        aMediaDescriptor["OutputStream"] <<= xOut;
 
+        xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
 
-    size_t nStreamSize = aOutStream.GetEndOfData();
-    char* pTmp = pOutput;
-    pOutput = new char[nOutputSize + nStreamSize];
-    std::memcpy(pOutput, pTmp, nOutputSize);
-    std::memcpy(pOutput+nOutputSize, aOutStream.GetData(), nStreamSize);
+        if (pOutput)
+        {
+            const size_t nOutputSize = aOutStream.GetEndOfData();
+            *pOutput = static_cast<char*>(malloc(nOutputSize));
+            if (*pOutput)
+            {
+                std::memcpy(*pOutput, aOutStream.GetData(), nOutputSize);
+                return nOutputSize;
+            }
+        }
+    }
+    catch (const uno::Exception& exception)
+    {
+        if (gImpl)
+            gImpl->maLastExceptionMsg = exception.Message;
+        SAL_WARN("lok", "Failed to render shape selection: " << exception);
+    }
 
-    nOutputSize += nStreamSize;
-    delete [] pTmp;
+    return 0;
 }
 
 /** Class to react on finishing of a dispatched command.
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 0da392467b84..4dd23a2cbc7a 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -348,9 +348,7 @@ struct _LibreOfficeKitDocumentClass
     int (*getSignatureState) (LibreOfficeKitDocument* pThis);
 
     /// @see lok::Document::renderShapeSelection
-    void (*renderShapeSelection) (LibreOfficeKitDocument* pThis,
-                                  char*& pOutput,
-                                  size_t& nOutputSize);
+    size_t (*renderShapeSelection)(LibreOfficeKitDocument* pThis, char** pOutput);
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 865ad434417b..5d7771cf80b0 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -621,11 +621,12 @@ public:
 
     /**
      * Gets an image of the selected shapes.
-     *
+     * @param pOutput contains the result; use free to deallocate.
+     * @return the size ouf *pOutput in bytes.
      */
-    void renderShapeSelection(char*& pOutput, size_t& nOutputSize)
+    size_t renderShapeSelection(char** pOutput)
     {
-        mpDoc->pClass->renderShapeSelection(mpDoc, pOutput, nOutputSize);
+        return mpDoc->pClass->renderShapeSelection(mpDoc, pOutput);
     }
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
commit 2bfc4494727d347d6ae8e0c6a68dee39a2dda040
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Nov 12 20:04:05 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:30 2018 +0100

    Remove noise from the SVG file exported in SelectionOnly mode
    
    Change-Id: Ia09f6ab40c20c17230e8b544987a5d11b7359f2f

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index bce3e2612b18..be852f01fe85 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -803,6 +803,7 @@ bool SVGFilter::implExportDocument()
         }
         // Create a ClipPath element applied to the leaving slide in order
         // to avoid that slide borders are visible during transition
+        if(!mbExportShapeSelection)
         {
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation_clip_path_shrink" );
             mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" );
@@ -821,7 +822,7 @@ bool SVGFilter::implExportDocument()
 
     if( implLookForFirstVisiblePage() )  // OK! We found at least one visible page.
     {
-        if( mbPresentation )
+        if( mbPresentation && !mbExportShapeSelection )
         {
             implGenerateMetaData();
             implExportAnimations();
@@ -1262,6 +1263,9 @@ void SVGFilter::implEmbedBulletGlyph( sal_Unicode cBullet, const OUString & sPat
  */
 void SVGFilter::implExportTextEmbeddedBitmaps()
 {
+    if (mEmbeddedBitmapActionSet.empty())
+        return;
+
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextEmbeddedBitmaps" );
     SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
 
@@ -1462,7 +1466,7 @@ void SVGFilter::implExportDrawPages( const std::vector< Reference< css::drawing:
                 "SVGFilter::implExportDrawPages: nFirstPage > nLastPage" );
 
     // dummy slide - used as leaving slide for transition on the first slide
-    if( mbPresentation )
+    if( mbPresentation && !mbExportShapeSelection)
     {
         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "DummySlide" );
         SvXMLElementExport aDummySlideElement( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
commit 7ffb0b7c71ea635f1a41b092b20b2b5ad37d04f4
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Nov 12 18:11:21 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:30 2018 +0100

    Remove cout line
    
    Change-Id: Ic1b30a89ae513b3b3ec71853830ef7600801dee0

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 77037e47fee1..72af9accb971 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2608,8 +2608,6 @@ static void doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char*& pOutp
     if (gImpl)
         gImpl->maLastExceptionMsg.clear();
 
-    std::cout << "doc_renderShapeSelection" << std::endl;
-
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
     uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
commit b2c3ee24fd1075be2a90c01eadb65d7aa42eb531
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Nov 11 16:12:31 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:29 2018 +0100

    svx: add parameters to .uno:TransformDialog
    
    Change-Id: I6d9e110f48b0f4c6226503d01e10d099cfcb130c

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 91699445ae45..8ef5efab6432 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE
 
 
 SfxVoidItem TransformDialog SID_ATTR_TRANSFORM
-()
+(SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y)
 [
     AutoUpdate = FALSE,
     FastCall = TRUE,
commit b4a58119a60910514f3ef5a163d32bfa8734eec1
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Nov 10 18:57:26 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Dec 7 11:52:29 2018 +0100

    Introduce client-server message for requesting the selected shape as SVG
    
    It works for Impress only now.
    
    Change-Id: I95e3e37ae7df49b567108f6d6467038b715e886d

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 65632e333b39..81a51de8cde9 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2522,9 +2522,10 @@ void DesktopLOKTest::testABI()
     CPPUNIT_ASSERT_EQUAL(documentClassOffset(43), offsetof(struct _LibreOfficeKitDocumentClass, insertCertificate));
     CPPUNIT_ASSERT_EQUAL(documentClassOffset(44), offsetof(struct _LibreOfficeKitDocumentClass, addCertificate));
     CPPUNIT_ASSERT_EQUAL(documentClassOffset(45), offsetof(struct _LibreOfficeKitDocumentClass, getSignatureState));
+    CPPUNIT_ASSERT_EQUAL(documentClassOffset(46), offsetof(struct _LibreOfficeKitDocumentClass, renderShapeSelection));
     // Extending is fine, update this, and add new assert for the offsetof the
     // new method
-    CPPUNIT_ASSERT_EQUAL(documentClassOffset(46), sizeof(struct _LibreOfficeKitDocumentClass));
+    CPPUNIT_ASSERT_EQUAL(documentClassOffset(47), sizeof(struct _LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index f235728e65bb..77037e47fee1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -121,6 +121,7 @@
 #include <unotools/mediadescriptor.hxx>
 #include <unotools/pathoptions.hxx>
 #include <unotools/tempfile.hxx>
+#include <unotools/streamwrap.hxx>
 #include <osl/module.hxx>
 #include <comphelper/sequence.hxx>
 #include <sfx2/sfxbasemodel.hxx>
@@ -750,6 +751,8 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
 
 static int doc_getSignatureState(LibreOfficeKitDocument* pThis);
 
+static void doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char*& pOutput, size_t& nOutputSize);
+
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent)
     : mxComponent(xComponent)
 {
@@ -815,6 +818,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
         m_pDocumentClass->addCertificate = doc_addCertificate;
         m_pDocumentClass->getSignatureState = doc_getSignatureState;
 
+        m_pDocumentClass->renderShapeSelection = doc_renderShapeSelection;
+
         gDocumentClass = m_pDocumentClass;
     }
     pClass = m_pDocumentClass.get();
@@ -2597,6 +2602,39 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n
     }
 }
 
+static void doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char*& pOutput, size_t& nOutputSize)
+{
+    SolarMutexGuard aGuard;
+    if (gImpl)
+        gImpl->maLastExceptionMsg.clear();
+
+    std::cout << "doc_renderShapeSelection" << std::endl;
+
+    LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
+
+    uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
+
+    SvMemoryStream aOutStream;
+    uno::Reference < io::XOutputStream > xOut = new utl::OOutputStreamWrapper( aOutStream );
+
+    utl::MediaDescriptor aMediaDescriptor;
+    aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export");
+    aMediaDescriptor["SelectionOnly"] <<= true;
+    aMediaDescriptor["OutputStream"] <<= xOut;
+
+    xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
+
+
+    size_t nStreamSize = aOutStream.GetEndOfData();
+    char* pTmp = pOutput;
+    pOutput = new char[nOutputSize + nStreamSize];
+    std::memcpy(pOutput, pTmp, nOutputSize);
+    std::memcpy(pOutput+nOutputSize, aOutStream.GetData(), nStreamSize);
+
+    nOutputSize += nStreamSize;
+    delete [] pTmp;
+}
+
 /** Class to react on finishing of a dispatched command.
 
     This will call a LOK_COMMAND_FINISHED callback when postUnoCommand was
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 4f7b8982f1ae..ebcc522fbbca 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -341,6 +341,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
             {
                 // #i124608# extract single selection wanted from dialog return values
                 rDescriptor[nInd].Value >>= bSelectionOnly;
+                bPageProvided = false;
             }
             else if (rDescriptor[nInd].Name == "PagePos")
             {
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 27d968c4a6b7..0da392467b84 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -347,6 +347,11 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::getSignatureState().
     int (*getSignatureState) (LibreOfficeKitDocument* pThis);
 
+    /// @see lok::Document::renderShapeSelection
+    void (*renderShapeSelection) (LibreOfficeKitDocument* pThis,
+                                  char*& pOutput,
+                                  size_t& nOutputSize);
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 4a0ec6784b7b..865ad434417b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -619,6 +619,15 @@ public:
         return mpDoc->pClass->getSignatureState(mpDoc);
     }
 
+    /**
+     * Gets an image of the selected shapes.
+     *
+     */
+    void renderShapeSelection(char*& pOutput, size_t& nOutputSize)
+    {
+        mpDoc->pClass->renderShapeSelection(mpDoc, pOutput, nOutputSize);
+    }
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 


More information about the Libreoffice-commits mailing list