[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 261 commits - avmedia/inc avmedia/source basctl/inc basctl/Library_basctl.mk basctl/source basctl/uiconfig basegfx/test basic/qa basic/source bin/find-unused-defines.py bin/find-unused-typedefs.py canvas/source chart2/qa chart2/source compilerplugins/clang config_host.mk.in configmgr/source configure.ac connectivity/IwyuFilter_connectivity.yaml connectivity/source cppcanvas/source cppu/source cui/inc cui/source dbaccess/inc dbaccess/source desktop/source dictionaries distro-configs/Jenkins drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source dtrans/source dtrans/test editeng/qa editeng/source embeddedobj/source embedserv/source emfio/CppunitTest_emfio_emf_test.mk emfio/Library_emfio.mk eventattacher/source extensions/source extensions/test extensions/uiconfig filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/source forms/qa forms/source formula/source fpicker/source framework/source helpcontent2 i18nlangtag/source i18npool/source icon-themes/colibre icon-themes/colibre_svg include/basegfx include/drawinglayer include/LibreOfficeKit include/o3tl include/oox include/sax include/sfx2 include/svl include/svtools include/svx include/test include/tools include/vbahelper include/vcl include/xmloff jvmfwk/CustomTarget_jreproperties.mk linguistic/source logerrit o3tl/Module_o3tl.mk o3tl/qa offapi/com offapi/UnoApi_offapi.mk officecfg/registry oox/inc oox/Library_oox.mk oox/qa oox/source oox/util osx/soffice.xcodeproj package/source pyuno/source Repository.mk ridljar/Jar_libreoffice.mk ridljar/Jar_unoloader.mk ridljar/source sal/osl sc/CppunitTest_sc_ucalc.mk schema/libreoffice sc/inc sc/Library_sc.mk sc/qa sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/CppunitTest_sd_uimpress.mk sdext/source sd/inc sd/Library_sd.mk sd/qa sd/sdi sd/source sfx2/inc sfx2/Li brary_sfx.mk sfx2/source shell/source slideshow/source solenv/bin solenv/clang-format solenv/gbuild solenv/sanitizers starmath/inc starmath/source svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svgio/source svl/qa svl/source svtools/Library_svt.mk svtools/source svx/CppunitTest_svx_gallery_test.mk svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/qa svx/sdi svx/source svx/uiconfig sw/CppunitTest_sw_htmlexport.mk sw/CppunitTest_sw_ooxmlexport15.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/IwyuFilter_sw.yaml sw/Library_sw.mk sw/Library_swui.mk sw/Module_sw.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sw/UITest_sw_ui_fmtui.mk sysui/desktop toolkit/inc toolkit/source tools/qa translations ucb/source uitest/uitest uitest/writer_tests5 unotools/source unoxml/source vcl/backendtest vcl/CppunitTest_vcl_graphic_test.mk vcl/headless vcl/inc vcl/jsdialog vcl/Library_vcl.mk vcl/opengl vcl/osx vcl/qa vcl/qt5 vcl/skia vcl/source vcl/uiconfig vcl/unx vcl/win vcl/workben writerfilter/source writerperfect/IwyuFilter_writerperfect.yaml xmloff/inc xmloff/qa xmloff/source xmloff/util

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed May 27 18:11:17 UTC 2020


Rebased ref, commits from common ancestor:
commit 387aedf5a83533fdcf57b41f1907ade9ecf39ee8
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 15:27:14 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:23 2020 +0200

    svx: add ability to show sub-selections in a marked object
    
    Draws selection rectangles inside the object window.
    
    Change-Id: I994477426489ea4cea89c86f9e51c9978f16b350

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 9ccf77ef2784..c7d7a4db4189 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -26,6 +26,8 @@
 #include <svx/svdtypes.hxx>
 #include <svx/svxdllapi.h>
 #include <o3tl/typed_flags_set.hxx>
+#include <basegfx/range/b2drectangle.hxx>
+
 
 class SfxViewShell;
 
@@ -84,6 +86,7 @@ enum class ImpGetDescriptionOptions
 };
 
 class ImplMarkingOverlay;
+class MarkingSubSelectionOverlay;
 
 class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView
 {
@@ -94,6 +97,8 @@ class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView
     std::unique_ptr<ImplMarkingOverlay> mpMarkPointsOverlay;
     std::unique_ptr<ImplMarkingOverlay> mpMarkGluePointsOverlay;
 
+    std::unique_ptr<MarkingSubSelectionOverlay> mpMarkingSubSelectionOverlay;
+
 protected:
     SdrObject*                  mpMarkedObj;       // If not just one object ( i.e. More than one object ) is marked.
     SdrPageView*                mpMarkedPV;        // If all marked obects are situated on the same PageView.
@@ -101,8 +106,10 @@ protected:
     Point                       maRef1;            // Persistent - Rotation center / axis of reflection
     Point                       maRef2;            // Persistent
     SdrHdlList                  maHdlList;
+
     sdr::ViewSelection          maSdrViewSelection;
 
+    std::vector<basegfx::B2DRectangle> maSubSelectionList;
     tools::Rectangle            maMarkedObjRect;
     tools::Rectangle            maMarkedPointsRect;
     tools::Rectangle            maMarkedGluePointsRect;
@@ -302,7 +309,8 @@ public:
     // Mark all objects within a rectangular area
     // Just objects are marked which are inclosed completely
     void MarkObj(const tools::Rectangle& rRect, bool bUnmark);
-    void MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark=false, bool bImpNoSetMarkHdl=false);
+    void MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark = false, bool bDoNoSetMarkHdl = false,
+                 std::vector<basegfx::B2DRectangle> const & rSubSelections = std::vector<basegfx::B2DRectangle>());
     void MarkAllObj(SdrPageView* pPV=nullptr); // pPage=NULL => all displayed pages
     void UnmarkAllObj(SdrPageView const * pPV=nullptr); // pPage=NULL => all displayed pages
 
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 99a5bcdfefc8..e7c818ecddc8 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -41,6 +41,7 @@
 #include <sdr/overlay/overlayrollingrectangle.hxx>
 #include <svx/sdr/contact/objectcontact.hxx>
 #include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/sdr/overlay/overlayselection.hxx>
 #include <svx/sdr/contact/viewcontact.hxx>
 #include <svx/sdrpaintwindow.hxx>
 #include <svx/sdrpagewindow.hxx>
@@ -125,6 +126,38 @@ void ImplMarkingOverlay::SetSecondPosition(const basegfx::B2DPoint& rNewPosition
     }
 }
 
+class MarkingSubSelectionOverlay
+{
+    sdr::overlay::OverlayObjectList maObjects;
+
+public:
+    MarkingSubSelectionOverlay(const SdrPaintView& rView, std::vector<basegfx::B2DRectangle> const & rSelections)
+    {
+        if (comphelper::LibreOfficeKit::isActive())
+            return; // We do client-side object manipulation with the Kit API
+
+        for (sal_uInt32 a(0); a < rView.PaintWindowCount(); a++)
+        {
+            SdrPaintWindow* pCandidate = rView.GetPaintWindow(a);
+            const rtl::Reference<sdr::overlay::OverlayManager>& xTargetOverlay = pCandidate->GetOverlayManager();
+
+            if (xTargetOverlay.is())
+            {
+                const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+                const Color aHighlightColor = aSvtOptionsDrawinglayer.getHilightColor();
+
+                std::unique_ptr<sdr::overlay::OverlaySelection> pNew =
+                    std::make_unique<sdr::overlay::OverlaySelection>(
+                        sdr::overlay::OverlayType::Transparent,
+                        aHighlightColor, rSelections, false);
+
+                xTargetOverlay->add(*pNew);
+                maObjects.append(std::move(pNew));
+            }
+        }
+    }
+};
+
 
 // MarkView
 
@@ -923,6 +956,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
     SdrHdlKind eSaveKind(SdrHdlKind::Move);
     SdrObject* pSaveObj = nullptr;
 
+    mpMarkingSubSelectionOverlay.reset();
+
     if(pSaveOldFocusHdl
         && pSaveOldFocusHdl->GetObj()
         && dynamic_cast<const SdrPathObj*>(pSaveOldFocusHdl->GetObj()) != nullptr
@@ -1017,6 +1052,11 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
         {
             return;
         }
+
+        if (!maSubSelectionList.empty())
+        {
+            mpMarkingSubSelectionOverlay = std::make_unique<MarkingSubSelectionOverlay>(*this, maSubSelectionList);
+        }
     }
 
     tools::Rectangle aRect(GetMarkedObjRect());
@@ -1912,7 +1952,8 @@ void collectUIInformation(const SdrObject* pObj)
 
 }
 
-void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool bImpNoSetMarkHdl)
+void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool bDoNoSetMarkHdl,
+                          std::vector<basegfx::B2DRectangle> const & rSubSelections)
 {
     if (pObj!=nullptr && pPV!=nullptr && IsObjMarkable(pObj, pPV)) {
         BrkAction();
@@ -1929,7 +1970,10 @@ void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool
                 GetMarkedObjectListWriteAccess().DeleteMark(nPos);
             }
         }
-        if (!bImpNoSetMarkHdl) {
+
+        maSubSelectionList = rSubSelections;
+
+        if (!bDoNoSetMarkHdl) {
             MarkListHasChanged();
             AdjustMarkHdl();
         }
commit b7487da972b2d1f57ee81123b605e699537ce59b
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 14:27:30 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:22 2020 +0200

    sd: some style fixes in Outliner.cxx
    
    Also no need to reset the mpImpl in destructor when it will be
    reset and destroyed in the next step anyway.
    
    Change-Id: I5027f962efc4159e61aa7eda26619db2e3b9434c

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e98c1bde5795..c2cff89909a7 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -211,7 +211,6 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode )
 /// Nothing spectacular in the destructor.
 SdOutliner::~SdOutliner()
 {
-    mpImpl.reset();
 }
 
 /** Prepare find&replace or spellchecking.  This distinguishes between three
@@ -467,7 +466,9 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
 
         const SvxSearchCmd nCommand (mpSearchItem->GetCommand());
         if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL)
+        {
             bEndOfSearch = SearchAndReplaceAll ();
+        }
         else
         {
             RememberStartPosition ();
@@ -573,6 +574,7 @@ void SdOutliner::Initialize (bool bDirectionIsForward)
 bool SdOutliner::SearchAndReplaceAll()
 {
     bool bRet = true;
+
     // Save the current position to be restored after having replaced all
     // matches.
     RememberStartPosition ();
@@ -756,13 +758,13 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
         pOutlinerView = mpImpl->GetOutlinerView();
     }
 
-    if (pViewShell != nullptr)
+    if (pViewShell)
     {
         mpView = pViewShell->GetView();
         mpWindow = pViewShell->GetActiveWindow();
         pOutlinerView->SetWindow(mpWindow);
 
-        if( nullptr != dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() ))
+        if (nullptr != dynamic_cast<const sd::DrawViewShell*>(pViewShell.get()))
         {
             // When replacing we first check if there is a selection
             // indicating a match.  If there is then replace it.  The
@@ -785,7 +787,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
             {
                 ProvideNextTextObject ();
 
-                if ( ! mbEndOfSearch)
+                if (!mbEndOfSearch)
                 {
                     // Remember the current position as the last one with a
                     // text object.
@@ -807,7 +809,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
                 }
             }
         }
-        else if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ))
+        else if (nullptr != dynamic_cast<const sd::OutlineViewShell*>(pViewShell.get()))
         {
             mpDrawDocument->GetDocSh()->SetWaitCursor(false);
             // The following loop is executed more than once only when a
commit a4504f93ade3bac15d4d9261c171e5c41323ac89
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 14:20:44 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:22 2020 +0200

    sd: in Outline add getViewShellBase to simplify code
    
    This simplifies constant casting of SfxViewShell::Current to
    sd::ViewShellBase. Instead of doing it in every method, let's
    have a dedicated function for that.
    
    Change-Id: Iadbe446c7edce5df40c2da14e3eee65012dd4d77

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e77e60c5d305..e98c1bde5795 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -111,6 +111,16 @@ private:
     OutlinerView* mpOutlineView;
 };
 
+namespace
+{
+
+sd::ViewShellBase* getViewShellBase()
+{
+    return dynamic_cast<sd::ViewShellBase*>(SfxViewShell::Current());
+}
+
+} // end anonymous namespace
+
 SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode )
     : SdrOutliner( &pDoc->GetItemPool(), nMode ),
       mpImpl(new Implementation()),
@@ -228,7 +238,7 @@ void SdOutliner::PrepareSpelling()
 {
     mbPrepareSpellingPending = false;
 
-    sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() );
+    sd::ViewShellBase* pBase = getViewShellBase();
     if (pBase != nullptr)
         SetViewShell (pBase->GetMainViewShell());
     SetRefDevice( SD_MOD()->GetVirtualRefDevice() );
@@ -270,7 +280,7 @@ void SdOutliner::EndSpelling()
     std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
     std::shared_ptr<sd::ViewShell> pOldViewShell (pViewShell);
 
-    sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() );
+    sd::ViewShellBase* pBase = getViewShellBase();
     if (pBase != nullptr)
         pViewShell = pBase->GetMainViewShell();
     else
@@ -413,7 +423,7 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
     mpDrawDocument->GetDocSh()->SetWaitCursor( true );
     if (mbPrepareSpellingPending)
         PrepareSpelling();
-    sd::ViewShellBase* pBase = dynamic_cast< sd::ViewShellBase *>( SfxViewShell::Current() );
+    sd::ViewShellBase* pBase = getViewShellBase();
     // Determine whether we have to abort the search.  This is necessary
     // when the main view shell does not support searching.
     bool bAbort = false;
@@ -1618,7 +1628,7 @@ void SdOutliner::BeginConversion()
 {
     SetRefDevice( SD_MOD()->GetVirtualRefDevice() );
 
-    sd::ViewShellBase* pBase = dynamic_cast<sd::ViewShellBase*>( SfxViewShell::Current() );
+    sd::ViewShellBase* pBase = getViewShellBase();
     if (pBase != nullptr)
         SetViewShell (pBase->GetMainViewShell());
 
commit e413f489c369ca5214000502ab372f458c26f9ad
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 14:13:02 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:21 2020 +0200

    sd: move IsValidTextObject into source as anon. function
    
    IsValidTextObject is only used internally in Outline, so put it
    inside the source file as an anonymous function and not as a
    member function of Outliner.
    
    Change-Id: I867dc4f465a694e61b6102b19f8e54ce623e2858

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 79c54c032a03..5a65f3aab4be 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -416,13 +416,6 @@ private:
     */
     bool ShowWrapArroundDialog();
 
-    /** Check whether the object pointed to by the iterator is a valid text
-        object.
-        @param aPosition
-            The object for which to test whether it is a valid text object.
-    */
-    static bool IsValidTextObject(const ::sd::outliner::IteratorPosition& rPosition);
-
     /** Put text of current text object into outliner so that the text can
         be searched/spell checked.
     */
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 6e982f3d25f7..e77e60c5d305 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1024,6 +1024,18 @@ void SdOutliner::RestoreStartPosition()
     }
 }
 
+namespace
+{
+
+bool lclIsValidTextObject(const sd::outliner::IteratorPosition& rPosition)
+{
+    auto* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() );
+    return (pObject != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj();
+}
+
+} // end anonymous namespace
+
+
 /** The main purpose of this method is to iterate over all shape objects of
     the search area (current selection, current view, or whole document)
     until a text object has been found that contains at least one match or
@@ -1069,7 +1081,7 @@ void SdOutliner::ProvideNextTextObject()
             bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && (maCurrentPosition.mePageKind != PageKind::Standard || maCurrentPosition.meEditMode != EditMode::Page);
 
             // Switch to the current object only if it is a valid text object.
-            if (!bForbiddenPage && IsValidTextObject(maCurrentPosition))
+            if (!bForbiddenPage && lclIsValidTextObject(maCurrentPosition))
             {
                 // Don't set yet in case of searching: the text object may not match.
                 if (meMode != SEARCH)
@@ -1237,12 +1249,6 @@ bool SdOutliner::ShowWrapArroundDialog()
     return (nBoxResult == RET_YES);
 }
 
-bool SdOutliner::IsValidTextObject (const sd::outliner::IteratorPosition& rPosition)
-{
-    SdrTextObj* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() );
-    return (pObject != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj();
-}
-
 void SdOutliner::PutTextIntoOutliner()
 {
     mpSearchSpellTextObj = dynamic_cast<SdrTextObj*>( mpObj );
commit b1aff33a87313eff93f5db594f27d03996da666f
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 14:07:10 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:21 2020 +0200

    sd: move LOK search result logic to it's own method
    
    Change-Id: I67cbe4d3d63bffdab72c09b3a956f67806588348

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 3a73b9339f09..79c54c032a03 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -360,6 +360,10 @@ private:
     */
     bool SearchAndReplaceOnce(std::vector<::sd::SearchSelection>* pSelections = nullptr);
 
+    void sendLOKSearchResultCallback(std::shared_ptr<sd::ViewShell>& pViewShell,
+                                     OutlinerView* pOutlinerView,
+                                     std::vector<sd::SearchSelection>* pSelections);
+
     /** Detect changes of the document or view and react accordingly.  Such
         changes may occur because different calls to
         <member>SearchAndReplace()</member> there usually is user
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e7f676f43e4e..6e982f3d25f7 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -673,6 +673,66 @@ bool SdOutliner::SearchAndReplaceAll()
     return bRet;
 }
 
+void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr<sd::ViewShell> & pViewShell,
+                                             OutlinerView* pOutlinerView,
+                                             std::vector<sd::SearchSelection>* pSelections)
+{
+    std::vector<::tools::Rectangle> aLogicRects;
+    pOutlinerView->GetSelectionRectangles(aLogicRects);
+
+    // convert to twips if in 100thmm (seems as if LibreOfficeKit is based on twips?). Do this
+    // here where we have the only place needing this, *not* in ImpEditView::GetSelectionRectangles
+    // which makes that method unusable for others
+    if (pOutlinerView->GetWindow() && MapUnit::Map100thMM == pOutlinerView->GetWindow()->GetMapMode().GetMapUnit())
+    {
+        for (tools::Rectangle& rRectangle : aLogicRects)
+        {
+            rRectangle = OutputDevice::LogicToLogic(rRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+        }
+    }
+
+    std::vector<OString> aLogicRectStrings;
+    std::transform(aLogicRects.begin(), aLogicRects.end(), std::back_inserter(aLogicRectStrings),
+        [](const ::tools::Rectangle& rRectangle)
+    {
+        return rRectangle.toString();
+    });
+
+    OString sRectangles = comphelper::string::join("; ", aLogicRectStrings);
+
+    if (!pSelections)
+    {
+        // notify LibreOfficeKit about changed page
+        OString aPayload = OString::number(maCurrentPosition.mnPageIndex);
+        SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
+        rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
+
+        // also about search result selections
+        boost::property_tree::ptree aTree;
+        aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
+        aTree.put("highlightAll", false);
+
+        boost::property_tree::ptree aChildren;
+        boost::property_tree::ptree aChild;
+        aChild.put("part", OString::number(maCurrentPosition.mnPageIndex).getStr());
+        aChild.put("rectangles", sRectangles.getStr());
+        aChildren.push_back(std::make_pair("", aChild));
+        aTree.add_child("searchResultSelection", aChildren);
+
+        std::stringstream aStream;
+        boost::property_tree::write_json(aStream, aTree);
+        aPayload = aStream.str().c_str();
+        rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
+    }
+    else
+    {
+        sd::SearchSelection aSelection(maCurrentPosition.mnPageIndex, sRectangles);
+        bool bDuplicate = !pSelections->empty() && pSelections->back() == aSelection;
+        if (!bDuplicate)
+            pSelections->push_back(aSelection);
+    }
+}
+
 bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelections)
 {
     DetectChange ();
@@ -764,55 +824,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
 
     if (pViewShell && comphelper::LibreOfficeKit::isActive() && mbStringFound)
     {
-        std::vector<::tools::Rectangle> aLogicRects;
-        pOutlinerView->GetSelectionRectangles(aLogicRects);
-
-        // convert to twips if in 100thmm (seems as if LibreOfficeKit is based on twips?). Do this
-        // here where we have the only place needing this, *not* in ImpEditView::GetSelectionRectangles
-        // which makes that method unusable for others
-        if (pOutlinerView->GetWindow() && MapUnit::Map100thMM == pOutlinerView->GetWindow()->GetMapMode().GetMapUnit())
-        {
-            for (tools::Rectangle& rRectangle : aLogicRects)
-            {
-                rRectangle = OutputDevice::LogicToLogic(rRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
-            }
-        }
-
-        std::vector<OString> aLogicRectStrings;
-        std::transform(aLogicRects.begin(), aLogicRects.end(), std::back_inserter(aLogicRectStrings), [](const ::tools::Rectangle& rRectangle) { return rRectangle.toString(); });
-        OString sRectangles = comphelper::string::join("; ", aLogicRectStrings);
-
-        if (!pSelections)
-        {
-            // notify LibreOfficeKit about changed page
-            OString aPayload = OString::number(maCurrentPosition.mnPageIndex);
-            SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
-            rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
-
-            // also about search result selections
-            boost::property_tree::ptree aTree;
-            aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
-            aTree.put("highlightAll", false);
-
-            boost::property_tree::ptree aChildren;
-            boost::property_tree::ptree aChild;
-            aChild.put("part", OString::number(maCurrentPosition.mnPageIndex).getStr());
-            aChild.put("rectangles", sRectangles.getStr());
-            aChildren.push_back(std::make_pair("", aChild));
-            aTree.add_child("searchResultSelection", aChildren);
-
-            std::stringstream aStream;
-            boost::property_tree::write_json(aStream, aTree);
-            aPayload = aStream.str().c_str();
-            rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
-        }
-        else
-        {
-            sd::SearchSelection aSelection(maCurrentPosition.mnPageIndex, sRectangles);
-            bool bDuplicate = !pSelections->empty() && pSelections->back() == aSelection;
-            if (!bDuplicate)
-                pSelections->push_back(aSelection);
-        }
+        sendLOKSearchResultCallback(pViewShell, pOutlinerView, pSelections);
     }
 
     return mbEndOfSearch;
commit 81884882b33c7f2e1d2b00411447986c4584530e
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 12:54:54 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:20 2020 +0200

    svx: convert ImplMarkingOverlay and friends to use unique_ptr
    
    Change-Id: I19ba9e93f2804fded237b760a28f3ce62e4b2c5f

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 49d39f06fb8d..9ccf77ef2784 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -90,9 +90,9 @@ class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView
     friend class                SdrPageView;
 
     // #114409#-3 Migrate selections
-    ImplMarkingOverlay*                                 mpMarkObjOverlay;
-    ImplMarkingOverlay*                                 mpMarkPointsOverlay;
-    ImplMarkingOverlay*                                 mpMarkGluePointsOverlay;
+    std::unique_ptr<ImplMarkingOverlay> mpMarkObjOverlay;
+    std::unique_ptr<ImplMarkingOverlay> mpMarkPointsOverlay;
+    std::unique_ptr<ImplMarkingOverlay> mpMarkGluePointsOverlay;
 
 protected:
     SdrObject*                  mpMarkedObj;       // If not just one object ( i.e. More than one object ) is marked.
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 3e28a3956391..99a5bcdfefc8 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -354,10 +354,10 @@ void SdrMarkView::BegMarkObj(const Point& rPnt, bool bUnmark)
 {
     BrkAction();
 
-    DBG_ASSERT(nullptr == mpMarkObjOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkObjOverlay (!)");
+    DBG_ASSERT(!mpMarkObjOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkObjOverlay (!)");
 
     basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
-    mpMarkObjOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+    mpMarkObjOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
 
     maDragStat.Reset(rPnt);
     maDragStat.NextPoint();
@@ -401,8 +401,7 @@ void SdrMarkView::BrkMarkObj()
     if(IsMarkObj())
     {
         DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
-        delete mpMarkObjOverlay;
-        mpMarkObjOverlay = nullptr;
+        mpMarkObjOverlay.reset();
     }
 }
 
@@ -413,9 +412,9 @@ bool SdrMarkView::BegMarkPoints(const Point& rPnt, bool bUnmark)
     {
         BrkAction();
 
-        DBG_ASSERT(nullptr == mpMarkPointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkPointsOverlay (!)");
+        DBG_ASSERT(!mpMarkPointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkPointsOverlay (!)");
         basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
-        mpMarkPointsOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+        mpMarkPointsOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
 
         maDragStat.Reset(rPnt);
         maDragStat.NextPoint();
@@ -466,8 +465,7 @@ void SdrMarkView::BrkMarkPoints()
     if(IsMarkPoints())
     {
         DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
-        delete mpMarkPointsOverlay;
-        mpMarkPointsOverlay = nullptr;
+        mpMarkPointsOverlay.reset();
     }
 }
 
@@ -478,10 +476,10 @@ bool SdrMarkView::BegMarkGluePoints(const Point& rPnt, bool bUnmark)
     {
         BrkAction();
 
-        DBG_ASSERT(nullptr == mpMarkGluePointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkGluePointsOverlay (!)");
+        DBG_ASSERT(!mpMarkGluePointsOverlay, "SdrMarkView::BegMarkObj: There exists a mpMarkGluePointsOverlay (!)");
 
         basegfx::B2DPoint aStartPos(rPnt.X(), rPnt.Y());
-        mpMarkGluePointsOverlay = new ImplMarkingOverlay(*this, aStartPos, bUnmark);
+        mpMarkGluePointsOverlay.reset(new ImplMarkingOverlay(*this, aStartPos, bUnmark));
         maDragStat.Reset(rPnt);
         maDragStat.NextPoint();
         maDragStat.SetMinMove(mnMinMovLog);
@@ -525,8 +523,7 @@ void SdrMarkView::BrkMarkGluePoints()
     if(IsMarkGluePoints())
     {
         DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no ImplPageOriginOverlay (!)");
-        delete mpMarkGluePointsOverlay;
-        mpMarkGluePointsOverlay = nullptr;
+        mpMarkGluePointsOverlay.reset();
     }
 }
 
commit ccdfe1982316c0b0cfc80e5da5612239537daafa
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 12:50:14 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:20 2020 +0200

    basegfx: test of coordinate system conversion
    
    Change-Id: I059d1f272f0633c450287f272083bb09732357b0

diff --git a/basegfx/test/B2DHomMatrixTest.cxx b/basegfx/test/B2DHomMatrixTest.cxx
index 8063587ac2dd..e5b923e6dd82 100644
--- a/basegfx/test/B2DHomMatrixTest.cxx
+++ b/basegfx/test/B2DHomMatrixTest.cxx
@@ -503,6 +503,36 @@ public:
         CPPUNIT_ASSERT_DOUBLES_EQUAL(26, aRange.getMaxY(), 1E-12);
     }
 
+    void testCoordinateSystemConversion()
+    {
+        // Use case when we convert
+
+        B2DRange aWindow(50, 50, 150, 150);
+
+        B2DRange aSubPage(0, 0, 2000, 2000);
+
+        B2DHomMatrix aB2DMatrix;
+        aB2DMatrix.scale(aWindow.getWidth() / aSubPage.getWidth(),
+                         aWindow.getHeight() / aSubPage.getHeight());
+        aB2DMatrix.translate(aWindow.getMinX(), aWindow.getMinY());
+
+        B2DPoint aPoint1(0, 0);
+        aPoint1 *= aB2DMatrix;
+
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(50, aPoint1.getX(), 1E-12);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(50, aPoint1.getY(), 1E-12);
+
+        B2DPoint aPoint2(1000, 1000);
+        aPoint2 *= aB2DMatrix;
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(100, aPoint2.getX(), 1E-12);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(100, aPoint2.getY(), 1E-12);
+
+        B2DPoint aPoint3(2000, 2000);
+        aPoint3 *= aB2DMatrix;
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(150, aPoint3.getX(), 1E-12);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(150, aPoint3.getY(), 1E-12);
+    }
+
     // Change the following lines only, if you add, remove or rename
     // member functions of the current class,
     // because these macros are need by auto register mechanism.
@@ -520,6 +550,8 @@ public:
     CPPUNIT_TEST(testMultiplyWithAnotherMatrix);
     CPPUNIT_TEST(testTransformPoint);
     CPPUNIT_TEST(testTransformRange);
+    CPPUNIT_TEST(testCoordinateSystemConversion);
+
     CPPUNIT_TEST_SUITE_END();
 
 }; // class b2dhommatrix
commit 06aa0ab4f02dae79323022e16ac3f8a30773779c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 12:49:05 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:19 2020 +0200

    add o3tl version of hash_combine to not depend on boost for this
    
    Change-Id: I081f8d116ef811baa8aa5de35a6cb51fa4de7d56

diff --git a/include/o3tl/hash_combine.hxx b/include/o3tl/hash_combine.hxx
new file mode 100644
index 000000000000..17419b3e2c0f
--- /dev/null
+++ b/include/o3tl/hash_combine.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+namespace o3tl
+{
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 4), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+    static_assert(sizeof(nSeed) == 4);
+    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B9u + (nSeed << 6) + (nSeed >> 2);
+}
+
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 8), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+    static_assert(sizeof(nSeed) == 8);
+    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index a03a6bf37200..3ab285c4329a 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -15,7 +15,7 @@
 
 #include <o3tl/lru_map.hxx>
 
-#include <boost/functional/hash.hpp>
+#include <o3tl/hash_combine.hxx>
 
 using namespace ::o3tl;
 
@@ -206,8 +206,8 @@ struct TestClassKeyHashFunction
     std::size_t operator()(TestClassKey const& aKey) const
     {
         std::size_t seed = 0;
-        boost::hash_combine(seed, aKey.mA);
-        boost::hash_combine(seed, aKey.mB);
+        o3tl::hash_combine(seed, aKey.mA);
+        o3tl::hash_combine(seed, aKey.mB);
         return seed;
     }
 };
commit 68d6477bc158a6a778afb15e769fecf208c8d88e
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 15:57:38 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:19 2020 +0200

    GraphicAttributes: put const. and op. '=' into the header file
    
    Change-Id: I1bc38f89457c3593673b445e7571a4fd82d5960b

diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 90364e408fee..ad2093875f72 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -53,9 +53,37 @@ private:
     GraphicDrawMode meDrawMode;
 
 public:
-    GraphicAttr();
+    GraphicAttr()
+        : mfGamma(1.0)
+        , mnMirrFlags(basegfx::MirrorDirectionFlags::NONE)
+        , mnLeftCrop(0)
+        , mnTopCrop(0)
+        , mnRightCrop(0)
+        , mnBottomCrop(0)
+        , mnRotate10(0)
+        , mnContPercent(0)
+        , mnLumPercent(0)
+        , mnRPercent(0)
+        , mnGPercent(0)
+        , mnBPercent(0)
+        , mbInvert(false)
+        , mcTransparency(0)
+        , meDrawMode(GraphicDrawMode::Standard)
+    {
+    }
+
+    bool operator==(const GraphicAttr& rAttr) const
+    {
+        return mfGamma == rAttr.mfGamma && mnMirrFlags == rAttr.mnMirrFlags
+               && mnLeftCrop == rAttr.mnLeftCrop && mnTopCrop == rAttr.mnTopCrop
+               && mnRightCrop == rAttr.mnRightCrop && mnBottomCrop == rAttr.mnBottomCrop
+               && mnRotate10 == rAttr.mnRotate10 && mnContPercent == rAttr.mnContPercent
+               && mnLumPercent == rAttr.mnLumPercent && mnRPercent == rAttr.mnRPercent
+               && mnGPercent == rAttr.mnGPercent && mnBPercent == rAttr.mnBPercent
+               && mbInvert == rAttr.mbInvert && mcTransparency == rAttr.mcTransparency
+               && meDrawMode == rAttr.meDrawMode;
+    }
 
-    bool operator==(const GraphicAttr& rAttr) const;
     bool operator!=(const GraphicAttr& rAttr) const { return !(*this == rAttr); }
 
     void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 1e7121a4487a..b1422157df0e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -324,7 +324,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/graphic/GraphicObject \
     vcl/source/graphic/GraphicObject2 \
     vcl/source/graphic/GraphicReader \
-    vcl/source/graphic/grfattr \
     vcl/source/graphic/Manager \
     vcl/source/graphic/UnoGraphic \
     vcl/source/graphic/UnoGraphicDescriptor \
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
deleted file mode 100644
index 36e8605b77de..000000000000
--- a/vcl/source/graphic/grfattr.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <vcl/GraphicAttributes.hxx>
-
-GraphicAttr::GraphicAttr() :
-    mfGamma         ( 1.0 ),
-    mnMirrFlags     ( basegfx::MirrorDirectionFlags::NONE ),
-    mnLeftCrop      ( 0 ),
-    mnTopCrop       ( 0 ),
-    mnRightCrop     ( 0 ),
-    mnBottomCrop    ( 0 ),
-    mnRotate10      ( 0 ),
-    mnContPercent   ( 0 ),
-    mnLumPercent    ( 0 ),
-    mnRPercent      ( 0 ),
-    mnGPercent      ( 0 ),
-    mnBPercent      ( 0 ),
-    mbInvert        ( false ),
-    mcTransparency  ( 0 ),
-    meDrawMode      ( GraphicDrawMode::Standard )
-{
-}
-
-bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
-{
-    return( ( mfGamma == rAttr.mfGamma ) &&
-            ( mnMirrFlags == rAttr.mnMirrFlags ) &&
-            ( mnLeftCrop == rAttr.mnLeftCrop ) &&
-            ( mnTopCrop == rAttr.mnTopCrop ) &&
-            ( mnRightCrop == rAttr.mnRightCrop ) &&
-            ( mnBottomCrop == rAttr.mnBottomCrop ) &&
-            ( mnRotate10 == rAttr.mnRotate10 ) &&
-            ( mnContPercent == rAttr.mnContPercent ) &&
-            ( mnLumPercent == rAttr.mnLumPercent ) &&
-            ( mnRPercent == rAttr.mnRPercent ) &&
-            ( mnGPercent == rAttr.mnGPercent ) &&
-            ( mnBPercent == rAttr.mnBPercent ) &&
-            ( mbInvert == rAttr.mbInvert ) &&
-            ( mcTransparency == rAttr.mcTransparency ) &&
-            ( meDrawMode == rAttr.meDrawMode ) );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7489ef7272fbf42c807ffa801397105f1a76bb7e
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 13:39:45 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:19 2020 +0200

    basegfx::MirrorDirectionFlags as replacement for BmpMirrorFlags
    
    BmpMirrorFlags in Bitmap is an attribute for bitmap manipulation
    (mirroring). This change creates a copy of the flags in basegfx
    as MirrorDirectionFlags, which will be used in the fututre as a
    general repalcement for the BmpMirrorFlags, that will be changed
    step by step.
    
    For now we only use the flags in GraphicAttr to make it independent
    form vcl, and cast to/from BmpMirrorFLags and MirrorDirectionFlags
    where needed.
    
    Change-Id: I01a69a4d241caa22cff61bdbf87944af57684749

diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index f86b1585b13f..2f571ed66aa3 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -49,8 +49,10 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
     if (getGraphicAttr().IsMirrored())
     {
         // content needs mirroring
-        const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Horizontal);
-        const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Vertical);
+        const bool bHMirr(getGraphicAttr().GetMirrorFlags()
+                          & basegfx::MirrorDirectionFlags::Horizontal);
+        const bool bVMirr(getGraphicAttr().GetMirrorFlags()
+                          & basegfx::MirrorDirectionFlags::Vertical);
 
         // mirror by applying negative scale to the unit primitive and
         // applying the object transformation on it.
@@ -69,7 +71,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
 
     aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
     aSuppressGraphicAttr.SetRotation(0);
-    aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
+    aSuppressGraphicAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags::NONE);
     aSuppressGraphicAttr.SetTransparency(0);
 
     const GraphicObject& rGraphicObject = getGraphicObject();
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 443d533ecadb..0df153611c67 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1674,7 +1674,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
 
                 if(bMirrored)
                 {
-                    pGraphicAttr->SetMirrorFlags(BmpMirrorFlags::Horizontal);
+                    pGraphicAttr->SetMirrorFlags(basegfx::MirrorDirectionFlags::Horizontal);
                 }
 
                 if(nTransparency)
diff --git a/include/basegfx/bitmap/BitmapAttributes.hxx b/include/basegfx/bitmap/BitmapAttributes.hxx
new file mode 100644
index 000000000000..d918d55faa99
--- /dev/null
+++ b/include/basegfx/bitmap/BitmapAttributes.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <basegfx/basegfxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+
+namespace basegfx
+{
+enum class MirrorDirectionFlags
+{
+    NONE = 0x00,
+    Horizontal = 0x01,
+    Vertical = 0x02,
+};
+
+} // end of namespace basegfx
+
+namespace o3tl
+{
+template <>
+struct typed_flags<basegfx::MirrorDirectionFlags>
+    : is_typed_flags<basegfx::MirrorDirectionFlags, 0x03>
+{
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 0908a8f56b9d..90364e408fee 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -19,10 +19,11 @@
 
 #pragma once
 
-#include <memory>
 #include <vcl/dllapi.h>
+
+#include <memory>
 #include <o3tl/typed_flags_set.hxx>
-#include <vcl/bitmap.hxx>
+#include <basegfx/bitmap/BitmapAttributes.hxx>
 
 enum class GraphicDrawMode
 {
@@ -36,7 +37,7 @@ class VCL_DLLPUBLIC GraphicAttr
 {
 private:
     double mfGamma;
-    BmpMirrorFlags mnMirrFlags;
+    basegfx::MirrorDirectionFlags mnMirrFlags;
     long mnLeftCrop;
     long mnTopCrop;
     long mnRightCrop;
@@ -60,8 +61,8 @@ public:
     void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
     GraphicDrawMode GetDrawMode() const { return meDrawMode; }
 
-    void SetMirrorFlags(BmpMirrorFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
-    BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
+    void SetMirrorFlags(basegfx::MirrorDirectionFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
+    basegfx::MirrorDirectionFlags GetMirrorFlags() const { return mnMirrFlags; }
 
     void SetCrop(long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM,
                  long nBottom_100TH_MM)
@@ -104,7 +105,7 @@ public:
     sal_uInt8 GetTransparency() const { return mcTransparency; }
 
     bool IsSpecialDrawMode() const { return (meDrawMode != GraphicDrawMode::Standard); }
-    bool IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
+    bool IsMirrored() const { return mnMirrFlags != basegfx::MirrorDirectionFlags::NONE; }
     bool IsCropped() const
     {
         return (mnLeftCrop != 0 || mnTopCrop != 0 || mnRightCrop != 0 || mnBottomCrop != 0);
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 8fceef864ae2..db24da9a5552 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -336,7 +336,9 @@ namespace sdr::contact
 
             if(bHMirr || bVMirr)
             {
-                aLocalGrafInfo.SetMirrorFlags((bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE)|(bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE));
+                basegfx::MirrorDirectionFlags eVertical = bVMirr ? basegfx::MirrorDirectionFlags::Vertical : basegfx::MirrorDirectionFlags::NONE;
+                basegfx::MirrorDirectionFlags eHorizontal = bHMirr ? basegfx::MirrorDirectionFlags::Horizontal : basegfx::MirrorDirectionFlags::NONE;
+                aLocalGrafInfo.SetMirrorFlags(eVertical | eHorizontal);
             }
 
             // fill object matrix
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index be60f5697ca1..59eb4b7b2289 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -378,7 +378,10 @@ GraphicAttr SdrGrafObj::GetGraphicAttr( SdrGrafObjTransformsAttrs nTransformFlag
             bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
             bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
 
-            aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
+            basegfx::MirrorDirectionFlags eVertical = bVMirr ? basegfx::MirrorDirectionFlags::Vertical : basegfx::MirrorDirectionFlags::NONE;
+            basegfx::MirrorDirectionFlags eHorizontal = bHMirr ? basegfx::MirrorDirectionFlags::Horizontal : basegfx::MirrorDirectionFlags::NONE;
+
+            aActAttr.SetMirrorFlags(eVertical | eHorizontal);
         }
 
         if( bRotate )
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index bb39141cc49a..58a7fde52200 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -727,22 +727,22 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
     rGA.SetDrawMode( rSet.GetDrawModeGrf().GetValue() );
 
     const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
-    BmpMirrorFlags nMirror = BmpMirrorFlags::NONE;
+    basegfx::MirrorDirectionFlags nMirror = basegfx::MirrorDirectionFlags::NONE;
     if( rMirror.IsGrfToggle() && pFrame && !pFrame->FindPageFrame()->OnRightPage() )
     {
         switch( rMirror.GetValue() )
         {
         case MirrorGraph::Dont:
-            nMirror = BmpMirrorFlags::Horizontal;
+            nMirror = basegfx::MirrorDirectionFlags::Horizontal;
             break;
         case MirrorGraph::Vertical:
-            nMirror = BmpMirrorFlags::NONE;
+            nMirror = basegfx::MirrorDirectionFlags::NONE;
             break;
         case MirrorGraph::Horizontal:
-            nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
+            nMirror = basegfx::MirrorDirectionFlags::Horizontal | basegfx::MirrorDirectionFlags::Vertical;
             break;
         default:
-            nMirror = BmpMirrorFlags::Vertical;
+            nMirror = basegfx::MirrorDirectionFlags::Vertical;
             break;
         }
     }
@@ -750,13 +750,13 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
         switch( rMirror.GetValue() )
         {
         case MirrorGraph::Both:
-            nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
+            nMirror = basegfx::MirrorDirectionFlags::Horizontal | basegfx::MirrorDirectionFlags::Vertical;
             break;
         case MirrorGraph::Vertical:
-            nMirror = BmpMirrorFlags::Horizontal;
+            nMirror = basegfx::MirrorDirectionFlags::Horizontal;
             break;
         case MirrorGraph::Horizontal:
-            nMirror = BmpMirrorFlags::Vertical;
+            nMirror = basegfx::MirrorDirectionFlags::Vertical;
             break;
         default: break;
         }
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index 377945ef2e32..092b8d1cca8d 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -168,7 +168,7 @@ void lclImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, GraphicAdjustmen
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
     {
-        rBmpEx.Mirror( aAttr.GetMirrorFlags() );
+        rBmpEx.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()) );
     }
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -219,7 +219,7 @@ void lclImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, GraphicAdjustme
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
     {
-        rMtf.Mirror( aAttr.GetMirrorFlags() );
+        rMtf.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()));
     }
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -270,7 +270,7 @@ void lclImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, GraphicAdju
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
     {
-        rAnimation.Mirror( aAttr.GetMirrorFlags() );
+        rAnimation.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()));
     }
 
     if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -383,7 +383,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
         if( !aSize100.IsEmpty() && nTotalWidth > 0 && nTotalHeight > 0 )
         {
             double fScale = static_cast<double>(aSize100.Width()) / nTotalWidth;
-            const long nNewLeft = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Horizontal ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
+            const long nNewLeft = -FRound( ( ( BmpMirrorFlags(pAttr->GetMirrorFlags()) & BmpMirrorFlags::Horizontal ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
             const long nNewRight = nNewLeft + FRound( aSize100.Width() * fScale ) - 1;
 
             fScale = static_cast<double>(rSz.Width()) / aSize100.Width();
@@ -391,7 +391,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
             rSz.setWidth( FRound( ( nNewRight - nNewLeft + 1 ) * fScale ) );
 
             fScale = static_cast<double>(aSize100.Height()) / nTotalHeight;
-            const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
+            const long nNewTop = -FRound( ( ( BmpMirrorFlags(pAttr->GetMirrorFlags()) & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
             const long nNewBottom = nNewTop + FRound( aSize100.Height() * fScale ) - 1;
 
             fScale = static_cast<double>(rSz.Height()) / aSize100.Height();
@@ -476,7 +476,8 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
     {
         aPt.AdjustX(aSz.Width() + 1 );
         aSz.setWidth( -aSz.Width() );
-        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Horizontal );
+        BmpMirrorFlags eFlags = BmpMirrorFlags(aAttr.GetMirrorFlags()) ^ BmpMirrorFlags::Horizontal;
+        aAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags(eFlags));
     }
 
     // mirrored vertically
@@ -484,7 +485,8 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
     {
         aPt.AdjustY(aSz.Height() + 1 );
         aSz.setHeight( -aSz.Height() );
-        aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Vertical );
+        BmpMirrorFlags eFlags = BmpMirrorFlags(aAttr.GetMirrorFlags()) ^ BmpMirrorFlags::Vertical;
+        aAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags(eFlags));
     }
 
     if( bCropped )
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
index 35acaf50b841..36e8605b77de 100644
--- a/vcl/source/graphic/grfattr.cxx
+++ b/vcl/source/graphic/grfattr.cxx
@@ -21,7 +21,7 @@
 
 GraphicAttr::GraphicAttr() :
     mfGamma         ( 1.0 ),
-    mnMirrFlags     ( BmpMirrorFlags::NONE ),
+    mnMirrFlags     ( basegfx::MirrorDirectionFlags::NONE ),
     mnLeftCrop      ( 0 ),
     mnTopCrop       ( 0 ),
     mnRightCrop     ( 0 ),
commit 4a1a263e3f87151099d0bd7dd927ba39153c2cdc
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon May 25 21:58:01 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:18 2020 +0200

    vcl: move GraphicAttr into its own header file
    
    Change-Id: I8a730414e712a1484ffcca427ed4b1599d223f8c

diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
new file mode 100644
index 000000000000..0908a8f56b9d
--- /dev/null
+++ b/include/vcl/GraphicAttributes.hxx
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <memory>
+#include <vcl/dllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+#include <vcl/bitmap.hxx>
+
+enum class GraphicDrawMode
+{
+    Standard = 0,
+    Greys = 1,
+    Mono = 2,
+    Watermark = 3
+};
+
+class VCL_DLLPUBLIC GraphicAttr
+{
+private:
+    double mfGamma;
+    BmpMirrorFlags mnMirrFlags;
+    long mnLeftCrop;
+    long mnTopCrop;
+    long mnRightCrop;
+    long mnBottomCrop;
+    sal_uInt16 mnRotate10;
+    short mnContPercent;
+    short mnLumPercent;
+    short mnRPercent;
+    short mnGPercent;
+    short mnBPercent;
+    bool mbInvert;
+    sal_uInt8 mcTransparency;
+    GraphicDrawMode meDrawMode;
+
+public:
+    GraphicAttr();
+
+    bool operator==(const GraphicAttr& rAttr) const;
+    bool operator!=(const GraphicAttr& rAttr) const { return !(*this == rAttr); }
+
+    void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
+    GraphicDrawMode GetDrawMode() const { return meDrawMode; }
+
+    void SetMirrorFlags(BmpMirrorFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
+    BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
+
+    void SetCrop(long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM,
+                 long nBottom_100TH_MM)
+    {
+        mnLeftCrop = nLeft_100TH_MM;
+        mnTopCrop = nTop_100TH_MM;
+        mnRightCrop = nRight_100TH_MM;
+        mnBottomCrop = nBottom_100TH_MM;
+    }
+    long GetLeftCrop() const { return mnLeftCrop; }
+    long GetTopCrop() const { return mnTopCrop; }
+    long GetRightCrop() const { return mnRightCrop; }
+    long GetBottomCrop() const { return mnBottomCrop; }
+
+    void SetRotation(sal_uInt16 nRotate10) { mnRotate10 = nRotate10; }
+    sal_uInt16 GetRotation() const { return mnRotate10; }
+
+    void SetLuminance(short nLuminancePercent) { mnLumPercent = nLuminancePercent; }
+    short GetLuminance() const { return mnLumPercent; }
+
+    void SetContrast(short nContrastPercent) { mnContPercent = nContrastPercent; }
+    short GetContrast() const { return mnContPercent; }
+
+    void SetChannelR(short nChannelRPercent) { mnRPercent = nChannelRPercent; }
+    short GetChannelR() const { return mnRPercent; }
+
+    void SetChannelG(short nChannelGPercent) { mnGPercent = nChannelGPercent; }
+    short GetChannelG() const { return mnGPercent; }
+
+    void SetChannelB(short nChannelBPercent) { mnBPercent = nChannelBPercent; }
+    short GetChannelB() const { return mnBPercent; }
+
+    void SetGamma(double fGamma) { mfGamma = fGamma; }
+    double GetGamma() const { return mfGamma; }
+
+    void SetInvert(bool bInvert) { mbInvert = bInvert; }
+    bool IsInvert() const { return mbInvert; }
+
+    void SetTransparency(sal_uInt8 cTransparency) { mcTransparency = cTransparency; }
+    sal_uInt8 GetTransparency() const { return mcTransparency; }
+
+    bool IsSpecialDrawMode() const { return (meDrawMode != GraphicDrawMode::Standard); }
+    bool IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
+    bool IsCropped() const
+    {
+        return (mnLeftCrop != 0 || mnTopCrop != 0 || mnRightCrop != 0 || mnBottomCrop != 0);
+    }
+    bool IsRotated() const { return ((mnRotate10 % 3600) != 0); }
+    bool IsTransparent() const { return (mcTransparency > 0); }
+    bool IsAdjusted() const
+    {
+        return (mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 || mnGPercent != 0
+                || mnBPercent != 0 || mfGamma != 1.0 || mbInvert);
+    }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx
index 92c01274a453..16735aac4b1f 100644
--- a/include/vcl/GraphicObject.hxx
+++ b/include/vcl/GraphicObject.hxx
@@ -24,6 +24,8 @@
 #include <vcl/dllapi.h>
 #include <o3tl/typed_flags_set.hxx>
 
+#include <vcl/GraphicAttributes.hxx>
+
 namespace com::sun::star::graphic { class XGraphic; }
 
 // Adjustment defines
@@ -42,104 +44,10 @@ namespace o3tl
     template<> struct typed_flags<GraphicAdjustmentFlags> : is_typed_flags<GraphicAdjustmentFlags, 0x1f> {};
 }
 
-enum class GraphicDrawMode
-{
-    Standard = 0,
-    Greys = 1,
-    Mono = 2,
-    Watermark = 3
-};
-
 class VirtualDevice;
 struct GrfSimpleCacheObj;
 struct ImplTileInfo;
 
-class VCL_DLLPUBLIC GraphicAttr
-{
-private:
-
-    double          mfGamma;
-    BmpMirrorFlags  mnMirrFlags;
-    long            mnLeftCrop;
-    long            mnTopCrop;
-    long            mnRightCrop;
-    long            mnBottomCrop;
-    sal_uInt16      mnRotate10;
-    short           mnContPercent;
-    short           mnLumPercent;
-    short           mnRPercent;
-    short           mnGPercent;
-    short           mnBPercent;
-    bool            mbInvert;
-    sal_uInt8       mcTransparency;
-    GraphicDrawMode meDrawMode;
-
-public:
-
-                    GraphicAttr();
-
-    bool            operator==( const GraphicAttr& rAttr ) const;
-    bool            operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); }
-
-    void            SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; }
-    GraphicDrawMode GetDrawMode() const { return meDrawMode; }
-
-    void            SetMirrorFlags( BmpMirrorFlags nMirrFlags ) { mnMirrFlags = nMirrFlags; }
-    BmpMirrorFlags  GetMirrorFlags() const { return mnMirrFlags; }
-
-    void            SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM )
-                    {
-                        mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM;
-                        mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM;
-                    }
-    long            GetLeftCrop() const { return mnLeftCrop; }
-    long            GetTopCrop() const { return mnTopCrop; }
-    long            GetRightCrop() const { return mnRightCrop; }
-    long            GetBottomCrop() const { return mnBottomCrop; }
-
-    void            SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; }
-    sal_uInt16      GetRotation() const { return mnRotate10; }
-
-    void            SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; }
-    short           GetLuminance() const { return mnLumPercent; }
-
-    void            SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; }
-    short           GetContrast() const { return mnContPercent; }
-
-    void            SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; }
-    short           GetChannelR() const { return mnRPercent; }
-
-    void            SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; }
-    short           GetChannelG() const { return mnGPercent; }
-
-    void            SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; }
-    short           GetChannelB() const { return mnBPercent; }
-
-    void            SetGamma( double fGamma ) { mfGamma = fGamma; }
-    double          GetGamma() const { return mfGamma; }
-
-    void            SetInvert( bool bInvert ) { mbInvert = bInvert; }
-    bool            IsInvert() const { return mbInvert; }
-
-    void            SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; }
-    sal_uInt8       GetTransparency() const { return mcTransparency; }
-
-    bool            IsSpecialDrawMode() const { return( meDrawMode != GraphicDrawMode::Standard ); }
-    bool            IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
-    bool            IsCropped() const
-                    {
-                        return( mnLeftCrop != 0 || mnTopCrop != 0 ||
-                                mnRightCrop != 0 || mnBottomCrop != 0 );
-                    }
-    bool            IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); }
-    bool            IsTransparent() const { return( mcTransparency > 0 ); }
-    bool            IsAdjusted() const
-                    {
-                        return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 ||
-                                mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert );
-                    }
-};
-
 class VCL_DLLPUBLIC GraphicObject
 {
     friend class SdrGrafObj;
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
index 88d0852afe60..35acaf50b841 100644
--- a/vcl/source/graphic/grfattr.cxx
+++ b/vcl/source/graphic/grfattr.cxx
@@ -17,9 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include <vcl/GraphicObject.hxx>
-
+#include <vcl/GraphicAttributes.hxx>
 
 GraphicAttr::GraphicAttr() :
     mfGamma         ( 1.0 ),
commit 8d0f6f71bf07bc60f55971902ff8cddbfcc76dfa
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon May 25 20:46:38 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:18 2020 +0200

    vcl: convert to use "pragma once" in GraphicObject.hxx
    
    Change-Id: I6fd1897574d831ef153adc0d385c6484f6c17d7a

diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx
index 5a4053fa6569..92c01274a453 100644
--- a/include/vcl/GraphicObject.hxx
+++ b/include/vcl/GraphicObject.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_GRAPHICOBJECT_HXX
-#define INCLUDED_VCL_GRAPHICOBJECT_HXX
+#pragma once
 
 #include <memory>
 #include <vcl/graph.hxx>
@@ -396,6 +395,4 @@ VCL_DLLPUBLIC void SearchForGraphics(css::uno::Reference<css::uno::XInterface> c
 }
 } // end namespace vcl::graphic
 
-#endif // INCLUDED_VCL_GRAPHICOBJECT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ac421a039d9ba36ab05a6ed847cab483eb12f5b2
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 23 11:54:01 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:17 2020 +0200

     vcl: add conversion point to twip int64 & double values
    
    Change-Id: Id54d28b57c055269259317521f59d37dcdf9a456

diff --git a/include/tools/UnitConversion.hxx b/include/tools/UnitConversion.hxx
index 2093db6181d9..2585fecbb590 100644
--- a/include/tools/UnitConversion.hxx
+++ b/include/tools/UnitConversion.hxx
@@ -20,11 +20,15 @@ constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
     return (n >= 0) ? (n * 72 + 63) / 127 : (n * 72 - 63) / 127;
 }
 
+constexpr sal_Int64 convertPointToTwip(sal_Int64 nNumber) { return nNumber * 20; }
+
 constexpr sal_Int64 convertPointToMm100(sal_Int64 nNumber)
 {
-    return convertTwipToMm100(nNumber * 20);
+    return convertTwipToMm100(convertPointToTwip(nNumber));
 }
 
+constexpr double convertPointToTwip(double fNumber) { return fNumber * 20.0; }
+
 constexpr double convertPointToMm100(double fNumber) { return fNumber * 35.27777777778; }
 
 // Convert PPT's "master unit" (1/576 inch) to twips
commit 04de7ff2e472bb9dc54840f5c3037f24511461bb
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu May 21 11:47:34 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:10:17 2020 +0200

    tools: extend test for UnitConversion
    
    Change-Id: I8fbc2a83f40fb04656f690b4b63d3cac9f0410c1

diff --git a/tools/qa/cppunit/test_100mm2twips.cxx b/tools/qa/cppunit/test_100mm2twips.cxx
index 80ceda2ffb3f..010a2aab684d 100644
--- a/tools/qa/cppunit/test_100mm2twips.cxx
+++ b/tools/qa/cppunit/test_100mm2twips.cxx
@@ -23,29 +23,39 @@
 #include <cppunit/extensions/HelperMacros.h>
 
 #include <tools/helpers.hxx>
+#include <tools/UnitConversion.hxx>
 
-namespace tools
-{
-class cm2TwipsTest : public CppUnit::TestFixture
+class UnitConversionTest : public CppUnit::TestFixture
 {
 public:
-    void testConvert()
+    void testSanitiseMm100ToTwip()
+    {
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(145), sanitiseMm100ToTwip(255));
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(-145), sanitiseMm100ToTwip(-255));
+    }
+
+    void testConvertMm100ToTwip()
+    {
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(145), convertMm100ToTwip(255));
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(-145), convertMm100ToTwip(-255));
+    }
+
+    void testConvertPointToMm100()
     {
-        sal_Int32 nActual = sanitiseMm100ToTwip(255);
-        sal_Int32 nExpected = 145;
-        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(double(599.72), convertPointToMm100(17.0), 1E-2);
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(600), convertPointToMm100(sal_Int64(17)));
 
-        nActual = sanitiseMm100ToTwip(-255);
-        nExpected = -145;
-        CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(double(22930.55), convertPointToMm100(650.0), 1E-2);
+        CPPUNIT_ASSERT_EQUAL(sal_Int64(22931), convertPointToMm100(sal_Int64(650)));
     }
 
-    CPPUNIT_TEST_SUITE(cm2TwipsTest);
-    CPPUNIT_TEST(testConvert);
+    CPPUNIT_TEST_SUITE(UnitConversionTest);
+    CPPUNIT_TEST(testSanitiseMm100ToTwip);
+    CPPUNIT_TEST(testConvertMm100ToTwip);
+    CPPUNIT_TEST(testConvertPointToMm100);
     CPPUNIT_TEST_SUITE_END();
 };
 
-CPPUNIT_TEST_SUITE_REGISTRATION(cm2TwipsTest);
-} // namespace tools
+CPPUNIT_TEST_SUITE_REGISTRATION(UnitConversionTest);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c56a41ae56b0bb6997a7655d889dcd9a8f53b35a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun May 17 20:32:49 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:33 2020 +0200

    vcl: VectorGraphicSearch return text rectangles in 100th mm
    
    Change-Id: I12e7ad10dc3ed68d20d94713acece1361da27e81

diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx
index 41c7745d0cf5..5420e161448b 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -15,6 +15,7 @@
 #include <vcl/dllapi.h>
 
 #include <basegfx/range/b2drectangle.hxx>
+#include <basegfx/vector/b2dsize.hxx>
 
 #include <memory>
 
@@ -34,6 +35,7 @@ public:
     VectorGraphicSearch(Graphic const& rGraphic);
     ~VectorGraphicSearch();
     bool search(OUString const& rSearchString);
+    basegfx::B2DSize pageSize();
     bool next();
     int index();
     std::vector<basegfx::B2DRectangle> getTextRectangles();
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 112748d23bbe..01022a3fe225 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -44,28 +44,41 @@ void VectorGraphicSearchTest::test()
     CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
     CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
     CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+    basegfx::B2DSize aSize = aSearch.pageSize();
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(21590.00, aSize.getX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(27940.00, aSize.getY(), 1E-2);
+
     auto aRectangles = aSearch.getTextRectangles();
     CPPUNIT_ASSERT_EQUAL(size_t(4), aRectangles.size());
 
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(229.00, aRectangles[0].getMinX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(231.85, aRectangles[0].getMaxX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(724.10, aRectangles[0].getMinY(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(732.42, aRectangles[0].getMaxY(), 1E-2);
-
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(232.47, aRectangles[1].getMinX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(237.22, aRectangles[1].getMaxX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(723.99, aRectangles[1].getMinY(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.72, aRectangles[1].getMaxY(), 1E-2);
-
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(237.68, aRectangles[2].getMinX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(242.35, aRectangles[2].getMaxX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(724.09, aRectangles[2].getMinY(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[2].getMaxY(), 1E-2);
-
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(242.81, aRectangles[3].getMinX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(248.61, aRectangles[3].getMaxX(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(721.51, aRectangles[3].getMinY(), 1E-2);
-    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[3].getMaxY(), 1E-2);
+    // Check first and last
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(8078.61, aRectangles[0].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(8179.36, aRectangles[0].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(2101.56, aRectangles[0].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(2395.36, aRectangles[0].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(8565.86, aRectangles[3].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(8770.76, aRectangles[3].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(2201.05, aRectangles[3].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(2486.37, aRectangles[3].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+    CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+
+    aRectangles = aSearch.getTextRectangles();
+    CPPUNIT_ASSERT_EQUAL(size_t(4), aRectangles.size());
+
+    // Check first and last
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(6562.23, aRectangles[0].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(6662.98, aRectangles[0].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(5996.23, aRectangles[0].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(6290.02, aRectangles[0].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(7049.48, aRectangles[3].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(7254.38, aRectangles[3].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(6095.71, aRectangles[3].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(6381.04, aRectangles[3].getMaxY(), 1E-2);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 8e90145cbecb..56c00efa172a 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -64,6 +64,21 @@ public:
             FPDF_ClosePage(mpPage);
     }
 
+    basegfx::B2DSize getPageSize()
+    {
+        basegfx::B2DSize aSize;
+        if (!mpPdfDocument)
+            return aSize;
+
+        FS_SIZEF aPDFSize;
+        if (FPDF_GetPageSizeByIndexF(mpPdfDocument, mnPageIndex, &aPDFSize))
+        {
+            aSize = basegfx::B2DSize(convertPointToMm100(aPDFSize.width),
+                                     convertPointToMm100(aPDFSize.height));
+        }
+        return aSize;
+    }
+
     bool initialize()
     {
         if (!mpPdfDocument)
@@ -117,6 +132,8 @@ public:
         if (nSize <= 0)
             return aRectangles;
 
+        double fPageHeight = getPageSize().getY();
+
         for (int nCount = 0; nCount < nSize; nCount++)
         {
             double left = 0.0;
@@ -126,6 +143,11 @@ public:
 
             if (FPDFText_GetCharBox(mpTextPage, nIndex + nCount, &left, &right, &bottom, &top))
             {
+                left = convertPointToMm100(left);
+                right = convertPointToMm100(right);
+                top = fPageHeight - convertPointToMm100(top);
+                bottom = fPageHeight - convertPointToMm100(bottom);
+
                 aRectangles.emplace_back(left, bottom, right, top);
             }
         }
@@ -207,6 +229,14 @@ bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& rD
     return mpSearchContext->initialize();
 }
 
+basegfx::B2DSize VectorGraphicSearch::pageSize()
+{
+    basegfx::B2DSize aSize;
+    if (mpSearchContext)
+        aSize = mpSearchContext->getPageSize();
+    return aSize;
+}
+
 bool VectorGraphicSearch::next()
 {
     if (mpSearchContext)
commit 33729a737609d0700e982064be7941420d9a9857
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun May 17 20:12:33 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:33 2020 +0200

    vcl: add conversion point to 100th mm for double values
    
    Integer conversion throws away percision, which is problematic
    when we work with floating point values.
    
    Change-Id: Ib34e46bd59aa67e933d49bc800e96cc6426414e5

diff --git a/include/tools/UnitConversion.hxx b/include/tools/UnitConversion.hxx
index e59077d8a5fa..2093db6181d9 100644
--- a/include/tools/UnitConversion.hxx
+++ b/include/tools/UnitConversion.hxx
@@ -15,13 +15,18 @@ constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
     return (n >= 0) ? (n * 127 + 36) / 72 : (n * 127 - 36) / 72;
 }
 
-constexpr sal_Int64 convertPointToMm100(sal_Int64 n) { return convertTwipToMm100(n * 20); }
-
 constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
 {
     return (n >= 0) ? (n * 72 + 63) / 127 : (n * 72 - 63) / 127;
 }
 
+constexpr sal_Int64 convertPointToMm100(sal_Int64 nNumber)
+{
+    return convertTwipToMm100(nNumber * 20);
+}
+
+constexpr double convertPointToMm100(double fNumber) { return fNumber * 35.27777777778; }
+
 // Convert PPT's "master unit" (1/576 inch) to twips
 constexpr sal_Int64 convertMasterUnitToTwip(sal_Int64 n) { return n * 2540.0 / 576.0; }
 
commit 1872d416c13c735f7d9bdf530f1c77fee486d0c2
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 16 19:45:41 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:32 2020 +0200

    vcl: VectorGraphicSearch - add search result selection rectangles
    
    Change-Id: Ia0c5610f600719bcfb5de503f3876fc896cb630a

diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx
index 6c2589db1d01..41c7745d0cf5 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -14,6 +14,8 @@
 #include <vcl/vectorgraphicdata.hxx>
 #include <vcl/dllapi.h>
 
+#include <basegfx/range/b2drectangle.hxx>
+
 #include <memory>
 
 class SearchContext;
@@ -34,6 +36,7 @@ public:
     bool search(OUString const& rSearchString);
     bool next();
     int index();
+    std::vector<basegfx::B2DRectangle> getTextRectangles();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 0ed21ccf9e26..112748d23bbe 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -9,6 +9,7 @@
 
 #include <cppunit/TestAssert.h>
 #include <cppunit/extensions/HelperMacros.h>
+
 #include <unotest/bootstrapfixturebase.hxx>
 #include <unotest/directories.hxx>
 
@@ -43,6 +44,28 @@ void VectorGraphicSearchTest::test()
     CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
     CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
     CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+    auto aRectangles = aSearch.getTextRectangles();
+    CPPUNIT_ASSERT_EQUAL(size_t(4), aRectangles.size());
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(229.00, aRectangles[0].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(231.85, aRectangles[0].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(724.10, aRectangles[0].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(732.42, aRectangles[0].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(232.47, aRectangles[1].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(237.22, aRectangles[1].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(723.99, aRectangles[1].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.72, aRectangles[1].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(237.68, aRectangles[2].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(242.35, aRectangles[2].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(724.09, aRectangles[2].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[2].getMaxY(), 1E-2);
+
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(242.81, aRectangles[3].getMinX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(248.61, aRectangles[3].getMaxX(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(721.51, aRectangles[3].getMinY(), 1E-2);
+    CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[3].getMaxY(), 1E-2);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 34ac0abd6654..8e90145cbecb 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -8,9 +8,10 @@
  *
  */
 
-#include <sal/config.h>
 #include <vcl/VectorGraphicSearch.hxx>
 
+#include <sal/config.h>
+
 #include <fpdf_doc.h>
 #include <fpdf_text.h>
 
@@ -93,6 +94,44 @@ public:
             return FPDFText_GetSchResultIndex(mpSearchHandle);
         return -1;
     }
+
+    int size()
+    {
+        if (mpSearchHandle)
+            return FPDFText_GetSchCount(mpSearchHandle);
+        return -1;
+    }
+
+    std::vector<basegfx::B2DRectangle> getTextRectangles()
+    {
+        std::vector<basegfx::B2DRectangle> aRectangles;
+
+        if (!mpTextPage || !mpSearchHandle)
+            return aRectangles;
+
+        int nIndex = index();
+        if (nIndex < 0)
+            return aRectangles;
+
+        int nSize = size();
+        if (nSize <= 0)
+            return aRectangles;
+
+        for (int nCount = 0; nCount < nSize; nCount++)
+        {
+            double left = 0.0;
+            double right = 0.0;
+            double bottom = 0.0;
+            double top = 0.0;
+
+            if (FPDFText_GetCharBox(mpTextPage, nIndex + nCount, &left, &right, &bottom, &top))
+            {
+                aRectangles.emplace_back(left, bottom, right, top);
+            }
+        }
+
+        return aRectangles;
+    }
 };
 
 VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
@@ -182,4 +221,12 @@ int VectorGraphicSearch::index()
     return -1;
 }
 
+std::vector<basegfx::B2DRectangle> VectorGraphicSearch::getTextRectangles()
+{
+    if (mpSearchContext)
+        return mpSearchContext->getTextRectangles();
+
+    return std::vector<basegfx::B2DRectangle>();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d99bd304510fa4ab4635fee5e4ca469384e4b728
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 15 12:20:42 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:32 2020 +0200

    vcl: Add internal "Implementation" class for VectorGraphicSearch
    
    We need to hide includes (needed for members) of PDFium inside
    from the outside, so not everyone using the VectorGraphicSearch
    needs to depend on PDFium too.
    
    Change-Id: I95e46c714758b130594d78a4618af7350e29a075

diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx
index 3411d0a931e6..6c2589db1d01 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -14,8 +14,6 @@
 #include <vcl/vectorgraphicdata.hxx>
 #include <vcl/dllapi.h>
 
-#include <fpdf_doc.h>
-
 #include <memory>
 
 class SearchContext;
@@ -23,9 +21,11 @@ class SearchContext;
 class VCL_DLLPUBLIC VectorGraphicSearch final
 {
 private:
+    class Implementation;
+    std::unique_ptr<Implementation> mpImplementation;
     Graphic maGraphic;
-    FPDF_DOCUMENT mpPdfDocument;
     std::unique_ptr<SearchContext> mpSearchContext;
+
     bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString);
 
 public:
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 864c65f2dda2..34ac0abd6654 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -11,8 +11,26 @@
 #include <sal/config.h>
 #include <vcl/VectorGraphicSearch.hxx>
 
+#include <fpdf_doc.h>
 #include <fpdf_text.h>
 
+class VectorGraphicSearch::Implementation
+{
+public:
+    FPDF_DOCUMENT mpPdfDocument;
+
+    Implementation()
+        : mpPdfDocument(nullptr)
+    {
+    }
+
+    ~Implementation()
+    {
+        if (mpPdfDocument)
+            FPDF_CloseDocument(mpPdfDocument);
+    }
+};
+
 class SearchContext
 {
 public:
@@ -78,8 +96,8 @@ public:
 };
 
 VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
-    : maGraphic(rGraphic)
-    , mpPdfDocument(nullptr)
+    : mpImplementation(std::make_unique<VectorGraphicSearch::Implementation>())
+    , maGraphic(rGraphic)
 {
     FPDF_LIBRARY_CONFIG aConfig;
     aConfig.version = 2;
@@ -92,9 +110,7 @@ VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
 VectorGraphicSearch::~VectorGraphicSearch()
 {
     mpSearchContext.reset();
-
-    if (mpPdfDocument)
-        FPDF_CloseDocument(mpPdfDocument);
+    mpImplementation.reset();
     FPDF_DestroyLibrary();
 }
 
@@ -115,11 +131,11 @@ bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& rD
     if (rSearchString.isEmpty())
         return false;
 
-    mpPdfDocument
+    mpImplementation->mpPdfDocument
         = FPDF_LoadMemDocument(rData->getVectorGraphicDataArray().getConstArray(),
                                rData->getVectorGraphicDataArrayLength(), /*password=*/nullptr);
 
-    if (!mpPdfDocument)
+    if (!mpImplementation->mpPdfDocument)
     {
         //TODO: Handle failure to load.
         switch (FPDF_GetLastError())
@@ -146,7 +162,8 @@ bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& rD
 
     sal_Int32 nPageIndex = std::max(rData->getPageIndex(), 0);
 
-    mpSearchContext.reset(new SearchContext(mpPdfDocument, nPageIndex, rSearchString));
+    mpSearchContext.reset(
+        new SearchContext(mpImplementation->mpPdfDocument, nPageIndex, rSearchString));
 
     return mpSearchContext->initialize();
 }
commit 2c37faa6cb865e7621d98d0d6634c1344c320c1f
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 22:28:35 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:32 2020 +0200

    Move some basic primitives to drawinglayer CORE
    
    Mostly which are easy to move and used in VclProcessor2D
    
    Change-Id: Ie1559e13a2a7cdb5225421def2f9145026ff9121

diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 814fff713ae1..a9d70da2aa84 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -50,11 +50,6 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\
 $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/animation/animationtiming \
     drawinglayer/source/attribute/fillgraphicattribute \
-    drawinglayer/source/attribute/fillgradientattribute \
-    drawinglayer/source/attribute/fillhatchattribute \
-    drawinglayer/source/attribute/fontattribute \
-    drawinglayer/source/attribute/lineattribute \
-    drawinglayer/source/attribute/linestartendattribute \
     drawinglayer/source/attribute/materialattribute3d \
     drawinglayer/source/attribute/sdrallattribute3d \
     drawinglayer/source/attribute/sdrfillattribute \
@@ -67,11 +62,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/attribute/sdrobjectattribute3d \
     drawinglayer/source/attribute/sdrsceneattribute3d \
     drawinglayer/source/attribute/sdrshadowattribute \
-    drawinglayer/source/attribute/strokeattribute \
     drawinglayer/source/geometry/viewinformation3d \
     drawinglayer/source/primitive2d/animatedprimitive2d \
     drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
-    drawinglayer/source/primitive2d/bitmapprimitive2d \
     drawinglayer/source/primitive2d/borderlineprimitive2d \
     drawinglayer/source/primitive2d/controlprimitive2d \
     drawinglayer/source/primitive2d/cropprimitive2d \
@@ -80,54 +73,32 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/primitive2d/embedded3dprimitive2d \
     drawinglayer/source/primitive2d/epsprimitive2d \
     drawinglayer/source/primitive2d/fillgraphicprimitive2d \
-    drawinglayer/source/primitive2d/fillgradientprimitive2d \
-    drawinglayer/source/primitive2d/fillhatchprimitive2d \
     drawinglayer/source/primitive2d/glowprimitive2d \
     drawinglayer/source/primitive2d/graphicprimitivehelper2d \
     drawinglayer/source/primitive2d/graphicprimitive2d \
     drawinglayer/source/primitive2d/gridprimitive2d \
-    drawinglayer/source/primitive2d/groupprimitive2d \
     drawinglayer/source/primitive2d/helplineprimitive2d \
     drawinglayer/source/primitive2d/hiddengeometryprimitive2d \
     drawinglayer/source/primitive2d/invertprimitive2d \
     drawinglayer/source/primitive2d/markerarrayprimitive2d \
-    drawinglayer/source/primitive2d/maskprimitive2d \
     drawinglayer/source/primitive2d/mediaprimitive2d \
     drawinglayer/source/primitive2d/metafileprimitive2d \
-    drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
-    drawinglayer/source/primitive2d/objectinfoprimitive2d \
     drawinglayer/source/primitive2d/pagehierarchyprimitive2d \
-    drawinglayer/source/primitive2d/pagepreviewprimitive2d \
     drawinglayer/source/primitive2d/patternfillprimitive2d \
-    drawinglayer/source/primitive2d/pointarrayprimitive2d \
-    drawinglayer/source/primitive2d/polygonprimitive2d \
-    drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
     drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
-    drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
-    drawinglayer/source/primitive2d/primitivetools2d \
     drawinglayer/source/primitive2d/sceneprimitive2d \
     drawinglayer/source/primitive2d/sdrdecompositiontools2d \
     drawinglayer/source/primitive2d/shadowprimitive2d \
     drawinglayer/source/primitive2d/softedgeprimitive2d \
     drawinglayer/source/primitive2d/structuretagprimitive2d \
-    drawinglayer/source/primitive2d/svggradientprimitive2d \
     drawinglayer/source/primitive2d/textbreakuphelper \
     drawinglayer/source/primitive2d/textdecoratedprimitive2d \
     drawinglayer/source/primitive2d/texteffectprimitive2d \
-    drawinglayer/source/primitive2d/textenumsprimitive2d \
     drawinglayer/source/primitive2d/texthierarchyprimitive2d \
     drawinglayer/source/primitive2d/textlayoutdevice \
     drawinglayer/source/primitive2d/textlineprimitive2d \
     drawinglayer/source/primitive2d/textprimitive2d \
     drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
-    drawinglayer/source/primitive2d/transformprimitive2d \
-    drawinglayer/source/primitive2d/transparenceprimitive2d \
-    drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
     drawinglayer/source/primitive2d/wallpaperprimitive2d \
     drawinglayer/source/primitive2d/wrongspellprimitive2d \
     drawinglayer/source/primitive3d/baseprimitive3d \
@@ -186,7 +157,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/tools/primitive2dxmldump \
     drawinglayer/source/drawinglayeruno/drawinglayeruno \
     drawinglayer/source/drawinglayeruno/xprimitive2drenderer \
-    drawinglayer/source/texture/texture \
     drawinglayer/source/dumper/XShapeDumper \
     drawinglayer/source/dumper/EnhancedShapeDumper \
 ))
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
index f1643d27014d..972ac32f5388 100644
--- a/drawinglayer/Library_drawinglayercore.mk
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -40,10 +40,47 @@ $(eval $(call gb_Library_use_libraries,drawinglayercore,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+    drawinglayer/source/attribute/lineattribute \
+    drawinglayer/source/attribute/strokeattribute \
+    drawinglayer/source/attribute/linestartendattribute \
+    drawinglayer/source/attribute/fillgradientattribute \
+    drawinglayer/source/attribute/fillhatchattribute \
+    drawinglayer/source/attribute/fontattribute \
+    drawinglayer/source/geometry/viewinformation2d \
+    drawinglayer/source/texture/texture \
     drawinglayer/source/primitive2d/baseprimitive2d \
     drawinglayer/source/primitive2d/Primitive2DContainer \
     drawinglayer/source/primitive2d/Tools \
-    drawinglayer/source/geometry/viewinformation2d \
+    drawinglayer/source/primitive2d/polygonprimitive2d \
+    drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
+    drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
+    drawinglayer/source/primitive2d/fillgradientprimitive2d \
+    drawinglayer/source/primitive2d/maskprimitive2d \
+    drawinglayer/source/primitive2d/groupprimitive2d \
+    drawinglayer/source/primitive2d/fillhatchprimitive2d \
+    drawinglayer/source/primitive2d/primitivetools2d \
+    drawinglayer/source/primitive2d/pointarrayprimitive2d \
+    drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
+    drawinglayer/source/primitive2d/bitmapprimitive2d \
+    drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
+    drawinglayer/source/primitive2d/transparenceprimitive2d \
+    drawinglayer/source/primitive2d/pagepreviewprimitive2d \
+    drawinglayer/source/primitive2d/transformprimitive2d \
+    drawinglayer/source/primitive2d/svggradientprimitive2d \
+    drawinglayer/source/primitive2d/objectinfoprimitive2d \
+    drawinglayer/source/primitive2d/textenumsprimitive2d \
 ))
 
+#    drawinglayer/source/primitive2d/epsprimitive2d \
+#    drawinglayer/source/primitive2d/markerarrayprimitive2d \
+#    drawinglayer/source/primitive2d/fillgraphicprimitive2d \
+#    drawinglayer/source/primitive2d/textdecoratedprimitive2d \
+#    drawinglayer/source/primitive2d/textprimitive2d \
+
+
 # vim: set noet sw=4 ts=4:
diff --git a/filter/Library_pdffilter.mk b/filter/Library_pdffilter.mk
index 9694490655de..9320e3648724 100644
--- a/filter/Library_pdffilter.mk
+++ b/filter/Library_pdffilter.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,pdffilter,\
 	cppuhelper \
 	cppu \
 	sal \
+	drawinglayercore \
 	drawinglayer \
 ))
 
commit a1c9d382e35cf747ab484261911944ac3cdec72c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:50:29 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:31 2020 +0200

    drawinglayer: externalize PointArrayPrimitive2D class
    
    Change-Id: I8ee993947bf2f4437cf3a429c43a81132fac0947

diff --git a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index 613b8969828d..682132218411 100644
--- a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -39,7 +39,7 @@ namespace drawinglayer::primitive2d
             should process it (Currently it is only used for grid visualisation,
             but this may change).
          */
-        class PointArrayPrimitive2D final : public BasePrimitive2D
+        class DRAWINGLAYER_DLLPUBLIC PointArrayPrimitive2D final : public BasePrimitive2D
         {
         private:
             /// the array of positions
commit c06f73b9089119dc1d18cd1d9b1449b30f8fccbc
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:43:38 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:31 2020 +0200

    drawinglayer: externalize classes in texture.hxx
    
    Change-Id: I1e49a6c896733ebebf16db23f3c2f8b06161d659

diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 24e23a4b241c..b34bde38d1bc 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -30,7 +30,7 @@
 
 namespace drawinglayer::texture
 {
-        class GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvx
         {
         public:
             GeoTexSvx();
@@ -53,7 +53,7 @@ namespace drawinglayer::texture
             basegfx::BColor         maBColor;
         };
 
-        class GeoTexSvxGradient : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradient : public GeoTexSvx
         {
         protected:
             basegfx::ODFGradientInfo            maGradientInfo;
@@ -79,7 +79,7 @@ namespace drawinglayer::texture
                 basegfx::BColor& rOuterColor) = 0;
         };
 
-        class GeoTexSvxGradientLinear final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientLinear final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
             double                  mfUnitWidth;
@@ -102,7 +102,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientAxial final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientAxial final : public GeoTexSvxGradient
         {
             double                  mfUnitMinX;
             double                  mfUnitWidth;
@@ -124,7 +124,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientRadial final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRadial final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientRadial(
@@ -143,7 +143,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientElliptical(
@@ -163,7 +163,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientSquare final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientSquare final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientSquare(
@@ -183,7 +183,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxGradientRect final : public GeoTexSvxGradient
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRect final : public GeoTexSvxGradient
         {
         public:
             GeoTexSvxGradientRect(
@@ -203,7 +203,7 @@ namespace drawinglayer::texture
             virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
         };
 
-        class GeoTexSvxHatch final : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxHatch final : public GeoTexSvx
         {
             basegfx::B2DRange                   maOutputRange;
             basegfx::B2DHomMatrix               maTextureTransform;
@@ -239,7 +239,7 @@ namespace drawinglayer::texture
         // given percentage value (offsetX has to be 0.0 <= offsetX <= 1.0).
         // Accordingly to offsetY. If both are given, offsetX is preferred
         // and offsetY is ignored.
-        class GeoTexSvxTiled final : public GeoTexSvx
+        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxTiled final : public GeoTexSvx
         {
             basegfx::B2DRange               maRange;
             double                          mfOffsetX;
commit f1fad7784264fe6b49dc24b2ef77f6853e83a08d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:40:59 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:30 2020 +0200

    drawinglayer: externalize FillHatchPrimitive2D class
    
    Change-Id: I9ad1f179a43bb6c501cb699c0f26523f47307829

diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index bab7e47b03e8..c7b3a559bc42 100644
--- a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -26,9 +26,6 @@
 #include <drawinglayer/attribute/fillhatchattribute.hxx>
 #include <basegfx/color/bcolor.hxx>
 
-
-// FillHatchPrimitive2D class
-
 namespace drawinglayer::primitive2d
 {
         /** FillHatchPrimitive2D class
@@ -45,7 +42,7 @@ namespace drawinglayer::primitive2d
 
             The decomposition will deliver the hatch lines.
          */
-        class FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
+        class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
         {
         private:
             /// the geometrically visible area
commit f7b11291c36f355dce9be503f4805b2a2a55f813
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu May 7 22:01:22 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed May 27 20:09:30 2020 +0200

    vcl: VectorGraphicSearch - for searching text inside PDF
    
    Change-Id: Iee940a3927330c8739774ff3c1af15998f89193b

diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx
new file mode 100644
index 000000000000..3411d0a931e6
--- /dev/null
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <vcl/graph.hxx>
+#include <vcl/vectorgraphicdata.hxx>
+#include <vcl/dllapi.h>
+
+#include <fpdf_doc.h>
+
+#include <memory>
+
+class SearchContext;
+
+class VCL_DLLPUBLIC VectorGraphicSearch final
+{
+private:
+    Graphic maGraphic;
+    FPDF_DOCUMENT mpPdfDocument;
+    std::unique_ptr<SearchContext> mpSearchContext;
+    bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString);
+
+public:
+    VectorGraphicSearch(Graphic const& rGraphic);
+    ~VectorGraphicSearch();
+    bool search(OUString const& rSearchString);
+    bool next();
+    int index();
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/CppunitTest_vcl_graphic_test.mk b/vcl/CppunitTest_vcl_graphic_test.mk
index 353d054e1ba7..2f2c61735ef8 100644
--- a/vcl/CppunitTest_vcl_graphic_test.mk
+++ b/vcl/CppunitTest_vcl_graphic_test.mk
@@ -14,11 +14,12 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_graphic_test, \
     vcl/qa/cppunit/GraphicDescriptorTest \
     vcl/qa/cppunit/GraphicFormatDetectorTest \
     vcl/qa/cppunit/GraphicNativeMetadataTest \
+    vcl/qa/cppunit/VectorGraphicSearchTest \
 ))
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list