[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source

2020-06-09 Thread Aron Budea (via logerrit)
 vcl/source/control/field.cxx |   25 +
 1 file changed, 1 insertion(+), 24 deletions(-)

New commits:
commit e029e9e97a4c678cf9f6bf474ddc1df9bef3852d
Author: Aron Budea 
AuthorDate: Mon Sep 16 12:39:59 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Jun 10 08:30:46 2020 +0200

Revert "vcl: better decimal handling in NumericFormatter"

This reverts commit e9a48869fe1f1e90c03d299ae419ea5b1f43de50.

Further comments by tml, for the cherry-pick this branch:

This fixes the problem where even in plain interactive desktop use,
for instance entering "23" into the font size control on the Font tab
of Calc's Format>Cells... dialog causes the value "2.3" to be entered.

This also fixes corresponding problems in UI tests, like when
test_format_cell_font_effects_tab in
sc/qa/uitest/calc_tests/formatCells.py (part of UITest_calc_tests)
enters "18" into the font size box. (Sadly the failure of that to work
properly then caused UITest_calc_tests to hang, instead of producing
some failure report. At least for me.)

Change-Id: I81269296ab3ca3f071707cf22c4b59964baed863
Reviewed-on: https://gerrit.libreoffice.org/78980
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95959
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 35f298ed9477..ebbd7d41c7bd 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -202,29 +202,6 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& 
rValue,
 aStr1.append(std::u16string_view(aStr).substr(0, nDecPos));
 aStr2.append(std::u16string_view(aStr).substr(nDecPos+1));
 }
-else if (nDecDigits > 0 && aStr.getLength() > nDecDigits)
-{
-// We expect a decimal point and a certain number of decimal digits,
-// but seems the user has deleted the decimal point, so we restore it.
-// Otherwise, they end up with unexpectedly (to them) large numbers.
-
-// Find the first digit from the right.
-sal_Int32 nVirtualDecPos = aStr.getLength();
-while (--nVirtualDecPos > 0)
-{
-if ((aStr[nVirtualDecPos] >= '0') && (aStr[nVirtualDecPos] <= '9'))
-break;
-}
-
-if (nVirtualDecPos >= nDecDigits)
-{
-nVirtualDecPos -= nDecDigits - 1; // nVirtualDecPos is already on 
a digit (so discount it).
-aStr1.append(aStr.getStr(), nVirtualDecPos);
-aStr2.append(aStr.getStr() + nVirtualDecPos);
-}
-else
-aStr1 = aStr;
-}
 else
 aStr1 = aStr;
 
@@ -564,7 +541,7 @@ void NumericFormatter::ImplInit()
 mnFieldValue= 0;
 mnLastValue = 0;
 mnMin   = 0;
-mnMax   = 1; // A user-friendly round number.
+mnMax   = SAL_MAX_INT32;
 // a "large" value substantially smaller than SAL_MAX_INT64, to avoid
 // overflow in computations using this "dummy" value
 mnDecimalDigits = 2;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2020-06-09 Thread Dennis Francis (via logerrit)
 sc/source/ui/view/gridwin.cxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 0310c591eb5f4010de8f6d12298491d9c13634a3
Author: Dennis Francis 
AuthorDate: Fri May 1 05:39:53 2020 +0530
Commit: Dennis Francis 
CommitDate: Wed Jun 10 08:21:25 2020 +0200

lokit: fix autofilter window position...

when client zoom is not 100%. The fix and the reasoning
is same as that in

lokit: fix validation dropdown's wrong position
3405f7f1b19738cad57b58259105ec87c1108466

Conflicts:
sc/source/ui/view/gridwin.cxx

Change-Id: I04837721d82b1e178cf5aa1130bbdaf77d13edae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93240
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 
(cherry picked from commit 86019fc76473cde457ecf1634bcff9df60ad7cbf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95965
Tested-by: Jenkins

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ce9df4fe4c33..85f2cd517085 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -628,6 +628,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 {
 SCTAB nTab = pViewData->GetTabNo();
 ScDocument* pDoc = pViewData->GetDocument();
+bool bLOKActive = comphelper::LibreOfficeKit::isActive();
 
 mpAutoFilterPopup.disposeAndClear();
 int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), 
pViewData->GetPPTX());
@@ -638,7 +639,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 // If NWF renders the focus rects itself, that breaks double-buffering.
 mpAutoFilterPopup->RequestDoubleBuffering(true);
 
-if (comphelper::LibreOfficeKit::isActive())
+if (bLOKActive)
 mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
 mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, 
AutoFilterMode::Normal));
 mpAutoFilterPopup->setPopupEndAction(
@@ -650,6 +651,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 long nSizeX  = 0;
 long nSizeY  = 0;
 pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
+if (bLOKActive)
+{
+// Reverse the zoom factor from aPos and nSize[X|Y]
+// before letting the autofilter window convert the to twips
+// with no zoom information.
+double fZoomX(pViewData->GetZoomX());
+double fZoomY(pViewData->GetZoomY());
+aPos.setX(aPos.getX() / fZoomX);
+aPos.setY(aPos.getY() / fZoomY);
+nSizeX = nSizeX / fZoomX;
+nSizeY = nSizeY / fZoomY;
+}
 tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, 
nSizeY));
 
 ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, 
ScDBDataPortion::AREA);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: forms/source sd/source svx/source toolkit/source

2020-06-09 Thread Michael Warner (via logerrit)
 forms/source/component/Date.cxx   |   43 --
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx |9 
 svx/source/accessibility/AccessibleGraphicShape.cxx   |   12 
 svx/source/accessibility/AccessibleOLEShape.cxx   |   12 
 svx/source/accessibility/AccessibleShape.cxx  |   45 --
 svx/source/table/accessiblecell.cxx   |   13 
 toolkit/source/controls/tkspinbutton.cxx  |   12 
 toolkit/source/controls/unocontrols.cxx   |  252 --
 8 files changed, 117 insertions(+), 281 deletions(-)

New commits:
commit 8d414f3a8de5c25bcd830b1d4d8a7be3c34a2ed4
Author: Michael Warner 
AuthorDate: Sat May 30 22:18:29 2020 -0400
Commit: Stephan Bergmann 
CommitDate: Wed Jun 10 08:17:31 2020 +0200

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: Id747848b222f69af3293a2095a62542f1e1116d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95215
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx
index cca3e06821d7..1d16109ce672 100644
--- a/forms/source/component/Date.cxx
+++ b/forms/source/component/Date.cxx
@@ -55,16 +55,10 @@ Sequence ODateControl::_getTypes()
 return OBoundControl::_getTypes();
 }
 
-
 css::uno::Sequence SAL_CALL ODateControl::getSupportedServiceNames()
 {
-css::uno::Sequence aSupported = 
OBoundControl::getSupportedServiceNames();
-aSupported.realloc(aSupported.getLength() + 2);
-
-OUString*pArray = aSupported.getArray();
-pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_DATEFIELD;
-pArray[aSupported.getLength()-2] = STARDIV_ONE_FORM_CONTROL_DATEFIELD;
-return aSupported;
+const css::uno::Sequence vals { FRM_SUN_CONTROL_DATEFIELD, 
STARDIV_ONE_FORM_CONTROL_DATEFIELD };
+return 
comphelper::concatSequences(OBoundControl::getSupportedServiceNames(), vals);
 }
 
 
@@ -122,26 +116,19 @@ IMPLEMENT_DEFAULT_CLONING( ODateModel )
 
 css::uno::Sequence SAL_CALL ODateModel::getSupportedServiceNames()
 {
-css::uno::Sequence aSupported = 
OBoundControlModel::getSupportedServiceNames();
-
-sal_Int32 nOldLen = aSupported.getLength();
-aSupported.realloc( nOldLen + 9 );
-OUString* pStoreTo = aSupported.getArray() + nOldLen;
-
-*pStoreTo++ = BINDABLE_CONTROL_MODEL;
-*pStoreTo++ = DATA_AWARE_CONTROL_MODEL;
-*pStoreTo++ = VALIDATABLE_CONTROL_MODEL;
-
-*pStoreTo++ = BINDABLE_DATA_AWARE_CONTROL_MODEL;
-*pStoreTo++ = VALIDATABLE_BINDABLE_CONTROL_MODEL;
-
-*pStoreTo++ = FRM_SUN_COMPONENT_DATEFIELD;
-*pStoreTo++ = FRM_SUN_COMPONENT_DATABASE_DATEFIELD;
-*pStoreTo++ = BINDABLE_DATABASE_DATE_FIELD;
-
-*pStoreTo++ = FRM_COMPONENT_DATEFIELD;
-
-return aSupported;
+const css::uno::Sequence vals {
+   BINDABLE_CONTROL_MODEL,
+   DATA_AWARE_CONTROL_MODEL,
+   VALIDATABLE_CONTROL_MODEL,
+   BINDABLE_DATA_AWARE_CONTROL_MODEL,
+   VALIDATABLE_BINDABLE_CONTROL_MODEL,
+   FRM_SUN_COMPONENT_DATEFIELD,
+   FRM_SUN_COMPONENT_DATABASE_DATEFIELD,
+   BINDABLE_DATABASE_DATE_FIELD,
+   FRM_COMPONENT_DATEFIELD
+};
+
+return 
comphelper::concatSequences(OBoundControlModel::getSupportedServiceNames(), 
vals);
 }
 
 
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx 
b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 6d13f723e14c..c042eac6254f 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -383,16 +383,11 @@ css::uno::Sequence< OUString> SAL_CALL
 AccessibleDrawDocumentView::getSupportedServiceNames()
 {
 ThrowIfDisposed();
-// Get list of supported service names from base class...
+const css::uno::Sequence vals { 
"com.sun.star.drawing.AccessibleDrawDocumentView" };
 uno::Sequence aServiceNames =
 AccessibleDocumentViewBase::getSupportedServiceNames();
-sal_Int32 nCount (aServiceNames.getLength());
 
-// ...and add additional names.
-aServiceNames.realloc (nCount + 1);
-aServiceNames[nCount] = "com.sun.star.drawing.AccessibleDrawDocumentView";
-
-return aServiceNames;
+return comphelper::concatSequences(aServiceNames, vals);
 }
 
 //=  XInterface  ==
diff --git a/svx/source/accessibility/AccessibleGraphicShape.cxx 
b/svx/source/accessibility/AccessibleGraphicShape.cxx
index 10f4d8b2..c7fe3c6fe40b 100644
--- a/svx/source/accessibility/AccessibleGraphicShape.cxx
+++ b/svx/source/accessibility/AccessibleGraphicShape.cxx
@@ -104,16 +104,8 @@ css::uno::Sequence< OUString> SAL_CALL
 AccessibleGraphicShape::getSupportedServiceNames()
 {
 ThrowIfDisposed ();
-// Get list of supported service names from base class...
-uno::Sequence aServiceNames =
-AccessibleShape::getSupportedServiceNames();
-   

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl sd/source vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|   24 +++
 sd/source/ui/view/Outliner.cxx |   16 +++--
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   88 -
 vcl/source/graphic/VectorGraphicSearch.cxx |   22 ---
 4 files changed, 135 insertions(+), 15 deletions(-)

New commits:
commit 456116d97b66703e23055b83ded5d87ed85c728d
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 4 18:26:58 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 10 08:11:41 2020 +0200

sd: support match case, match whole word for PDF search

THis adds support for match case and match whole word to the
VectorGraphicSearch + tests.

It uses the new options in PDF seearch in Draw/Impress.

Change-Id: I20a6382c22bf01a5a021c8bae1ff78861419c0ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95530
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 112d8113388513d9c6b317e828f5d373b4a54330)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95950
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/vcl/VectorGraphicSearch.hxx 
b/include/vcl/VectorGraphicSearch.hxx
index c9faaa51f1c9..4601a1f5ac1d 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -25,6 +25,28 @@ enum class SearchStartPosition
 End
 };
 
+struct VCL_DLLPUBLIC VectorGraphicSearchOptions final
+{
+SearchStartPosition meStartPosition;
+bool mbMatchCase;
+bool mbMatchWholeWord;
+
+VectorGraphicSearchOptions()
+: meStartPosition(SearchStartPosition::Begin)
+, mbMatchCase(false)
+, mbMatchWholeWord(false)
+{
+}
+
+VectorGraphicSearchOptions(SearchStartPosition eStartPosition, bool 
bMatchCase,
+   bool bMatchWholeWord)
+: meStartPosition(eStartPosition)
+, mbMatchCase(bMatchCase)
+, mbMatchWholeWord(bMatchWholeWord)
+{
+}
+};
+
 class VCL_DLLPUBLIC VectorGraphicSearch final
 {
 private:
@@ -38,7 +60,7 @@ public:
 VectorGraphicSearch(Graphic const& rGraphic);
 ~VectorGraphicSearch();
 bool search(OUString const& rSearchString,
-SearchStartPosition eStartPosition = 
SearchStartPosition::Begin);
+VectorGraphicSearchOptions const& rOptions = 
VectorGraphicSearchOptions());
 basegfx::B2DSize pageSize();
 bool next();
 bool previous();
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 3114196f7cf2..c01e2fe6fe73 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -840,8 +840,12 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti
 OUString const & rString = mpSearchItem->GetSearchString();
 bool bBackwards = mpSearchItem->GetBackward();
 
-SearchStartPosition eSearchStartPosition = bBackwards ? 
SearchStartPosition::End : SearchStartPosition::Begin;
-bool bResult = mpImpl->mpVectorGraphicSearch->search(rString, 
eSearchStartPosition);
+VectorGraphicSearchOptions aOptions;
+aOptions.meStartPosition = bBackwards ? 
SearchStartPosition::End : SearchStartPosition::Begin;
+aOptions.mbMatchCase = mpSearchItem->GetExact();
+aOptions.mbMatchWholeWord = mpSearchItem->GetWordOnly();
+
+bool bResult = mpImpl->mpVectorGraphicSearch->search(rString, 
aOptions);
 
 if (bResult)
 {
@@ -1253,11 +1257,15 @@ void SdOutliner::ProvideNextTextObject()
 auto* pGraphicObject = static_cast(mpObj);
 OUString const & rString = mpSearchItem->GetSearchString();
 bool bBackwards = mpSearchItem->GetBackward();
-SearchStartPosition eSearchStartPosition = bBackwards ? 
SearchStartPosition::End : SearchStartPosition::Begin;
+
+VectorGraphicSearchOptions aOptions;
+aOptions.meStartPosition = bBackwards ? 
SearchStartPosition::End : SearchStartPosition::Begin;
+aOptions.mbMatchCase = mpSearchItem->GetExact();
+aOptions.mbMatchWholeWord = mpSearchItem->GetWordOnly();
 
 mpImpl->mpVectorGraphicSearch = 
std::make_unique(pGraphicObject->GetGraphic());
 
-bool bResult = 
mpImpl->mpVectorGraphicSearch->search(rString, eSearchStartPosition);
+bool bResult = 
mpImpl->mpVectorGraphicSearch->search(rString, aOptions);
 if (bResult)
 {
 if (bBackwards)
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx 
b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 00febce16e71..0659e4e62dcf 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -32,11 +32,15 @@ class VectorGraphicSearchTest : public 
test::Boot

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - sd/qa vcl/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   16 
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx|6 ++
 2 files changed, 22 insertions(+)

New commits:
commit 3e20ddab50de57f8a4f915791bbb56710c4936e3
Author: Tomaž Vajngerl 
AuthorDate: Wed Jun 3 12:31:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 10 08:11:29 2020 +0200

sd: disable LOKitSearchTest that test PDF search if no PDFium

enclose the tests with HAVE_FEATURE_PDFIUM

Change-Id: I1ce97fe090cef2cc2ab2f25fd1d2698bcaf28222
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95463
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 25da71b489228b866f20d8ea6d1926128168d1fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95949
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 8c2a41eeca9e..91b5ecbc8473 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -8,6 +8,8 @@
  */
 
 #include "../sdmodeltestbase.hxx"
+#include 
+
 #include "CallbackRecorder.hxx"
 
 #include 
@@ -140,6 +142,7 @@ void lcl_search(const OUString& rKey, bool bFindAll = 
false, bool bBackwards = f
 Scheduler::ProcessEventsToIdle();
 }
 
+#if HAVE_FEATURE_PDFIUM
 SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
 {
 SdrView* pSdrView = pViewShell->GetView();
@@ -148,6 +151,7 @@ SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
 SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
 return pObject;
 }
+#endif
 
 } // end anonymous namespace
 
@@ -262,6 +266,7 @@ void LOKitSearchTest::testDontSearchInMasterPages()
 
 void LOKitSearchTest::testSearchInPDFNonExisting()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -285,10 +290,12 @@ void LOKitSearchTest::testSearchInPDFNonExisting()
 lcl_search("NonExisting");
 
 CPPUNIT_ASSERT_EQUAL(false, mpCallbackRecorder->m_bFound);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDF()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -332,10 +339,12 @@ void LOKitSearchTest::testSearchInPDF()
  mpCallbackRecorder->m_aSearchResultSelection[0]);
 CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)),
  mpCallbackRecorder->m_aSelection[0]);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDFInMultiplePages()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -422,10 +431,12 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages()
 CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
 CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"),
  mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -520,12 +531,14 @@ void 
LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
 CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
 CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"),
  mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 // Test searching in document with mixed objects.
 // We have 2 objects: 1. Text Object, 2. Graphic Object with PDF
 void LOKitSearchTest::testSearchIn2MixedObjects()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -606,11 +619,13 @@ void LOKitSearchTest::testSearchIn2MixedObjects()
 
 CPPUNIT_ASSERT_EQUAL(OString("3546, 3174, 738, 402"),
  mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 // Test searching in document with mixed objects. We have 6 objects.
 void LOKitSearchTest::testSearchIn6MixedObjects()
 {
+#if HAVE_FEATURE_PDFIUM
 SdXImpressDocument* pXImpressDocument = createDoc("MixedTest2.odg");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 CPPUNIT_ASSERT(pViewShell);
@@ -770,6 +785,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects()
 CPPUNIT_ASSERT_E

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit ca214ec3f5b3c65c8d6d335d284b0702f29b4c25
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 21:59:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Jun 10 08:11:00 2020 +0200

sd: allow to change the search string between searches

Before this was missing, so even with a different search string,
it still searched using the old string, which was a bug.

Change-Id: I1655cb421e216e30ae593aabd3ead3a2d5c06299
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95461
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 191288d6a7fb52b31038a21c4e71ee57ffa3bacd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95947
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 09d84fafc3a7..3114196f7cf2 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -837,13 +837,19 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti
 
 if (mpImpl->mbCurrentIsVectorGraphic)
 {
+OUString const & rString = mpSearchItem->GetSearchString();
 bool bBackwards = mpSearchItem->GetBackward();
 
-bool bResult = false;
-if (bBackwards)
-bResult = mpImpl->mpVectorGraphicSearch->previous();
-else
-bResult = mpImpl->mpVectorGraphicSearch->next();
+SearchStartPosition eSearchStartPosition = bBackwards ? 
SearchStartPosition::End : SearchStartPosition::Begin;
+bool bResult = mpImpl->mpVectorGraphicSearch->search(rString, 
eSearchStartPosition);
+
+if (bResult)
+{
+if (bBackwards)
+bResult = mpImpl->mpVectorGraphicSearch->previous();
+else
+bResult = mpImpl->mpVectorGraphicSearch->next();
+}
 
 if (bResult)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Aw: Re: Forced Updates? WTF?

2020-06-09 Thread Ralf Quint

On 6/9/2020 3:18 PM, Christoph Schäfer wrote:

Hi,
It's true, I don't know what happened. I originally installed LO via the MSI installers from the 
TDF site, and I have no other "helpful software" regarding updates on my computers. Oh, 
wait, on my laptop I have installed a Windows update blocker, and yet the LO update happened in the 
background. At least on the laptop the "Recently Used" list wasn't lost, but the icon set 
reverted to the default setting. On my PC even the list was lost, the icon set was also changed, 
and the document restauration didn't work after the PC was forced to reboot, so I lost some work.

If TDF is responsible for this (and I added a qualifier to my original post), I 
actually consider this to be rude behaviour.
I have LO installed for years on each and every one of my computer, a 
couple of Windows 7 still, this laptop I am typing running Windows 8.1, 
3 PCs running Windows 10 as well as a MacBook Pro (High Sierra only 
though) and two machines running Linux Mint 19.1. Not one of them is 
"updating in the background", I usually do this on the Windows machines 
once a month via Ninite (though most of the initial install have been 
through what you are likely referring to as TDF), I have to download a 
newer version manually on the Mac (from TDF) and the only machines that 
semi-automatically offer updates for LO are those two Linux boxes, 
though I still have to select and confirm the update each and every time.


And at no time has any of those updates, on any of the systems above, 
messed with previous system settings, at least not in a way that I would 
have noticed...


Ralf


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Forced Updates? WTF?

2020-06-09 Thread Andrew Pitonyak
Ten computers, have not seen this behavior even though I want it on a few of 
them. Did not even know LO could do it.

⁣Sent from BlueMail ​

On Jun 9, 2020, 6:49 PM, at 6:49 PM, "Christoph Schäfer" 
 wrote:
>
>
>> Gesendet: Dienstag, 09. Juni 2020 um 09:36 Uhr
>> Von: "Mike Kaganski" 
>> An: "Christoph Schäfer" ,
>LibreOffice@lists.freedesktop.org
>> Betreff: Re: Forced Updates? WTF?
>>
>> On 09.06.2020 3:22, Christoph Schäfer wrote:
>> > I never thought this was possible with LO, but it looks like the
>developers have chosen to override my default settings (notification,
>but no automatic updates). Yet, an update from 6.3 to 6.4 (Windows 10)
>has been enforced on me, which also led to data loss, as well as losing
>the "Recently Used" entries in the File dialogue.
>> >
>> >
>> > If this wasn't an attempt by Microsoft to damage LO (I'm on Windows
>10), I have to ask: What the hell were you thinking?
>> >
>> >
>> > This is unacceptable.
>>
>> ... so re-wording all that, "I don't know what had happened; and I
>don't
>> tell you all the details (like how had I installed LO in the first
>place
>> - e.g. from MSI taken from TDF site, or from Windows Store); and
>which
>> "helpful software" might be installed on my system helping to keep
>> software "up-to-date"; and I even don't know if that was some
>deliberate
>> decision, or a bug, - but I choose to be rude from start."
>>
>> I doubt it being acceptable.
>>
>> --
>
>Hi,
>
>It's true, I don't know what happened. I originally installed LO via
>the MSI installers from the TDF site, and I have no other "helpful
>software" regarding updates on my computers. Oh, wait, on my laptop I
>have installed a Windows update blocker, and yet the LO update happened
>in the background. At least on the laptop the "Recently Used" list
>wasn't lost, but the icon set reverted to the default setting. On my PC
>even the list was lost, the icon set was also changed, and the document
>restauration didn't work after the PC was forced to reboot, so I lost
>some work.
>
>If TDF is responsible for this (and I added a qualifier to my original
>post), I actually consider this to be rude behaviour.
>
>Christoph
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Aw: Re: Forced Updates? WTF?

2020-06-09 Thread Christoph Schäfer


> Gesendet: Dienstag, 09. Juni 2020 um 09:36 Uhr
> Von: "Mike Kaganski" 
> An: "Christoph Schäfer" , 
> LibreOffice@lists.freedesktop.org
> Betreff: Re: Forced Updates? WTF?
>
> On 09.06.2020 3:22, Christoph Schäfer wrote:
> > I never thought this was possible with LO, but it looks like the developers 
> > have chosen to override my default settings (notification, but no automatic 
> > updates). Yet, an update from 6.3 to 6.4 (Windows 10) has been enforced on 
> > me, which also led to data loss, as well as losing the "Recently Used" 
> > entries in the File dialogue.
> > 
> > 
> > If this wasn't an attempt by Microsoft to damage LO (I'm on Windows 10), I 
> > have to ask: What the hell were you thinking?
> > 
> > 
> > This is unacceptable.
> 
> ... so re-wording all that, "I don't know what had happened; and I don't
> tell you all the details (like how had I installed LO in the first place
> - e.g. from MSI taken from TDF site, or from Windows Store); and which
> "helpful software" might be installed on my system helping to keep
> software "up-to-date"; and I even don't know if that was some deliberate
> decision, or a bug, - but I choose to be rude from start."
> 
> I doubt it being acceptable.
> 
> -- 

Hi,

It's true, I don't know what happened. I originally installed LO via the MSI 
installers from the TDF site, and I have no other "helpful software" regarding 
updates on my computers. Oh, wait, on my laptop I have installed a Windows 
update blocker, and yet the LO update happened in the background. At least on 
the laptop the "Recently Used" list wasn't lost, but the icon set reverted to 
the default setting. On my PC even the list was lost, the icon set was also 
changed, and the document restauration didn't work after the PC was forced to 
reboot, so I lost some work.

If TDF is responsible for this (and I added a qualifier to my original post), I 
actually consider this to be rude behaviour.

Christoph


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: external/xmlsec

2020-06-09 Thread Tor Lillqvist (via logerrit)
 external/xmlsec/ExternalProject_xmlsec.mk |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 236adff64dbde5241354c595771b9222dbe96b65
Author: Tor Lillqvist 
AuthorDate: Thu Apr 23 17:32:11 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Jun 10 00:09:05 2020 +0200

Enable cross-compilation of xmlsec on macOS (without pkg-config)

Change-Id: If08dde33dbf19afc9ce82bfa42412a642187a56f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95848
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/external/xmlsec/ExternalProject_xmlsec.mk 
b/external/xmlsec/ExternalProject_xmlsec.mk
index c530b69d5bcd..8fb0ef56fa09 100644
--- a/external/xmlsec/ExternalProject_xmlsec.mk
+++ b/external/xmlsec/ExternalProject_xmlsec.mk
@@ -37,7 +37,7 @@ else
 $(call gb_ExternalProject_get_state_target,xmlsec,build) :
$(call gb_Trace_StartRange,xmlsec,EXTERNAL)
$(call gb_ExternalProject_run,build,\
-   $(if $(filter iOS MACOSX,$(OS)),ACLOCAL="aclocal -I 
$(SRCDIR)/m4/mac") \
+   $(if $(filter iOS MACOSX,$(OS_FOR_BUILD)),ACLOCAL="aclocal -I 
$(SRCDIR)/m4/mac") \
$(if $(filter AIX,$(OS)),ACLOCAL="aclocal -I 
/opt/freeware/share/aclocal") \
autoreconf \
&& ./configure \
@@ -46,7 +46,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
CFLAGS="$(CFLAGS) $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if 
$(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS)" \
--without-openssl \
$(if $(filter 
MACOSX,$(OS)),--prefix=/@.__OOO)
 \
-   $(if $(SYSTEM_NSS),,$(if $(filter 
MACOSX,$(OS)),--disable-pkgconfig)) \
+   $(if $(SYSTEM_NSS),,$(if $(filter 
MACOSX,$(OS_FOR_BUILD)),--disable-pkgconfig)) \
$(if $(SYSTEM_NSS),,NSPR_CFLAGS="-I$(call 
gb_UnpackedTarball_get_dir,nss)/dist/out/include" NSPR_LIBS="-L$(call 
gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lnspr4") \
$(if $(SYSTEM_NSS),,NSS_CFLAGS="-I$(call 
gb_UnpackedTarball_get_dir,nss)/dist/public/nss" NSS_LIBS="-L$(call 
gb_UnpackedTarball_get_dir,nss)/dist/out/lib -lsmime3 -lnss3 -lnssutil3") \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM)) \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/source include/svx sd/source svx/source

2020-06-09 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/signature-line-draw.svg |   10 ++---
 include/svx/signaturelinehelper.hxx|8 
 sd/source/ui/func/fuconrec.cxx |   50 -
 svx/source/dialog/signaturelinehelper.cxx  |   27 +++
 4 files changed, 68 insertions(+), 27 deletions(-)

New commits:
commit f1566f0b813e439531a37154b52d491fd9d3224b
Author: Miklos Vajna 
AuthorDate: Tue Jun 9 18:03:22 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 23:44:55 2020 +0200

sd signature line: select certificate after drawing the shape's rectangle

Also move the shape-type-specific setup to
FuConstructRectangle::SetAttributes() where the rest of the shape types
are handled.

Change-Id: I9ecf94957ec82ba187f2767b01d96fb14de2b657
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95958
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/cui/source/dialogs/signature-line-draw.svg 
b/cui/source/dialogs/signature-line-draw.svg
index cd256d098a27..564b5cdf3ef9 100644
--- a/cui/source/dialogs/signature-line-draw.svg
+++ b/cui/source/dialogs/signature-line-draw.svg
@@ -1,5 +1,5 @@
 
-http://purl.org/dc/elements/1.1/"; 
xmlns:cc="http://creativecommons.org/ns#"; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
xmlns:svg="http://www.w3.org/2000/svg"; xmlns="http://www.w3.org/2000/svg"; 
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"; 
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"; version="1.2" 
width="90mm" height="45mm" viewBox="0 0 9000 4500" 
preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" 
stroke-linejoin="round" xml:space="preserve" id="svg577" 
inkscape:version="0.92.2 5c3e80d, 2017-08-06">
+http://purl.org/dc/elements/1.1/"; 
xmlns:cc="http://creativecommons.org/ns#"; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
xmlns:svg="http://www.w3.org/2000/svg"; xmlns="http://www.w3.org/2000/svg"; 
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"; 
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"; version="1.2" 
width="90mm" height="45mm" viewBox="0 0 9000 4500" 
preserveAspectRatio="xMidYMid" xml:space="preserve" id="svg577" 
inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="test.svg" 
stroke-linejoin="round" stroke-width="28.222" fill-rule="evenodd">
   
 
   
@@ -9,7 +9,7 @@
   
 
   
-  
+  
   
 
   
@@ -28,9 +28,9 @@
   
   
 
-[SIGNER_NAME]
-Digitally 
signed by:
-Date: 
[DATE]
+Digitally signed by:
+[SIGNER_NAME]
+Date: [DATE]
 
   
 
diff --git a/include/svx/signaturelinehelper.hxx 
b/include/svx/signaturelinehelper.hxx
index 4cdb40651479..0906d88ef095 100644
--- a/include/svx/signaturelinehelper.hxx
+++ b/include/svx/signaturelinehelper.hxx
@@ -21,6 +21,7 @@ namespace weld
 {
 class Window;
 }
+class SdrView;
 class SfxObjectShell;
 
 namespace svx::SignatureLineHelper
@@ -52,6 +53,13 @@ SVX_DLLPUBLIC OUString getLocalizedDate();
  * Interprets rSVG as a graphic and gives back the resuling UNO wrapper.
  */
 SVX_DLLPUBLIC css::uno::Reference importSVG(const 
OUString& rSVG);
+
+/**
+ * Sets xCertificate as the signing certificate of the selected shape on pView.
+ */
+SVX_DLLPUBLIC void
+setShapeCertificate(SdrView* pView,
+const css::uno::Reference& 
xCertificate);
 }
 
 #endif
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 63daa06171c4..91ed61ad3d63 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -430,28 +431,6 @@ void FuConstructRectangle::Activate()
 
 void FuConstructRectangle::Deactivate()
 {
-if (nSlotId == SID_INSERT_SIGNATURELINE)
-{
-const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-if (rMarkList.GetMarkCount() > 0)
-{
-// Avoid the default solid fill and line, we'll set a graphic 
instead.
-const SdrMark* pMark = rMarkList.GetMark(0);
-SdrObject* pObject = pMark->GetMarkedSdrObj();
-SfxItemSet aSet = pObject->GetMergedItemSet();
-
-XFillStyleItem aFillStyleItem(aSet.Get(XATTR_FILLSTYLE));
-aFillStyleItem.SetValue(drawing::FillStyle_NONE);
-aSet.Put(aFillStyleItem);
-
-XLineStyleItem aLineStyleItem(aSet.Get(XATTR_LINESTYLE));
-aLineStyleItem.SetValue(drawing::LineStyle_NONE);
-aSet.Put(aLineStyleItem);
-
-pObject->SetMergedItemSet(aSet);
-}
-}
-
 if( nSlotId == SID_TOOL_CONNECTOR   ||
 nSlotId == SID_CONNECTOR_ARROW_START||
 nSlotId == SID_CONNECTOR_ARROW_END  ||
@@ -491,6 +470,27 @@ void FuConstructRectangle::Deactivate()
 mpView->SetGlueVisible( false );
 }
 FuConstruct::Deactivate();
+
+if (nSlotId != SID_INSERT_SIGNATURELINE)
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|3 -
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   33 
 vcl/source/graphic/VectorGraphicSearch.cxx |   79 +++--
 3 files changed, 86 insertions(+), 29 deletions(-)

New commits:
commit 5713b22bc3b7bc54d83fc99616912504ebf63649
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 14:03:36 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 23:34:28 2020 +0200

vcl: VectorGraphicSearch - support changing search string

Initial implementation only allowed to set the search string once.
This change allows to change the search string and still retain
the last position of a found string, so the search continues
from this positon forward or backwards. This mimicks how we search
through the GUI (which is the main use for this functionallity
anyway).

Change-Id: I8a7aee4b6b6525f483f105feaa1f83c4a0ad9594
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95460
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 1f8a46ae50c6977add4c4116f114df3a58796be3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95946
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/vcl/VectorGraphicSearch.hxx 
b/include/vcl/VectorGraphicSearch.hxx
index 2dc8cca3b76a..c9faaa51f1c9 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -32,8 +32,7 @@ private:
 std::unique_ptr mpImplementation;
 Graphic maGraphic;
 
-bool searchPDF(std::shared_ptr const& rData, OUString 
const& rSearchString,
-   SearchStartPosition eStartPosition);
+bool searchPDF(std::shared_ptr const& rData);
 
 public:
 VectorGraphicSearch(Graphic const& rGraphic);
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx 
b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 5f65b4ba7e3d..8dbdcac0e2e1 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -27,10 +27,12 @@ class VectorGraphicSearchTest : public 
test::BootstrapFixtureBase
 
 void test();
 void testNextPrevious();
+void testSearchStringChange();
 
 CPPUNIT_TEST_SUITE(VectorGraphicSearchTest);
 CPPUNIT_TEST(test);
 CPPUNIT_TEST(testNextPrevious);
+CPPUNIT_TEST(testSearchStringChange);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -160,6 +162,37 @@ void VectorGraphicSearchTest::testNextPrevious()
 }
 }
 
+void VectorGraphicSearchTest::testSearchStringChange()
+{
+OUString aURL = getFullUrl("Pangram.pdf");
+SvFileStream aStream(aURL, StreamMode::READ);
+GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
+Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
+aGraphic.makeAvailable();
+
+VectorGraphicSearch aSearch(aGraphic);
+
+// Set search to "lazy"
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
+
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+
+// Change search to "fox"
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("fox"));
+
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(822, aSearch.index());
+
+// Change search to "Quick"
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("Quick"));
+CPPUNIT_ASSERT_EQUAL(true, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(784, aSearch.index());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index a719329b7708..6ca73280605d 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -33,18 +33,18 @@ private:
 
 public:
 sal_Int32 mnPageIndex;
+int mnCurrentIndex;
 OUString maSearchString;
 SearchStartPosition meStartPosition;
 
-SearchContext(FPDF_DOCUMENT pPdfDocument, sal_Int32 nPageIndex, OUString 
const& rSearchString,
-  SearchStartPosition eStartPosition)
+SearchContext(FPDF_DOCUMENT pPdfDocument, sal_Int32 nPageIndex)
 : mpPdfDocument(pPdfDocument)
 , mpPage(nullptr)
 , mpTextPage(nullptr)
 , mpSearchHandle(nullptr)
 , mnPageIndex(nPageIndex)
-, maSearchString(rSearchString)
-, meStartPosition(eStartPosition)
+, mnCurrentIndex(-1)
+, meStartPosition(SearchStartPosition::Begin)
 {
 }
 
@@ -74,13 +74,30 @@ public:
 return aSize;
 }
 
-bool initialize()
+bool initialize(OUString const& rSearchString, SearchStartPosition 
eStartPosition)
 {
 if (!mpPdfDocument)
 return false;
+
+if (rSearchString == maSearchString)
+return true;
+
+if (mpSearchHandle)
+FPDFTex

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-06-09 Thread Michael Stahl (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f2e448175cee92fc695413e7281223e9f23e30ee
Author: Michael Stahl 
AuthorDate: Mon Jun 8 17:24:18 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 22:54:54 2020 +0200

tdf#133604 sw: DOCX export: put CH_TXT_ATR_FORMELEMENT in its own run

Commit b03fefcc4dbdfee3b9eeb5fa0e586dd12ddcd3d2 ought to have fixed this
but didn't; the run following the CH_TXT_ATR_FORMELEMENT still ended up
inside the field result.

But when importing that into Writer, it appeared correct; Word shows the
problem.

(regression from 94e0b8407b02d76b27324b8b08012eb024aca9e9)

Change-Id: I1fc1328223353422a83d403e8f790d156dbec4e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95843
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95882
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 05a50e7f8b68..f7dc3e2207d2 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -259,7 +259,11 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
 }
 sal_Int32 fieldSepPos = aText.indexOf(CH_TXT_ATR_FIELDSEP, nStartPos);
 sal_Int32 fieldStartPos = aText.indexOf(CH_TXT_ATR_FIELDSTART, nStartPos);
-sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, 
nStartPos);
+sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, nStartPos 
- 1);
+if (0 <= formElementPos && formElementPos < nStartPos)
+{
+++formElementPos; // tdf#133604 put this in its own run
+}
 
 const sal_Int32 pos = lcl_getMinPos(
 lcl_getMinPos(lcl_getMinPos(fieldEndPos, fieldSepPos), fieldStartPos),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source sw/uiconfig

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/ui/misc/bookmark.cxx   |4 
 sw/uiconfig/swriter/ui/insertbookmark.ui |7 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 280c56db840b5822d0b4560f02fcd1b8ced74f90
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 22:53:51 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 3a371da71ab738a99e81e75c736fa5e384ebd9d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95971

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1c67f547558c..29f090f94ff6 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -343,6 +343,10 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 }
 
 m_bAreProtected = 
rSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS);
+
+// disabled until "Hide" flag is not checked
+m_xConditionED->set_sensitive(false);
+m_xConditionFT->set_sensitive(false);
 }
 
 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index f062451af767..8b65bfc619b9 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -71,9 +71,9 @@
 
   
   
-True
-True
-6
+False
+False
+7
   
 
 
@@ -145,6 +145,7 @@
 True
 False
 start
+start
 True
 True
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - sd/qa sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |  196 +-
 sd/source/ui/view/Outliner.cxx|   21 ++
 2 files changed, 212 insertions(+), 5 deletions(-)

New commits:
commit da05adafeea785eea26cab98b77753341fc60f8b
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 13:28:36 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 22:52:26 2020 +0200

sd: add support to search backwards in PDF search

Change-Id: I2c7f75d16a430dcfa892d28fb6b4f64118705ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95459
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7b2170f6239f0c4f16a1cbd3ec54a861405aa07a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95945
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 2c1e1c0426a3..8c2a41eeca9e 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -56,6 +56,7 @@ public:
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
 void testSearchInPDFInMultiplePages();
+void testSearchInPDFInMultiplePagesBackwards();
 void testSearchIn2MixedObjects();
 void testSearchIn6MixedObjects();
 
@@ -69,6 +70,7 @@ public:
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
 CPPUNIT_TEST(testSearchInPDFInMultiplePages);
+CPPUNIT_TEST(testSearchInPDFInMultiplePagesBackwards);
 CPPUNIT_TEST(testSearchIn2MixedObjects);
 CPPUNIT_TEST(testSearchIn6MixedObjects);
 CPPUNIT_TEST_SUITE_END();
@@ -123,14 +125,14 @@ LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
 { "SearchItem.SearchString", uno::makeAny(rKey) },
-{ "SearchItem.Backward", uno::makeAny(false) },
+{ "SearchItem.Backward", uno::makeAny(bBackwards) },
 { "SearchItem.Command", uno::makeAny(sal_uInt16(eSearch)) },
 }));
 
@@ -422,6 +424,104 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages()
  mpCallbackRecorder->m_aSearchResultSelection[0]);
 }
 
+void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+{
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+}
+
+// Expected for backwards search is:
+// - Start with Page 1
+//   + search backwards through objects
+//   + inside objects search backwards through text
+// - Switch to Page 2
+//   + search backwards through objects
+//   + inside objects search backwards through text
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
+CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
+CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search for "him"
+lcl_search("him", /*FindAll*/ false, /*Backwards*/ true);
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(3, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRe

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkinst.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 181587f3a3f8d05f1a3c82eaa0a8838db0096358
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 20:32:52 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 22:18:33 2020 +0200

Resolves: tdf#132540 theme the unwanted popover into invisibility

Change-Id: If18c5c1de40a4f93d062265d41a2bff72555d6c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95973
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 41bd249076c3..7c968124ad18 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7410,6 +7410,15 @@ public:
 {
 GtkWidget* pPlaceHolder = 
gtk_popover_new(GTK_WIDGET(m_pMenuButton));
 gtk_popover_set_transitions_enabled(GTK_POPOVER(pPlaceHolder), 
false);
+
+// tdf#132540 theme the unwanted popover into invisibility
+GtkStyleContext *pPopoverContext = 
gtk_widget_get_style_context(pPlaceHolder);
+GtkCssProvider *pProvider = gtk_css_provider_new();
+static const gchar data[] = "popover { box-shadow: none; padding: 
0 0 0 0; margin: 0 0 0 0; border-image: none; border-image-width: 0 0 0 0; 
background-image: none; background-color: transparent; border-radius: 0 0 0 0; 
border-width: 0 0 0 0; border-style: none; border-color: transparent; opacity: 
0; min-height: 0; min-width: 0; }";
+gtk_css_provider_load_from_data(pProvider, data, -1, nullptr);
+gtk_style_context_add_provider(pPopoverContext, 
GTK_STYLE_PROVIDER(pProvider),
+   
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
 gtk_menu_button_set_popover(m_pMenuButton, pPlaceHolder);
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkinst.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit dbf3eba5514f0ed48683e2b58ac56c96b6d48792
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 20:32:52 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 22:18:11 2020 +0200

Resolves: tdf#132540 theme the unwanted popover into invisibility

Change-Id: If18c5c1de40a4f93d062265d41a2bff72555d6c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95964
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 6d692f76405d..058bdfb38e4c 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7415,6 +7415,15 @@ public:
 {
 GtkWidget* pPlaceHolder = 
gtk_popover_new(GTK_WIDGET(m_pMenuButton));
 gtk_popover_set_transitions_enabled(GTK_POPOVER(pPlaceHolder), 
false);
+
+// tdf#132540 theme the unwanted popover into invisibility
+GtkStyleContext *pPopoverContext = 
gtk_widget_get_style_context(pPlaceHolder);
+GtkCssProvider *pProvider = gtk_css_provider_new();
+static const gchar data[] = "popover { box-shadow: none; padding: 
0 0 0 0; margin: 0 0 0 0; border-image: none; border-image-width: 0 0 0 0; 
background-image: none; background-color: transparent; border-radius: 0 0 0 0; 
border-width: 0 0 0 0; border-style: none; border-color: transparent; opacity: 
0; min-height: 0; min-width: 0; }";
+gtk_css_provider_load_from_data(pProvider, data, -1, nullptr);
+gtk_style_context_add_provider(pPopoverContext, 
GTK_STYLE_PROVIDER(pProvider),
+   
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+
 gtk_menu_button_set_popover(m_pMenuButton, pPlaceHolder);
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkinst.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 43ae7dfb6f6c5f75544067f7cf978ff9c090fd54
Author: Caolán McNamara 
AuthorDate: Mon Jun 8 14:38:08 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 21:46:04 2020 +0200

tdf#133412 replicate active entry to ComboBox replacement

Change-Id: Ifde87738710406fb9f28008fa96241d59c52f450
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95818
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 3b25934e4002..41bd249076c3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13748,6 +13748,7 @@ public:
 , m_nMRUCount(0)
 , m_nMaxMRUCount(0)
 {
+int nActive = gtk_combo_box_get_active(m_pComboBox);
 insertAsParent(GTK_WIDGET(m_pComboBox), GTK_WIDGET(getContainer()));
 gtk_widget_set_visible(GTK_WIDGET(m_pComboBox), false);
 gtk_widget_set_no_show_all(GTK_WIDGET(m_pComboBox), true);
@@ -13836,6 +13837,9 @@ public:
 
 g_list_free(cells);
 
+if (nActive != -1)
+tree_view_set_cursor(nActive);
+
 g_signal_connect(m_pMenuWindow, "grab-broken-event", 
G_CALLBACK(signalGrabBroken), this);
 g_signal_connect(m_pMenuWindow, "button-press-event", 
G_CALLBACK(signalButtonPress), this);
 g_signal_connect(m_pMenuWindow, "motion-notify-event", 
G_CALLBACK(signalMotion), this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source sc/uiconfig

2020-06-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dialogs/searchresults.cxx |   31 +++
 sc/source/ui/inc/searchresults.hxx |2 ++
 sc/uiconfig/scalc/ui/searchresults.ui  |3 +++
 3 files changed, 36 insertions(+)

New commits:
commit 79bf8179aaf7bdaef59b27e65bf0430db9aff168
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 09:27:56 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 21:43:39 2020 +0200

Resolves: tdf#133780 allow sorting search result treeview columns

Change-Id: I7d5b1ffdaf99fd2e28dfd124db0fbbd4036e2dd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95877
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index 11e670fae161..b1b0e45aec5f 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -26,6 +26,7 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 , aSkipped(ScResId(SCSTR_SKIPPED))
 , mpBindings(_pBindings)
 , mpDoc(nullptr)
+, mbSorted(false)
 , mxList(m_xBuilder->weld_tree_view("results"))
 , mxSearchResults(m_xBuilder->weld_label("lbSearchResults"))
 , mxShowDialog(m_xBuilder->weld_check_button("cbShow"))
@@ -37,6 +38,7 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 aWidths.push_back(mxList->get_approximate_digit_width() * 10);
 mxList->set_column_fixed_widths(aWidths);
 mxList->connect_changed(LINK(this, SearchResultsDlg, ListSelectHdl));
+mxList->connect_column_clicked(LINK(this, SearchResultsDlg, 
HeaderBarClick));
 }
 
 SearchResultsDlg::~SearchResultsDlg()
@@ -176,6 +178,35 @@ void SearchResultsDlg::Close()
 SfxDialogController::Close();
 }
 
+IMPL_LINK(SearchResultsDlg, HeaderBarClick, int, nColumn, void)
+{
+if (!mbSorted)
+{
+mxList->make_sorted();
+mbSorted = true;
+}
+
+bool bSortAtoZ = mxList->get_sort_order();
+
+//set new arrow positions in headerbar
+if (nColumn == mxList->get_sort_column())
+{
+bSortAtoZ = !bSortAtoZ;
+mxList->set_sort_order(bSortAtoZ);
+}
+else
+{
+mxList->set_sort_indicator(TRISTATE_INDET, mxList->get_sort_column());
+mxList->set_sort_column(nColumn);
+}
+
+if (nColumn != -1)
+{
+//sort lists
+mxList->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, 
nColumn);
+}
+}
+
 IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl, weld::TreeView&, void )
 {
 if (!mpDoc)
diff --git a/sc/source/ui/inc/searchresults.hxx 
b/sc/source/ui/inc/searchresults.hxx
index de48e1c9c4ac..cf48fb239ece 100644
--- a/sc/source/ui/inc/searchresults.hxx
+++ b/sc/source/ui/inc/searchresults.hxx
@@ -24,11 +24,13 @@ class SearchResultsDlg : public SfxDialogController
 OUString aSkipped;
 SfxBindings* mpBindings;
 ScDocument* mpDoc;
+bool mbSorted;
 std::unique_ptr mxList;
 std::unique_ptr mxSearchResults;
 std::unique_ptr mxShowDialog;
 
 DECL_LINK(ListSelectHdl, weld::TreeView&, void);
+DECL_LINK(HeaderBarClick, int, void);
 DECL_STATIC_LINK(SearchResultsDlg, OnShowToggled, weld::ToggleButton&, 
void);
 public:
 SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParent);
diff --git a/sc/uiconfig/scalc/ui/searchresults.ui 
b/sc/uiconfig/scalc/ui/searchresults.ui
index cb8fbaf44e7e..ca56a9950a7f 100644
--- a/sc/uiconfig/scalc/ui/searchresults.ui
+++ b/sc/uiconfig/scalc/ui/searchresults.ui
@@ -100,6 +100,7 @@
 True
 6
 Sheet
+True
 
   
   
@@ -113,6 +114,7 @@
 True
 6
 Cell
+True
 
   
   
@@ -126,6 +128,7 @@
 True
 6
 Content
+True
 
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 5ed594f2a9642becb3f490b1aeb07231da956522
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 10:05:17 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 21:33:29 2020 +0200

sd: rename testSearchInMixedObject(2) to more descriptive name

testSearchInMixedObject -> testSearchIn2MixedObjects
testSearchInMixedObject2 -> testSearchIn6MixedObjects

Change-Id: Ifba20df38fd33bb86b072ba79085d123c914f916
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95457
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit f36fec9bd296e2aa0a5463f849808bb85e746d2e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95943
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 7786bc1f1dae..ec9f7d95c5da 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -55,8 +55,8 @@ public:
 void testDontSearchInMasterPages();
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
-void testSearchInMixedObject();
-void testSearchInMixedObject2();
+void testSearchIn2MixedObjects();
+void testSearchIn6MixedObjects();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -67,8 +67,8 @@ public:
 CPPUNIT_TEST(testDontSearchInMasterPages);
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
-CPPUNIT_TEST(testSearchInMixedObject);
-CPPUNIT_TEST(testSearchInMixedObject2);
+CPPUNIT_TEST(testSearchIn2MixedObjects);
+CPPUNIT_TEST(testSearchIn6MixedObjects);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -332,7 +332,7 @@ void LOKitSearchTest::testSearchInPDF()
 
 // Test searching in document with mixed objects.
 // We have 2 objects: 1. Text Object, 2. Graphic Object with PDF
-void LOKitSearchTest::testSearchInMixedObject()
+void LOKitSearchTest::testSearchIn2MixedObjects()
 {
 SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
@@ -417,7 +417,7 @@ void LOKitSearchTest::testSearchInMixedObject()
 }
 
 // Test searching in document with mixed objects. We have 6 objects.
-void LOKitSearchTest::testSearchInMixedObject2()
+void LOKitSearchTest::testSearchIn6MixedObjects()
 {
 SdXImpressDocument* pXImpressDocument = createDoc("MixedTest2.odg");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source

2020-06-09 Thread Miklos Vajna (via logerrit)
 svx/source/svdraw/svdobj.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 93f2cb69575df5b4a9e2c509ee2b691dc013045d
Author: Miklos Vajna 
AuthorDate: Tue Jun 9 13:43:19 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 21:23:19 2020 +0200

sd doc model xml dump: show grab-bag of shape

Which is contained directly for some reason, not inside mpProperties.

Change-Id: I0f7d2d5afbeae2d399710d5ce271f3ad4ab9866d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95913
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 7b1b5cc5db61..90b41c7d7225 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1714,6 +1714,11 @@ void SdrObject::dumpAsXml(xmlTextWriterPtr pWriter) const
 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nOrdNum"), "%" 
SAL_PRIuUINT32, GetOrdNumDirect());
 xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aOutRect"), 
BAD_CAST(aOutRect.toString().getStr()));
 
+if (pGrabBagItem)
+{
+pGrabBagItem->dumpAsXml(pWriter);
+}
+
 if (mpProperties)
 {
 mpProperties->dumpAsXml(pWriter);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/source/treelist/headbar.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6250b2bebfc8179e1c618dc79a9b74c8efe06629
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 12:25:26 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 21:16:46 2020 +0200

tdf#129856 invalidate old internal border if we scroll

and will redraw a new one

Change-Id: I2438af94e54f31c617cc183c61fbaaef31b5601f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95887
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx
index e87790e9dd97..7020c616bb69 100644
--- a/vcl/source/treelist/headbar.cxx
+++ b/vcl/source/treelist/headbar.cxx
@@ -1110,8 +1110,15 @@ void HeaderBar::Clear()
 
 void HeaderBar::SetOffset( long nNewOffset )
 {
+// tdf#129856 (see also #i40393#) invalidate old left and right border 
area if WB_BORDER was set in ImplInit()
+if (mnBorderOff1 && mnBorderOff2)
+{
+Invalidate(tools::Rectangle(0, 0, 1, mnDY));
+Invalidate(tools::Rectangle(mnDX - 1, 0, mnDX, mnDY));
+}
+
 // move area
-tools::Rectangle aRect( 0, mnBorderOff1, mnDX-1, 
mnDY-mnBorderOff1-mnBorderOff2-1 );
+tools::Rectangle aRect( 0, mnBorderOff1, mnDX-1, 
mnDY-mnBorderOff1-mnBorderOff2 );
 long nDelta = mnOffset-nNewOffset;
 mnOffset = nNewOffset;
 Scroll( nDelta, 0, aRect );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |  179 +-
 sd/qa/unit/tiledrendering/data/MixedTest2.odg |binary
 2 files changed, 178 insertions(+), 1 deletion(-)

New commits:
commit 9b51e9929b593175024085cc7bdf0482b4a56d0c
Author: Tomaž Vajngerl 
AuthorDate: Sat May 30 19:30:44 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 21:01:50 2020 +0200

sd: Add another test of searching with mixed objects

This is to make sure that we switch between different objects
during the search correctly.

Change-Id: I18aa5b251cbaadd3a9cb15a04ec1a1e5f267d2e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95455
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit ceaa07e1a1aafd9a11b8baea242605f32c56e584)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95941
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 24037a0780ba..7786bc1f1dae 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -56,6 +56,7 @@ public:
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
 void testSearchInMixedObject();
+void testSearchInMixedObject2();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -67,6 +68,7 @@ public:
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
 CPPUNIT_TEST(testSearchInMixedObject);
+CPPUNIT_TEST(testSearchInMixedObject2);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -134,6 +136,15 @@ void lcl_search(const OUString& rKey, bool bFindAll = 
false)
 Scheduler::ProcessEventsToIdle();
 }
 
+SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
+{
+SdrView* pSdrView = pViewShell->GetView();
+const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+CPPUNIT_ASSERT_EQUAL(size_t(1), rMarkList.GetMarkCount());
+SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
+return pObject;
+}
+
 } // end anonymous namespace
 
 void LOKitSearchTest::testSearch()
@@ -319,6 +330,8 @@ void LOKitSearchTest::testSearchInPDF()
  mpCallbackRecorder->m_aSelection[0]);
 }
 
+// Test searching in document with mixed objects.
+// We have 2 objects: 1. Text Object, 2. Graphic Object with PDF
 void LOKitSearchTest::testSearchInMixedObject()
 {
 SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
@@ -334,7 +347,7 @@ void LOKitSearchTest::testSearchInMixedObject()
 SdPage* pPage = pViewShell->GetActualPage();
 CPPUNIT_ASSERT(pPage);
 
-// Check page hase 2 objects only
+// Check page has 2 objects only
 CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount());
 
 // Check Object 1
@@ -403,6 +416,170 @@ void LOKitSearchTest::testSearchInMixedObject()
  mpCallbackRecorder->m_aSearchResultSelection[0]);
 }
 
+// Test searching in document with mixed objects. We have 6 objects.
+void LOKitSearchTest::testSearchInMixedObject2()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("MixedTest2.odg");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+SdDrawDocument* pDocument = pXImpressDocument->GetDocShell()->GetDoc();
+CPPUNIT_ASSERT(pDocument);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+// Check we have one page
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), 
pDocument->GetSdPageCount(PageKind::Standard));
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+// Check page has 6 objects only
+CPPUNIT_ASSERT_EQUAL(size_t(6), pPage->GetObjCount());
+
+// Check we have the right objects that we expect
+
+// Check Object 1
+{
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_TEXT), 
pObject->GetObjIdentifier());
+}
+
+// Check Object 2
+{
+SdrObject* pObject = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObject);
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), 
pObject->GetObjIdentifier());
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+auto const& pVectorGraphicData = 
pGraphicObject->GetGraphic().getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+}
+
+// Check Object 3
+{
+SdrObject* pObject = pPage->GetObj(2);
+CPPUNIT_ASSERT(pObject);
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_CUSTOMSHAPE), 
pObject->GetObjIdentifier());
+}
+
+// Check Object 4
+{
+SdrObject* pObject = pPage->GetObj(3);
+CPPUNIT_ASSERT(pObject);
+CP

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   45 -
 1 file changed, 23 insertions(+), 22 deletions(-)

New commits:
commit f0ef50cbfe6039dc9dd00f89af8596f309223cb7
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 09:58:26 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 21:02:08 2020 +0200

sd: PDF search - reset mpVectorGraphicSearch at more places

and simplify the case when the search doesn't find a match in
the vector graphic.

Change-Id: I3e086e8e36f8a578711eed6d4dcca65c0c4c6268
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95456
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit f60caab2c867a578b6e6b963ebd5a72b5a12463e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95942
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 585eee9475e8..916d5d1d2dfb 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1170,6 +1170,7 @@ void SdOutliner::ProvideNextTextObject()
 mbFoundObject = false;
 
 // reset the vector search
+mpImpl->mbCurrentIsVectorGraphic = false;
 mpImpl->mpVectorGraphicSearch.reset();
 
 mpView->UnmarkAllObj (mpView->GetSdrPageView());
@@ -1205,6 +1206,7 @@ void SdOutliner::ProvideNextTextObject()
 bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && 
(maCurrentPosition.mePageKind != PageKind::Standard || 
maCurrentPosition.meEditMode != EditMode::Page);
 
 mpImpl->mbCurrentIsVectorGraphic = false;
+mpImpl->mpVectorGraphicSearch.reset();
 
 if (!bForbiddenPage)
 {
@@ -1238,34 +1240,30 @@ void SdOutliner::ProvideNextTextObject()
 OUString const & rString = mpSearchItem->GetSearchString();
 
 mpImpl->mpVectorGraphicSearch = 
std::make_unique(pGraphicObject->GetGraphic());
-if (mpImpl->mpVectorGraphicSearch->search(rString))
+
+bool bResult = 
mpImpl->mpVectorGraphicSearch->search(rString);
+if (bResult)
+bResult = mpImpl->mpVectorGraphicSearch->next();
+
+if (bResult)
 {
-bool bResult = mpImpl->mpVectorGraphicSearch->next();
-if (bResult)
-{
-mpObj = SetObject(maCurrentPosition);
+mpObj = SetObject(maCurrentPosition);
 
-mbStringFound = true;
-mbMatchMayExist = true;
-mbFoundObject = true;
+mbStringFound = true;
+mbMatchMayExist = true;
+mbFoundObject = true;
 
-SdrPageView* pPageView = mpView->GetSdrPageView();
-mpView->UnmarkAllObj(pPageView);
+SdrPageView* pPageView = mpView->GetSdrPageView();
+mpView->UnmarkAllObj(pPageView);
 
-std::vector aSubSelections;
-basegfx::B2DRectangle aSubSelection = 
getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
-if (!aSubSelection.isEmpty())
-aSubSelections.push_back(aSubSelection);
+std::vector aSubSelections;
+basegfx::B2DRectangle aSubSelection = 
getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
+if (!aSubSelection.isEmpty())
+aSubSelections.push_back(aSubSelection);
 
-mpView->MarkObj(mpObj, pPageView, false, false, 
aSubSelections);
+mpView->MarkObj(mpObj, pPageView, false, false, 
aSubSelections);
 
-mpDrawDocument->GetDocSh()->SetWaitCursor( false );
-}
-else
-{
-mpImpl->mbCurrentIsVectorGraphic = false;
-mpImpl->mpVectorGraphicSearch.reset();
-}
+mpDrawDocument->GetDocSh()->SetWaitCursor( false );
 }
 else
 {
@@ -1298,6 +1296,9 @@ void SdOutliner::ProvideNextTextObject()
 }
 else
 {
+mpImpl->mbCurrentIsVectorGraphic = false;
+mpImpl->mpVectorGraphicSearch.reset();
+
 if (meMode == SEARCH)
 // Instead of doing a full-blown SetObject(), which would do 
the same -- but would also possibly switch pages.
 mbStringFound = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedeskt

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   86 ++
 sd/qa/unit/tiledrendering/data/MixedTest1.odg |binary
 sd/source/ui/view/Outliner.cxx|2 
 3 files changed, 87 insertions(+), 1 deletion(-)

New commits:
commit f5c158d2cdc45df318d56fbc9108f0acb133bb92
Author: Tomaž Vajngerl 
AuthorDate: Sat May 30 15:47:35 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 21:01:09 2020 +0200

sd: fix issue when PDF search doesn't send a search result + test

This fixes the issue when PDF search doesn't send the search
result, because of premature exit.

Also add test which reproduces this issue and tests the behavior
of searching in multiple objects.

Change-Id: I3a676eeac36bde88c67e90a49583444b8595a346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95454
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 18f8340a697be7c076fe111d0bc42faf877b9202)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95940
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 8d8b11e43fa1..24037a0780ba 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -55,6 +55,7 @@ public:
 void testDontSearchInMasterPages();
 void testSearchInPDFNonExisting();
 void testSearchInPDF();
+void testSearchInMixedObject();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -65,6 +66,7 @@ public:
 CPPUNIT_TEST(testDontSearchInMasterPages);
 CPPUNIT_TEST(testSearchInPDFNonExisting);
 CPPUNIT_TEST(testSearchInPDF);
+CPPUNIT_TEST(testSearchInMixedObject);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -317,6 +319,90 @@ void LOKitSearchTest::testSearchInPDF()
  mpCallbackRecorder->m_aSelection[0]);
 }
 
+void LOKitSearchTest::testSearchInMixedObject()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+SdDrawDocument* pDocument = pXImpressDocument->GetDocShell()->GetDoc();
+CPPUNIT_ASSERT(pDocument);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+// Check we have one page
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), 
pDocument->GetSdPageCount(PageKind::Standard));
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+// Check page hase 2 objects only
+CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount());
+
+// Check Object 1
+{
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_TEXT), 
pObject->GetObjIdentifier());
+}
+
+// Check Object 2
+{
+SdrObject* pObject = pPage->GetObj(1);
+CPPUNIT_ASSERT(pObject);
+
+CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), 
pObject->GetObjIdentifier());
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVectorGraphicDataType());
+}
+
+// Let's try to search now
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OString("3546, 3174, 738, 402"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search next
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OString("8412, 6385, 519, 174"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+
+// Search next again - we should get the first object again
+
+lcl_search("ABC");
+
+CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(3, mpCallbackRecorder->m_nSearchResultCount);
+
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultPart.size());
+
+CPPUNIT_ASSERT_EQUAL(OStr

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source

2020-06-09 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8import/data/image-lazy-read-0size.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   16 
 sw/source/core/bastyp/swtypes.cxx |7 +++
 3 files changed, 23 insertions(+)

New commits:
commit 56a5e5d9fdbc1542c802d1dcb7ce84e99de85fcb
Author: Miklos Vajna 
AuthorDate: Mon Jun 8 21:05:07 2020 +0200
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:56:03 2020 +0200

tdf#133474 DOC import: fix lazy-loading of images with zero size

DOC typically contains images with a size hint outside the image, but
this is optional. Make sure that we load the image in case the size is
not available without loading.

The effect is that once SwWW8ImplReader::MapWrapIntoFlyFormat() calls
SwGrfNode::GetTwipSize(), we always get a valid size. Ideally without
loading the graphic.

(cherry picked from commit 369355da5c1e25bad7124dd6e187d9e381759751)

Change-Id: I81536ceb44c6e455e9bf274a5852008443f9d64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95907
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc
new file mode 100644
index ..80306cb1deda
Binary files /dev/null and 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 468cacfd0967..8d0eb0cc10c9 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -181,6 +181,22 @@ DECLARE_OOXMLIMPORT_TEST(testImageLazyRead, 
"image-lazy-read.doc")
 CPPUNIT_ASSERT(!aGraphic.isAvailable());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testImageLazyRead0size, "image-lazy-read-0size.doc")
+{
+// Load a document with a single bitmap in it: it's declared as a WMF one, 
but actually a TGA
+// bitmap.
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwNode* pNode = pDoc->GetNodes()[6];
+SwGrfNode* pGrfNode = pNode->GetGrfNode();
+CPPUNIT_ASSERT(pGrfNode);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 7590x10440
+// - Actual  : 0x0
+// i.e. the size was 0, even if the actual bitmap had a non-0 size.
+CPPUNIT_ASSERT_EQUAL(Size(7590, 10440), pGrfNode->GetTwipSize());
+}
+
 DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
 {
 // Ensure that all text portions are calculated before testing.
diff --git a/sw/source/core/bastyp/swtypes.cxx 
b/sw/source/core/bastyp/swtypes.cxx
index 620f4bab771a..59c01abb55cb 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -29,6 +29,13 @@ Size GetGraphicSizeTwip(const Graphic& rGraphic, 
vcl::RenderContext* pOutDev)
 {
 const MapMode aMapTwip(MapUnit::MapTwip);
 Size aSize(rGraphic.GetPrefSize());
+
+if (!aSize.getWidth() && !aSize.getHeight())
+{
+const_cast(rGraphic).makeAvailable();
+aSize = rGraphic.GetPrefSize();
+}
+
 if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
 {
 if (!pOutDev)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkobject.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 94dd6c84db201dd5fecdbdcad6c62f8337d0eaa9
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 15:08:34 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:53:06 2020 +0200

tdf#133822 mirror GtkSalObjectWidgetClip location for RTL

Change-Id: I4ab4a0fb8fc343ee9a4c66c58e20583482958f37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95889
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx
index 219805daed49..cb60406ec0e0 100644
--- a/vcl/unx/gtk3/gtk3gtkobject.cxx
+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx
@@ -359,7 +359,14 @@ void GtkSalObjectWidgetClip::ApplyClipRegion()
 allocation.height = m_aClipRect.GetHeight();
 }
 
-gtk_fixed_move(pContainer, m_pScrolledWindow, allocation.x, 
allocation.y);
+if (AllSettings::GetLayoutRTL())
+{
+GtkAllocation aParentAllocation;
+gtk_widget_get_allocation(GTK_WIDGET(pContainer), 
&aParentAllocation);
+gtk_fixed_move(pContainer, m_pScrolledWindow, 
aParentAllocation.width - allocation.width - 1 - allocation.x, allocation.y);
+}
+else
+gtk_fixed_move(pContainer, m_pScrolledWindow, allocation.x, 
allocation.y);
 gtk_widget_set_size_request(m_pScrolledWindow, allocation.width, 
allocation.height);
 gtk_widget_size_allocate(m_pScrolledWindow, &allocation);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkobject.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit fcd898c60093eeb5e81f8dc312edc768107c9380
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 15:08:34 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:52:44 2020 +0200

tdf#133822 mirror GtkSalObjectWidgetClip location for RTL

Change-Id: I4ab4a0fb8fc343ee9a4c66c58e20583482958f37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95951
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx
index 219805daed49..cb60406ec0e0 100644
--- a/vcl/unx/gtk3/gtk3gtkobject.cxx
+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx
@@ -359,7 +359,14 @@ void GtkSalObjectWidgetClip::ApplyClipRegion()
 allocation.height = m_aClipRect.GetHeight();
 }
 
-gtk_fixed_move(pContainer, m_pScrolledWindow, allocation.x, 
allocation.y);
+if (AllSettings::GetLayoutRTL())
+{
+GtkAllocation aParentAllocation;
+gtk_widget_get_allocation(GTK_WIDGET(pContainer), 
&aParentAllocation);
+gtk_fixed_move(pContainer, m_pScrolledWindow, 
aParentAllocation.width - allocation.width - 1 - allocation.x, allocation.y);
+}
+else
+gtk_fixed_move(pContainer, m_pScrolledWindow, allocation.x, 
allocation.y);
 gtk_widget_set_size_request(m_pScrolledWindow, allocation.width, 
allocation.height);
 gtk_widget_size_allocate(m_pScrolledWindow, &allocation);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/source/window/cursor.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 802f242500bc3c0e0e47e5b6b7863b620195eac6
Author: Caolán McNamara 
AuthorDate: Mon Jun 8 16:32:02 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:39:33 2020 +0200

tdf#133462 cursor missing in SQL textbox

(and spell checking, calc page format header/footer dialog, etc)

since...

commit c2f8929ed76085bc81f390f90e06bd6781206537
Date:   Wed May 29 23:33:25 2019 -0400

vcl: sfx2: LOK: Support per-view popup windows

I feel this is a mismerge where the point of

commit b9c10ee923308f336a694bbc0212396ed5317b6a
Date:   Wed Apr 3 12:02:13 2019 +0100

weld ClassificationDialog

to allow cursor drawing to a non-Window OutputDevice got clobbered

Change-Id: If693fd0ee83afc6e7f0ddce7b43b8cb6e3327116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95822
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index fbc2b2ec1d76..9eba6b2f603f 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -47,10 +47,6 @@ static tools::Rectangle ImplCursorInvert(vcl::RenderContext* 
pRenderContext, Imp
 {
 tools::Rectangle aPaintRect;
 
-vcl::Window* pWindow = pData ? pData->mpWindow.get() : nullptr;
-if (!pWindow || pWindow->IsDisposed())
-return aPaintRect;
-
 bool bMapMode = pRenderContext->IsMapModeEnabled();
 pRenderContext->EnableMapMode( false );
 InvertFlags nInvertStyle;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/source/window/cursor.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 6db6163dad0d8ac21ba69b2e361034b06f0a5a30
Author: Caolán McNamara 
AuthorDate: Mon Jun 8 16:32:02 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:38:53 2020 +0200

tdf#133462 cursor missing in SQL textbox

(and spell checking, calc page format header/footer dialog, etc)

since...

commit c2f8929ed76085bc81f390f90e06bd6781206537
Date:   Wed May 29 23:33:25 2019 -0400

vcl: sfx2: LOK: Support per-view popup windows

I feel this is a mismerge where the point of

commit b9c10ee923308f336a694bbc0212396ed5317b6a
Date:   Wed Apr 3 12:02:13 2019 +0100

weld ClassificationDialog

to allow cursor drawing to a non-Window OutputDevice got clobbered

Change-Id: If693fd0ee83afc6e7f0ddce7b43b8cb6e3327116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95844
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index fbc2b2ec1d76..9eba6b2f603f 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -47,10 +47,6 @@ static tools::Rectangle ImplCursorInvert(vcl::RenderContext* 
pRenderContext, Imp
 {
 tools::Rectangle aPaintRect;
 
-vcl::Window* pWindow = pData ? pData->mpWindow.get() : nullptr;
-if (!pWindow || pWindow->IsDisposed())
-return aPaintRect;
-
 bool bMapMode = pRenderContext->IsMapModeEnabled();
 pRenderContext->EnableMapMode( false );
 InvertFlags nInvertStyle;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/source/treelist/headbar.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit bff76e27eba1e496838f3673c3cea43fd535b7c7
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 12:25:26 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 20:34:33 2020 +0200

tdf#129856 invalidate old internal border if we scroll

and will redraw a new one

Change-Id: I2438af94e54f31c617cc183c61fbaaef31b5601f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95911
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx
index e87790e9dd97..7020c616bb69 100644
--- a/vcl/source/treelist/headbar.cxx
+++ b/vcl/source/treelist/headbar.cxx
@@ -1110,8 +1110,15 @@ void HeaderBar::Clear()
 
 void HeaderBar::SetOffset( long nNewOffset )
 {
+// tdf#129856 (see also #i40393#) invalidate old left and right border 
area if WB_BORDER was set in ImplInit()
+if (mnBorderOff1 && mnBorderOff2)
+{
+Invalidate(tools::Rectangle(0, 0, 1, mnDY));
+Invalidate(tools::Rectangle(mnDX - 1, 0, mnDX, mnDY));
+}
+
 // move area
-tools::Rectangle aRect( 0, mnBorderOff1, mnDX-1, 
mnDY-mnBorderOff1-mnBorderOff2-1 );
+tools::Rectangle aRect( 0, mnBorderOff1, mnDX-1, 
mnDY-mnBorderOff1-mnBorderOff2 );
 long nDelta = mnOffset-nNewOffset;
 mnOffset = nNewOffset;
 Scroll( nDelta, 0, aRect );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/source

2020-06-09 Thread Szymon Kłos (via logerrit)
 sfx2/source/notebookbar/PriorityHBox.hxx   |9 --
 sfx2/source/notebookbar/PriorityMergedHBox.cxx |  109 +++--
 2 files changed, 108 insertions(+), 10 deletions(-)

New commits:
commit 53d73d532281b6734a7d4614bb74fc6cc15510f0
Author: Szymon Kłos 
AuthorDate: Wed Jun 3 15:26:50 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jun 9 19:02:25 2020 +0200

notebookbar: simplify custom widgets

Change-Id: I0176a9852a0f405fba7b6308e28abf2ca0ae280e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95900
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/notebookbar/PriorityHBox.hxx 
b/sfx2/source/notebookbar/PriorityHBox.hxx
index 04b884ddffdf..7e797327642e 100644
--- a/sfx2/source/notebookbar/PriorityHBox.hxx
+++ b/sfx2/source/notebookbar/PriorityHBox.hxx
@@ -33,13 +33,14 @@
 
 class PriorityHBox : public VclHBox
 {
-private:
+protected:
 bool m_bInitialized;
 
 std::vector m_aSortedChildren;
 
-protected:
-int GetHiddenCount() const;
+virtual int GetHiddenCount() const;
+
+virtual void GetChildrenWithPriorities();
 
 public:
 explicit PriorityHBox(vcl::Window* pParent);
@@ -55,8 +56,6 @@ public:
 virtual void Resize() override;
 
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
-
-void GetChildrenWithPriorities();
 };
 
 #endif
diff --git a/sfx2/source/notebookbar/PriorityMergedHBox.cxx 
b/sfx2/source/notebookbar/PriorityMergedHBox.cxx
index 8a5bcd014c4d..bd7fd55b176f 100644
--- a/sfx2/source/notebookbar/PriorityMergedHBox.cxx
+++ b/sfx2/source/notebookbar/PriorityMergedHBox.cxx
@@ -23,6 +23,10 @@
 #include 
 #include "PriorityHBox.hxx"
 #include "NotebookbarPopup.hxx"
+#include 
+
+#define DUMMY_WIDTH 50
+#define BUTTON_WIDTH 30
 
 /*
 * PriorityMergedHBox is a VclHBox which hides its own children if there is no 
sufficient space.
@@ -54,7 +58,60 @@ public:
 
 virtual void Resize() override
 {
-PriorityHBox::Resize();
+if (!m_bInitialized && SfxViewFrame::Current())
+Initialize();
+
+if (!m_bInitialized)
+{
+return VclHBox::Resize();
+}
+
+long nWidth = GetSizePixel().Width();
+long nCurrentWidth = VclHBox::calculateRequisition().getWidth() + 
BUTTON_WIDTH;
+
+// Hide lower priority controls
+for (int i = GetChildCount() - 1; i >= 0; i--)
+{
+vcl::Window* pWindow = GetChild(i);
+
+if (nCurrentWidth <= nWidth)
+break;
+
+if (pWindow && pWindow->GetParent() == this && 
pWindow->IsVisible())
+{
+if (pWindow->GetOutputWidthPixel())
+nCurrentWidth -= pWindow->GetOutputWidthPixel();
+else
+nCurrentWidth -= DUMMY_WIDTH;
+pWindow->Hide();
+}
+}
+
+// Show higher priority controls if we already have enough space
+for (int i = 0; i < GetChildCount(); i++)
+{
+vcl::Window* pWindow = GetChild(i);
+
+if (pWindow->GetParent() != this)
+{
+continue;
+}
+
+if (pWindow && !pWindow->IsVisible())
+{
+pWindow->Show();
+nCurrentWidth += getLayoutRequisition(*pWindow).Width() + 
get_spacing();
+
+if (nCurrentWidth > nWidth)
+{
+pWindow->Hide();
+break;
+}
+}
+}
+
+VclHBox::Resize();
+
 if (GetHiddenCount())
 m_pButton->Show();
 else
@@ -68,6 +125,51 @@ public:
 m_pPopup.disposeAndClear();
 PriorityHBox::dispose();
 }
+
+int GetHiddenCount() const override
+{
+int nCount = 0;
+
+for (int i = GetChildCount() - 1; i >= 0; i--)
+{
+vcl::Window* pWindow = GetChild(i);
+if (pWindow && pWindow->GetParent() == this && 
!pWindow->IsVisible())
+nCount++;
+}
+
+return nCount;
+}
+
+Size calculateRequisition() const override
+{
+if (!m_bInitialized)
+{
+return VclHBox::calculateRequisition();
+}
+
+sal_uInt16 nVisibleChildren = 0;
+
+Size aSize;
+for (vcl::Window* pChild = GetWindow(GetWindowType::FirstChild); 
pChild;
+ pChild = pChild->GetWindow(GetWindowType::Next))
+{
+if (!pChild->IsVisible())
+continue;
+++nVisibleChildren;
+Size aChildSize = getLayoutRequisition(*pChild);
+
+long nPrimaryDimension = getPrimaryDimension(aChildSize);
+nPrimaryDimension += pChild->get_padding() * 2;
+setPrimaryDimension(aChildSize, nPrimaryDimension);
+
+accumulateMaxes(aChildSize, aSize);
+}
+
+setPrimaryDimension(aSi

[Libreoffice-commits] core.git: sw/qa

2020-06-09 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/layout/layout.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 362b949a3bd907d6cb1ed94ef415696c88d838a8
Author: Miklos Vajna 
AuthorDate: Tue Jun 9 12:03:35 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 18:41:14 2020 +0200

CppunitTest_sw_layoutwriter: disable unstable testShapeAllowOverlap on 
Windows

Seen failing e.g. at
, but
interestingly never on Linux.

Change-Id: Iba701f642432c8d5785d3c4c40e4914633ff0e5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95908
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index df50e7f9e253..ae7c0fffc1a3 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3501,8 +3501,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127235)
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testShapeAllowOverlap)
 {
-// Need to find out why this fails on macOS.
-#ifndef MACOSX
+// Need to find out why this fails on macOS and why this is unstable on 
Windows.
+#if !defined(MACOSX) && !defined(_WIN32)
 // Create an empty document with two, intentionally overlapping shapes.
 // Set their AllowOverlap property to false.
 loadURL("private:factory/swriter", nullptr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2020-06-09 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/writer_tests/data/tdf132596.docx |binary
 sw/qa/uitest/writer_tests7/tdf132596.py   |   49 ++
 2 files changed, 49 insertions(+)

New commits:
commit 2ea830c2877f30cf3ac6f261a399c414dd9968c8
Author: Xisco Fauli 
AuthorDate: Tue Jun 9 11:21:10 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 9 18:29:53 2020 +0200

tdf#132596: sw: Add UItest

Change-Id: I899de72a02a7501917b13346d304338bb4548ea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95902
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/uitest/writer_tests/data/tdf132596.docx 
b/sw/qa/uitest/writer_tests/data/tdf132596.docx
new file mode 100644
index ..f19213ae1391
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf132596.docx 
differ
diff --git a/sw/qa/uitest/writer_tests7/tdf132596.py 
b/sw/qa/uitest/writer_tests7/tdf132596.py
new file mode 100644
index ..6cfbf5e94be2
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf132596.py
@@ -0,0 +1,49 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.path import get_srcdir_url
+
+def get_url_for_data_file(file_name):
+return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
+class tdf132596(UITestCase):
+
+def test_tdf132596(self):
+writer_doc = 
self.ui_test.load_file(get_url_for_data_file("tdf132596.docx"))
+
+document = self.ui_test.get_component()
+self.assertEqual(2, document.CurrentController.PageCount)
+
+self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:Copy")
+self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+xDialog = self.xUITest.getTopFocusWindow()
+
+xList = xDialog.getChild('list')
+
+for childName in xList.getChildren():
+xChild = xList.getChild(childName)
+if get_state_as_dict(xChild)['Text'] == "Rich text formatting 
(RTF)":
+break
+
+xChild.executeAction("SELECT", tuple())
+self.assertEqual(get_state_as_dict(xList)['SelectEntryText'], "Rich 
text formatting (RTF)")
+
+xOkBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOkBtn)
+
+self.xUITest.executeCommand(".uno:Undo")
+# Without the fix in place, it would have crashed here
+
+self.assertEqual(2, document.CurrentController.PageCount)
+
+self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2020-06-09 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/writer_tests7/tdf131963.py |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 8a88f898313a01a8408a2e66b62b66899bb9faac
Author: Xisco Fauli 
AuthorDate: Tue Jun 9 11:07:31 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 9 18:29:22 2020 +0200

tdf#133169: sw: Add UItest

Change-Id: I6d86e8f8ef1b1ffe32e45c7ead75387f6fcee2fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95901
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/uitest/writer_tests7/tdf131963.py 
b/sw/qa/uitest/writer_tests7/tdf131963.py
index 6039ab569fec..97cebcc4cedc 100644
--- a/sw/qa/uitest/writer_tests7/tdf131963.py
+++ b/sw/qa/uitest/writer_tests7/tdf131963.py
@@ -17,6 +17,9 @@ class tdf131963(UITestCase):
 def test_tdf131963(self):
 writer_doc = 
self.ui_test.load_file(get_url_for_data_file("tdf131963.docx"))
 
+document = self.ui_test.get_component()
+self.assertEqual(11, document.CurrentController.PageCount)
+
 self.xUITest.executeCommand(".uno:SelectAll")
 self.xUITest.executeCommand(".uno:Copy")
 self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
@@ -37,6 +40,9 @@ class tdf131963(UITestCase):
 
 # Without the fix in place, it would have crashed here
 
+# tdf#133169: without the fix in place, it would have been 2 instead 
of 11
+self.assertEqual(11, document.CurrentController.PageCount)
+
 self.ui_test.close_doc()
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a009c83fa270d4b0c480b4b06f7d8efc82b64515
Author: Michael Meeks 
AuthorDate: Tue Jun 9 15:50:59 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jun 9 18:08:44 2020 +0200

Pre-select base filename on rename click / focus.

Change-Id: I62fb629dc6021ab8cd60b46f73e8d9e39c2da4e0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95953
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 13f83c4d2..090cc25f9 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -56,6 +56,12 @@ L.Control.DocumentNameInput = L.Control.extend({
onDocumentNameFocus: function() {
// hide the caret in the main document
this.map._onLostFocus();
+   var name = this.map['wopi'].BaseFileName;
+   var extn = name.lastIndexOf('.');
+   if (extn < 0)
+   extn = name.length;
+   $('#document-name-input').val(name);
+   $('#document-name-input')[0].setSelectionRange(0, extn);
},
 
onDocLayerInit: function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/qa sw/source

2020-06-09 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8import/data/image-lazy-read-0size.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   16 
 sw/source/core/bastyp/swtypes.cxx |7 +++
 3 files changed, 23 insertions(+)

New commits:
commit 162d1babb958502ee98486d2b98cfd8a45b53ba1
Author: Miklos Vajna 
AuthorDate: Mon Jun 8 21:05:07 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 18:05:28 2020 +0200

tdf#133474 DOC import: fix lazy-loading of images with zero size

DOC typically contains images with a size hint outside the image, but
this is optional. Make sure that we load the image in case the size is
not available without loading.

The effect is that once SwWW8ImplReader::MapWrapIntoFlyFormat() calls
SwGrfNode::GetTwipSize(), we always get a valid size. Ideally without
loading the graphic.

(cherry picked from commit 369355da5c1e25bad7124dd6e187d9e381759751)

Change-Id: I81536ceb44c6e455e9bf274a5852008443f9d64f

diff --git a/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc
new file mode 100644
index ..80306cb1deda
Binary files /dev/null and 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index 250a32832752..1ea8fb0cc222 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -193,6 +193,22 @@ DECLARE_OOXMLIMPORT_TEST(testImageLazyRead, 
"image-lazy-read.doc")
 CPPUNIT_ASSERT(!aGraphic.isAvailable());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testImageLazyRead0size, "image-lazy-read-0size.doc")
+{
+// Load a document with a single bitmap in it: it's declared as a WMF one, 
but actually a TGA
+// bitmap.
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwNode* pNode = pDoc->GetNodes()[6];
+SwGrfNode* pGrfNode = pNode->GetGrfNode();
+CPPUNIT_ASSERT(pGrfNode);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 7590x10440
+// - Actual  : 0x0
+// i.e. the size was 0, even if the actual bitmap had a non-0 size.
+CPPUNIT_ASSERT_EQUAL(Size(7590, 10440), pGrfNode->GetTwipSize());
+}
+
 DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
 {
 // Ensure that all text portions are calculated before testing.
diff --git a/sw/source/core/bastyp/swtypes.cxx 
b/sw/source/core/bastyp/swtypes.cxx
index 620f4bab771a..59c01abb55cb 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -29,6 +29,13 @@ Size GetGraphicSizeTwip(const Graphic& rGraphic, 
vcl::RenderContext* pOutDev)
 {
 const MapMode aMapTwip(MapUnit::MapTwip);
 Size aSize(rGraphic.GetPrefSize());
+
+if (!aSize.getWidth() && !aSize.getHeight())
+{
+const_cast(rGraphic).makeAvailable();
+aSize = rGraphic.GetPrefSize();
+}
+
 if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
 {
 if (!pOutDev)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dialogs/searchresults.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 8f364a1f2786be2a9c0953f9548765928c0610ae
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 10:01:32 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 17:51:31 2020 +0200

tdf#133807 represent a visible search dialog when search results is closed

Change-Id: If38b2770cfdd7d88bb75cbd47f44cc8515c4e041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95883
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index 76cffa4664a5..11e670fae161 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -10,6 +10,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,6 +41,19 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 
 SearchResultsDlg::~SearchResultsDlg()
 {
+// tdf#133807 if the search dialog is shown then re-present that dialog
+// when this results dialog is dismissed
+SfxViewFrame* pViewFrame = mpBindings->GetDispatcher()->GetFrame();
+if (!pViewFrame)
+return;
+SfxChildWindow* pChildWindow = pViewFrame->GetChildWindow(
+SvxSearchDialogWrapper::GetChildWindowId());
+if (!pChildWindow)
+return;
+SvxSearchDialog* pSearchDlg = 
static_cast(pChildWindow->GetController().get());
+if (!pSearchDlg)
+return;
+pSearchDlg->getDialog()->present();
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/inc desktop/source include/editeng include/sfx2 include/svl sc/source sd/source sfx2/source starmath/source sw/source

2020-06-09 Thread Tor Lillqvist (via logerrit)
 desktop/inc/lib/init.hxx |3 -
 desktop/source/lib/init.cxx  |   14 -
 include/editeng/outliner.hxx |2 
 include/sfx2/lokhelper.hxx   |   12 +++-
 include/sfx2/viewsh.hxx  |2 
 include/svl/undo.hxx |2 
 sc/source/ui/docshell/dbdocfun.cxx   |4 -
 sc/source/ui/docshell/docsh4.cxx |5 +-
 sc/source/ui/docshell/olinefun.cxx   |9 +--
 sc/source/ui/inc/tabvwsh.hxx |5 --
 sc/source/ui/undo/undoblk.cxx|8 +--
 sc/source/ui/undo/undodat.cxx|   10 ++--
 sc/source/ui/view/dbfunc3.cxx|7 +-
 sc/source/ui/view/gridwin.cxx|5 +-
 sc/source/ui/view/gridwin4.cxx   |4 -
 sc/source/ui/view/tabview4.cxx   |2 
 sc/source/ui/view/tabview5.cxx   |3 -
 sc/source/ui/view/tabvwsh4.cxx   |   15 --
 sc/source/ui/view/tabvwshc.cxx   |   14 +
 sc/source/ui/view/viewfun2.cxx   |4 -
 sc/source/ui/view/viewfunc.cxx   |   17 ---
 sd/source/ui/sidebar/SlideBackground.cxx |   10 ++--
 sfx2/source/view/lokcharthelper.cxx  |4 -
 sfx2/source/view/lokhelper.cxx   |   75 ++-
 sfx2/source/view/viewimp.hxx |1 
 sfx2/source/view/viewsh.cxx  |   19 ++-
 starmath/source/smmod.cxx|3 +
 sw/source/core/doc/docredln.cxx  |3 -
 sw/source/core/text/txtcache.cxx |2 
 29 files changed, 185 insertions(+), 79 deletions(-)

New commits:
commit a22cba07a470385dcb930c56c90cba81b317773e
Author: Tor Lillqvist 
AuthorDate: Tue Jun 2 12:46:51 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jun 9 17:24:17 2020 +0200

tdf#128502: Try to support multiple documents in LibreOfficeKit-using 
process

The LibreOfficeKit-specific code typically has assumed that all the
"views" (SfxViewShell instances) are for the same document, because
all LibreOfficeKit-based application processes (including the "kit"
processes in Online and the iOS app) so far have only had one document
open at a time.

It is now possible to pass several document file names on the command
line to gtktiledviewer and that is an easy way to demonstrate how
badly it still works even with this patch.

Introduce a unique numeric document id that is increased in the
LibLODocument_Impl constructor. Add APIs to access that. When
iterating over views, try to skip views that are not of the document
visible in the "current" view, if we know what the "current" view is.

Also add a couple of FIXMEs at places where it is a bit unclear (to
me) whether it is correct to iterate over all views, or whether only
views for the "current" document are what we would want.

Change-Id: Id5ebb92a115723cdeb23907163d5b5f282016252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95353
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 568c1fe9e3e1..69dd6103a5bd 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -149,8 +149,9 @@ namespace desktop {
 css::uno::Reference mxComponent;
 std::shared_ptr< LibreOfficeKitDocumentClass > m_pDocumentClass;
 std::map> 
mpCallbackFlushHandlers;
+const int mnDocumentId;
 
-explicit LibLODocument_Impl(const css::uno::Reference 
 &xComponent);
+explicit LibLODocument_Impl(const css::uno::Reference 
 &xComponent, int nDocumentId = -1);
 ~LibLODocument_Impl();
 };
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5a9bd8c94a85..1b8013350983 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1173,8 +1173,9 @@ rtl::Reference 
forceSetClipboardForCurrentView(LibreOfficeKitDocum
 
 } // anonymous namespace
 
-LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
 &xComponent)
+LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
 &xComponent, int nDocumentId)
 : mxComponent(xComponent)
+, mnDocumentId(nDocumentId)
 {
 m_pDocumentClass = gDocumentClass.lock();
 if (!m_pDocumentClass)
@@ -2114,6 +2115,8 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 
 SolarMutexGuard aGuard;
 
+static int nDocumentIdCounter = 0;
+
 LibLibreOffice_Impl* pLib = static_cast(pThis);
 pLib->maLastExceptionMsg.clear();
 
@@ -2210,7 +2213,10 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 return nullptr;
 }
 
-LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent);
+LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent, 
nDocumentIdCounter++);
+
+// Do we know that after loading the document, its initial view is the 
"current" v

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source

2020-06-09 Thread Tor Lillqvist (via logerrit)
 sc/source/ui/view/gridwin.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit bdf5f18ebb2c2f3d33e16fa9b9cfef82776fac61
Author: Tor Lillqvist 
AuthorDate: Tue Jun 9 13:24:59 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jun 9 17:20:31 2020 +0200

Prevent soffice.bin from aborting in the autofilter UITest in a debug build

Apparently a superfluous line was added accidentally in
cd7539be13dee445c643e43547313c57e01f9391, causing a leak of vcl window
objects.

Without this commit, the Application::Abort() is called from the check
in Window::dispose() in vcl/source/window/window.cxx.

Change-Id: I358d97ac37e5a86880d5372d553baa6e1e59d7af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95909
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 4751dcb77b63..ada73c648509 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -638,7 +638,6 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 // If NWF renders the focus rects itself, that breaks double-buffering.
 mpAutoFilterPopup->RequestDoubleBuffering(true);
 
-mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc));
 if (bLOKActive)
 mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
 mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, 
AutoFilterMode::Normal));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa sw/source

2020-06-09 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8import/data/image-lazy-read-0size.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx  |   16 
 sw/source/core/bastyp/swtypes.cxx |7 +++
 3 files changed, 23 insertions(+)

New commits:
commit 2da8c272528386e38deb679712adb879f2f412b2
Author: Miklos Vajna 
AuthorDate: Mon Jun 8 21:05:07 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 16:56:02 2020 +0200

tdf#133474 DOC import: fix lazy-loading of images with zero size

DOC typically contains images with a size hint outside the image, but
this is optional. Make sure that we load the image in case the size is
not available without loading.

The effect is that once SwWW8ImplReader::MapWrapIntoFlyFormat() calls
SwGrfNode::GetTwipSize(), we always get a valid size. Ideally without
loading the graphic.

(cherry picked from commit 369355da5c1e25bad7124dd6e187d9e381759751)

Change-Id: I81536ceb44c6e455e9bf274a5852008443f9d64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95897
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc
new file mode 100644
index ..80306cb1deda
Binary files /dev/null and 
b/sw/qa/extras/ww8import/data/image-lazy-read-0size.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx 
b/sw/qa/extras/ww8import/ww8import.cxx
index dfbd496a31df..8a085472ea4a 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -186,6 +186,22 @@ DECLARE_OOXMLIMPORT_TEST(testImageLazyRead, 
"image-lazy-read.doc")
 CPPUNIT_ASSERT(!aGraphic.isAvailable());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testImageLazyRead0size, "image-lazy-read-0size.doc")
+{
+// Load a document with a single bitmap in it: it's declared as a WMF one, 
but actually a TGA
+// bitmap.
+SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+SwNode* pNode = pDoc->GetNodes()[6];
+SwGrfNode* pGrfNode = pNode->GetGrfNode();
+CPPUNIT_ASSERT(pGrfNode);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 7590x10440
+// - Actual  : 0x0
+// i.e. the size was 0, even if the actual bitmap had a non-0 size.
+CPPUNIT_ASSERT_EQUAL(Size(7590, 10440), pGrfNode->GetTwipSize());
+}
+
 DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
 {
 // Ensure that all text portions are calculated before testing.
diff --git a/sw/source/core/bastyp/swtypes.cxx 
b/sw/source/core/bastyp/swtypes.cxx
index 620f4bab771a..59c01abb55cb 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -29,6 +29,13 @@ Size GetGraphicSizeTwip(const Graphic& rGraphic, 
vcl::RenderContext* pOutDev)
 {
 const MapMode aMapTwip(MapUnit::MapTwip);
 Size aSize(rGraphic.GetPrefSize());
+
+if (!aSize.getWidth() && !aSize.getHeight())
+{
+const_cast(rGraphic).makeAvailable();
+aSize = rGraphic.GetPrefSize();
+}
+
 if (MapUnit::MapPixel == rGraphic.GetPrefMapMode().GetMapUnit())
 {
 if (!pOutDev)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

2020-06-09 Thread Michael Stahl (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit a9c0c16ae407b1708df770f669290fd8334150ff
Author: Michael Stahl 
AuthorDate: Mon Jun 8 17:24:18 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:38:02 2020 +0200

tdf#133604 sw: DOCX export: put CH_TXT_ATR_FORMELEMENT in its own run

Commit b03fefcc4dbdfee3b9eeb5fa0e586dd12ddcd3d2 ought to have fixed this
but didn't; the run following the CH_TXT_ATR_FORMELEMENT still ended up
inside the field result.

But when importing that into Writer, it appeared correct; Word shows the
problem.

(regression from 94e0b8407b02d76b27324b8b08012eb024aca9e9)

Change-Id: I1fc1328223353422a83d403e8f790d156dbec4e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95843
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95881
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index bec214a2830e..763e4669 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -252,7 +252,11 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
 }
 sal_Int32 fieldSepPos = aText.indexOf(CH_TXT_ATR_FIELDSEP, nStartPos);
 sal_Int32 fieldStartPos = aText.indexOf(CH_TXT_ATR_FIELDSTART, nStartPos);
-sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, 
nStartPos);
+sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, nStartPos 
- 1);
+if (0 <= formElementPos && formElementPos < nStartPos)
+{
+++formElementPos; // tdf#133604 put this in its own run
+}
 
 const sal_Int32 pos = lcl_getMinPos(
 lcl_getMinPos(lcl_getMinPos(fieldEndPos, fieldSepPos), fieldStartPos),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/core/text/porlay.cxx |   24 
 1 file changed, 24 insertions(+)

New commits:
commit dadba793c107cbf2ccadfbd7b41b6187ff06d4b8
Author: Serge Krot 
AuthorDate: Mon Jun 8 12:43:53 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:36:14 2020 +0200

tdf#101856 evaluate condition to expand / collapse bookmarks

Change-Id: I7c135eab0feeca0ede794f6c88a2b06e339d6a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95795
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 499dac050009..b9ed4ec5a393 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -48,9 +48,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -2515,7 +2517,29 @@ void SwScriptInfo::selectHiddenTextProperty(const 
SwTextNode& rNode,
 pBookmarks->emplace_back(pBookmark, MarkKind::End);
 }
 }
+
+bool bHide = false;
 if (pBookmark && pBookmark->IsHidden())
+{
+// bookmark is marked as hidden
+bHide = true;
+
+// bookmark is marked as hidden with conditions
+if (!pBookmark->GetHideCondition().isEmpty())
+{
+SwDoc& rDoc = *const_cast(rNode.GetDoc());
+SwCalc aCalc(rDoc);
+rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, 
rNode.GetIndex(), USHRT_MAX);
+
+SwSbxValue aValue = 
aCalc.Calculate(pBookmark->GetHideCondition());
+if(!aValue.IsVoidValue())
+{
+bHide = aValue.GetBool();
+}
+}
+}
+
+if (bHide)
 {
 // intersect bookmark range with textnode range and add the 
intersection to rHiddenMulti
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/source

2020-06-09 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit ed0225b36ca31bb40a20de92cd1f988f94143ad1
Author: Serge Krot 
AuthorDate: Thu Jun 4 11:14:39 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:33:51 2020 +0200

tdf#133595 FILESAVE XLSX: invalid content when opening file with shape

Change-Id: I67fe29bbc9b982328a3efe63874922e7ed1a5854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95490
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 2081ab036bfd203d4d3be07064ef783baae97c3b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95671
Reviewed-by: Xisco Fauli 
(cherry picked from commit 23506180a82bae5c77bd1df4bef73dd4f687dae2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95880

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 277f3157afd7..37c55e9d629c 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -277,6 +277,21 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm )
 
 void SaveFormControlObjects(XclExpObjList& rList, XclExpXmlStream& rStrm)
 {
+bool hasControls = false;
+for (const auto& rxObj : rList)
+{
+if (IsFormControlObject(rxObj.get()))
+{
+hasControls = true;
+break;
+}
+}
+
+if (!hasControls)
+{
+return;
+}
+
 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
 
 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dialogs/searchresults.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 3dc30ae62f593a7130b5fe8f6e3b7febe845dde7
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 10:01:32 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 16:27:48 2020 +0200

tdf#133807 represent a visible search dialog when search results is closed

Change-Id: If38b2770cfdd7d88bb75cbd47f44cc8515c4e041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95899
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index 8032a7962549..b1b0e45aec5f 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -10,6 +10,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -41,6 +43,19 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 
 SearchResultsDlg::~SearchResultsDlg()
 {
+// tdf#133807 if the search dialog is shown then re-present that dialog
+// when this results dialog is dismissed
+SfxViewFrame* pViewFrame = mpBindings->GetDispatcher()->GetFrame();
+if (!pViewFrame)
+return;
+SfxChildWindow* pChildWindow = pViewFrame->GetChildWindow(
+SvxSearchDialogWrapper::GetChildWindowId());
+if (!pChildWindow)
+return;
+SvxSearchDialog* pSearchDlg = 
static_cast(pChildWindow->GetController().get());
+if (!pSearchDlg)
+return;
+pSearchDlg->getDialog()->present();
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source sw/uiconfig

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/ui/misc/bookmark.cxx   |3 +++
 sw/uiconfig/swriter/ui/insertbookmark.ui |7 ---
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit ce8087a61350f1f51cf0a75a1a5698183b3e17db
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:27:17 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95938
Tested-by: Vasily Melenchuk 
Reviewed-by: Vasily Melenchuk 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 3c99ab0c6848..e5be414d7bdb 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -344,6 +344,9 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 m_xConditionED->set_visible( false );
 }
 
+// disabled until "Hide" flag is not checked
+m_xConditionED->set_sensitive(false);
+m_xConditionFT->set_sensitive(false);
 }
 
 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index f062451af767..8b65bfc619b9 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -71,9 +71,9 @@
 
   
   
-True
-True
-6
+False
+False
+7
   
 
 
@@ -145,6 +145,7 @@
 True
 False
 start
+start
 True
 True
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sd/uiconfig

2020-06-09 Thread andreas kainz (via logerrit)
 sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui|  124 +-
 sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui |  172 +++---
 sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui|  164 ++---
 3 files changed, 230 insertions(+), 230 deletions(-)

New commits:
commit e37bab8d55862620c25a6de44ff7909694f1d862
Author: andreas kainz 
AuthorDate: Sun Jun 7 23:42:45 2020 +0200
Commit: Andreas Kainz 
CommitDate: Tue Jun 9 16:03:54 2020 +0200

tdf#127122 Sync View and Review group in groupedbar apps

Change-Id: I3b583ef79e651385a044f47b17684a21541467db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95771
Tested-by: Jenkins
Reviewed-by: Andreas Kainz 🦅 
(cherry picked from commit 08c3a7b74037812eda566924d3d8696768461fb8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95879
Reviewed-by: Andreas Kainz 

diff --git a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui 
b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
index 3d8998f4b711..0b580540e368 100644
--- a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
+++ b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
@@ -3950,11 +3950,11 @@
   
 
 
-  
+  
 True
 False
 
-  
+  
 True
 False
 5
@@ -3969,21 +3969,21 @@
   
 
 
-  
+  
 True
 False
 vertical
 
-  
+  
 True
 True
 icons
 False
 
-  
+  
 True
 False
-.uno:Zoom
+.uno:SpellDialog
   
   
 False
@@ -3991,10 +3991,10 @@
   
 
 
-  
+  
 True
 False
-.uno:PageMode
+.uno:InsertAnnotation
   
   
 False
@@ -4002,10 +4002,10 @@
   
 
 
-  
+  
 True
 False
-.uno:MasterPage
+.uno:GridVisible
   
   
 False
@@ -4020,12 +4020,12 @@
   
 
 
-  
+  
 True
 False
 
-  
-_View
+  
+_Review
 True
 True
 False
@@ -4035,7 +4035,7 @@
   
   
 False
-False
+True
 0
   
 
@@ -4043,7 +4043,7 @@
   
 False
 True
-2
+1
   
 
   
@@ -4064,11 +4064,11 @@
   
 
 
-  
+  
 True
 False
 
-  
+  
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/graphic/VectorGraphicSearch.cxx |   45 +
 1 file changed, 45 insertions(+)

New commits:
commit 8c0776fb005cb99a1f8e289f26173bec9c246585
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 12:13:59 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:33:53 2020 +0200

vcl: use HAVE_FEATURE_PDFIUM in VectorGraphicSearch impl.

Change-Id: Id6c30e8f1c5bdb0481b0c7d4680554e3e8caa323
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95393
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 67f7a26c047ae2878e3ecd76f83af3941b9079c3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95935
Tested-by: Tomaž Vajngerl 

diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index 911c19cebd38..a719329b7708 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -10,6 +10,10 @@
 
 #include 
 
+#include 
+
+#if HAVE_FEATURE_PDFIUM
+
 #include 
 
 #include 
@@ -289,4 +293,45 @@ std::vector 
VectorGraphicSearch::getTextRectangles()
 return std::vector();
 }
 
+#else // !HAVE_FEATURE_PDFIUM
+
+class VectorGraphicSearch::Implementation
+{
+};
+
+VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
+: maGraphic(rGraphic)
+{
+}
+
+VectorGraphicSearch::~VectorGraphicSearch() {}
+
+bool VectorGraphicSearch::search(OUString const& /*rSearchString*/,
+ SearchStartPosition /*eStartPosition*/)
+{
+return false;
+}
+
+bool VectorGraphicSearch::searchPDF(std::shared_ptr const& 
/*rData*/,
+OUString const& /*rSearchString*/,
+SearchStartPosition /*eStartPosition*/)
+{
+return false;
+}
+
+basegfx::B2DSize VectorGraphicSearch::pageSize() { return basegfx::B2DSize(); }
+
+bool VectorGraphicSearch::next() { return false; }
+
+bool VectorGraphicSearch::previous() { return false; }
+
+int VectorGraphicSearch::index() { return -1; }
+
+std::vector VectorGraphicSearch::getTextRectangles()
+{
+return std::vector();
+}
+
+#endif // HAVE_FEATURE_PDFIUM
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|3 -
 vcl/source/graphic/VectorGraphicSearch.cxx |   76 +++--
 2 files changed, 40 insertions(+), 39 deletions(-)

New commits:
commit 044cfb405e44c5df25bccd6e421a1a228262a963
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 12:02:39 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:28:53 2020 +0200

vcl: VectorGraphicSearch - move SearchContext into Implementation

Change-Id: I3bbf085fd8b8b66a56e364168c1e70b4ce986467
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95392
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 978198a055972aff00f47b70ca79e6322a5fbac3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95934

diff --git a/include/vcl/VectorGraphicSearch.hxx 
b/include/vcl/VectorGraphicSearch.hxx
index b67c63a844d8..2dc8cca3b76a 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -19,8 +19,6 @@
 
 #include 
 
-class SearchContext;
-
 enum class SearchStartPosition
 {
 Begin,
@@ -33,7 +31,6 @@ private:
 class Implementation;
 std::unique_ptr mpImplementation;
 Graphic maGraphic;
-std::unique_ptr mpSearchContext;
 
 bool searchPDF(std::shared_ptr const& rData, OUString 
const& rSearchString,
SearchStartPosition eStartPosition);
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index 5c4022685f71..911c19cebd38 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -17,25 +17,8 @@
 #include 
 #include 
 
-class VectorGraphicSearch::Implementation
+namespace
 {
-public:
-std::shared_ptr mpPDFium;
-FPDF_DOCUMENT mpPdfDocument;
-
-Implementation()
-: mpPDFium(vcl::pdf::PDFiumLibrary::get())
-, mpPdfDocument(nullptr)
-{
-}
-
-~Implementation()
-{
-if (mpPdfDocument)
-FPDF_CloseDocument(mpPdfDocument);
-}
-};
-
 class SearchContext
 {
 private:
@@ -181,17 +164,38 @@ public:
 }
 };
 
+} // end anonymous namespace
+
+class VectorGraphicSearch::Implementation
+{
+public:
+std::shared_ptr mpPDFium;
+FPDF_DOCUMENT mpPdfDocument;
+
+std::unique_ptr mpSearchContext;
+
+Implementation()
+: mpPDFium(vcl::pdf::PDFiumLibrary::get())
+, mpPdfDocument(nullptr)
+{
+}
+
+~Implementation()
+{
+mpSearchContext.reset();
+
+if (mpPdfDocument)
+FPDF_CloseDocument(mpPdfDocument);
+}
+};
+
 VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
 : mpImplementation(std::make_unique())
 , maGraphic(rGraphic)
 {
 }
 
-VectorGraphicSearch::~VectorGraphicSearch()
-{
-mpSearchContext.reset();
-mpImplementation.reset();
-}
+VectorGraphicSearch::~VectorGraphicSearch() { mpImplementation.reset(); }
 
 bool VectorGraphicSearch::search(OUString const& rSearchString, 
SearchStartPosition eStartPosition)
 {
@@ -242,45 +246,45 @@ bool 
VectorGraphicSearch::searchPDF(std::shared_ptr const& rD
 
 sal_Int32 nPageIndex = std::max(rData->getPageIndex(), sal_Int32(0));
 
-mpSearchContext.reset(new SearchContext(mpImplementation->mpPdfDocument, 
nPageIndex,
-rSearchString, eStartPosition));
+mpImplementation->mpSearchContext.reset(new SearchContext(
+mpImplementation->mpPdfDocument, nPageIndex, rSearchString, 
eStartPosition));
 
-return mpSearchContext->initialize();
+return mpImplementation->mpSearchContext->initialize();
 }
 
 basegfx::B2DSize VectorGraphicSearch::pageSize()
 {
 basegfx::B2DSize aSize;
-if (mpSearchContext)
-aSize = mpSearchContext->getPageSize();
+if (mpImplementation->mpSearchContext)
+aSize = mpImplementation->mpSearchContext->getPageSize();
 return aSize;
 }
 
 bool VectorGraphicSearch::next()
 {
-if (mpSearchContext)
-return mpSearchContext->next();
+if (mpImplementation->mpSearchContext)
+return mpImplementation->mpSearchContext->next();
 return false;
 }
 
 bool VectorGraphicSearch::previous()
 {
-if (mpSearchContext)
-return mpSearchContext->previous();
+if (mpImplementation->mpSearchContext)
+return mpImplementation->mpSearchContext->previous();
 return false;
 }
 
 int VectorGraphicSearch::index()
 {
-if (mpSearchContext)
-return mpSearchContext->index();
+if (mpImplementation->mpSearchContext)
+return mpImplementation->mpSearchContext->index();
 return -1;
 }
 
 std::vector VectorGraphicSearch::getTextRectangles()
 {
-if (mpSearchContext)
-return mpSearchContext->getTextRectangles();
+if (mpImplementation->mpSearchContext)
+return mpImplementation->mpSearchContext->getTextRectangles();
 
 return std::vector();
 }
___
Libreoffice-commits mailing

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/graphic/VectorGraphicSearch.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit c1a973678474c9775730ae577ec349b76ff356bb
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 09:51:33 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:27:53 2020 +0200

vcl: VectorGraphicSearch - clean-up SearchContext member vars.

Change-Id: I1740be5ed1b47235da3794fa46e3533b17ca1fb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95390
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 40d682542f02d78b5ed6bd4fc0ba461a1a7fb5f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95932

diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index 42d98a981ef9..94d954516f13 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -34,26 +34,26 @@ public:
 
 class SearchContext
 {
-public:
-bool bInitialized = false;
-
+private:
 FPDF_DOCUMENT mpPdfDocument;
-sal_Int32 mnPageIndex;
 FPDF_PAGE mpPage;
 FPDF_TEXTPAGE mpTextPage;
+FPDF_SCHHANDLE mpSearchHandle;
+
+public:
+sal_Int32 mnPageIndex;
 OUString maSearchString;
 SearchStartPosition meStartPosition;
-FPDF_SCHHANDLE mpSearchHandle;
 
 SearchContext(FPDF_DOCUMENT pPdfDocument, sal_Int32 nPageIndex, OUString 
const& rSearchString,
   SearchStartPosition eStartPosition)
 : mpPdfDocument(pPdfDocument)
-, mnPageIndex(nPageIndex)
 , mpPage(nullptr)
 , mpTextPage(nullptr)
+, mpSearchHandle(nullptr)
+, mnPageIndex(nPageIndex)
 , maSearchString(rSearchString)
 , meStartPosition(eStartPosition)
-, mpSearchHandle(nullptr)
 {
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl svx/source vcl/Library_vcl.mk vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/filter/PDFiumLibrary.hxx   |   43 +
 svx/source/inc/svdpdf.hxx  |4 ++
 svx/source/svdraw/svdpdf.cxx   |   14 +
 vcl/Library_vcl.mk |1 
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   20 ++---
 vcl/source/filter/ipdf/pdfread.cxx |   26 +++--
 vcl/source/graphic/VectorGraphicSearch.cxx |   13 +++-
 vcl/source/pdf/PDFiumLibrary.cxx   |   36 
 8 files changed, 100 insertions(+), 57 deletions(-)

New commits:
commit 3538b83c8d83e66f63c745bd769d118117704026
Author: Tomaž Vajngerl 
AuthorDate: Sun May 31 11:50:20 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:28:10 2020 +0200

pdfium: only init pdfium library one and destroy on LO exit

With more and more usage of PDFium, it is hard to keep track of
the life-time of the PDFium library, so it can happen that a
FPDF_DestroyLibrary happens when we still have another instance
where PDFium is still use. The result of this is a crash. To
prevent this, just initialize the library once and delete, when
on LO exit.

This can be improved in the future to only keep the library
active when in actual use.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95391
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 067a8a954c8e1d8d6465a4ab5fb61e93f16c26c2)

Change-Id: I5c7e5de7f8b97d10efb394c67c7a61b976c8d57c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95933
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
new file mode 100644
index ..bc7912c17e81
--- /dev/null
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -0,0 +1,43 @@
+/* -*- 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 
+
+#if HAVE_FEATURE_PDFIUM
+
+#include 
+#include 
+#include 
+
+namespace vcl::pdf
+{
+class VCL_DLLPUBLIC PDFium final
+{
+private:
+PDFium(const PDFium&) = delete;
+PDFium& operator=(const PDFium&) = delete;
+
+public:
+PDFium();
+~PDFium();
+};
+
+struct PDFiumLibrary : public rtl::StaticWithInit, 
PDFiumLibrary>
+{
+std::shared_ptr operator()() { return std::make_shared(); }
+};
+
+} // namespace vcl::pdf
+
+#endif // HAVE_FEATURE_PDFIUM
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx
index cc3ec7f27bfa..3765f8a59577 100644
--- a/svx/source/inc/svdpdf.hxx
+++ b/svx/source/inc/svdpdf.hxx
@@ -45,6 +45,8 @@
 #include 
 #include 
 
+#include 
+
 // Forward Declarations
 
 class SfxItemSet;
@@ -104,6 +106,8 @@ class SVXCORE_DLLPUBLIC ImpSdrPdfImport final
 tools::Rectangle PointsToLogic(double left, double right, double top, 
double bottom) const;
 Point PointsToLogic(double x, double y) const;
 
+std::shared_ptr mpPDFium;
+
 // check for clip and evtl. fill maClip
 void checkClip();
 bool isClip() const;
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index b380d478d806..f539d56ca355 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -131,6 +131,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, 
SdrLayerID nLay, const tools:
 , mnPageCount(0)
 , mdPageWidthPts(0)
 , mdPageHeightPts(0)
+, mpPDFium(vcl::pdf::PDFiumLibrary::get())
 {
 mpVD->EnableOutput(false);
 mpVD->SetLineColor();
@@ -144,13 +145,6 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, 
SdrLayerID nLay, const tools:
   svl::Items{});
 checkClip();
 
-FPDF_LIBRARY_CONFIG aConfig;
-aConfig.version = 2;
-aConfig.m_pUserFontPaths = nullptr;
-aConfig.m_pIsolate = nullptr;
-aConfig.m_v8EmbedderSlot = 0;
-FPDF_InitLibraryWithConfig(&aConfig);
-
 // Load the buffer using pdfium.
 auto const& rVectorGraphicData = mrGraphic.getVectorGraphicData();
 mpPdfDocument = FPDF_LoadMemDocument(
@@ -185,11 +179,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, 
SdrLayerID nLay, const tools:
 mnPageCount = FPDF_GetPageCount(mpPdfDocument);
 }
 
-ImpSdrPdfImport::~ImpSdrPdfImport()
-{
-FPDF_CloseDocument(mpPdfDocument);
-FPDF_DestroyLibrary();
-}
+ImpSdrPdfImport::~ImpSdrPdfImport() { FPDF_CloseDocument(mpPdfDocument); }
 
 void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* 
pActionsToReport,
 int nPageIndex)
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 6812c5

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/sdmodeltestbase.hxx |   16 
 sd/qa/unit/tiledrendering/CallbackRecorder.hxx |3 +++
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx  |   18 +-
 3 files changed, 32 insertions(+), 5 deletions(-)

New commits:
commit 60ec74e442aebe1d80b1416ec1405fffc06ab4ae
Author: Tomaž Vajngerl 
AuthorDate: Sat May 30 13:10:04 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:27:35 2020 +0200

sd: improve the test for LOKit search in PDF graphic

Record how many times we het the search result back, so we can
be sure that the search happend and don't just read the old
values. Assert the search result selection rectangles and text
selection rectangles.

Add tools:Rectangle support for CPPUnit into sdmodeltestbase.hxx

Change-Id: I0b22d2d2f66abdc0dd0d5ac13a1bfebaa470749a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95383
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4dcc48f37248a1eb45188739de961689e7873f3c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95931
Tested-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index dd76e2349e23..f36bab03a322 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -485,6 +485,22 @@ template<> struct assertion_traits
 }
 };
 
+template<> struct assertion_traits
+{
+static bool equal( const tools::Rectangle& r1, const tools::Rectangle& r2 )
+{
+return r1 == r2;
+}
+
+static std::string toString( const tools::Rectangle& r)
+{
+OStringStream ost;
+ost << "Rect P: [" << r.Top() << ", " << r.Left() << "] "
+"S: [" << r.GetWidth() << ", " << r.GetHeight() << "]";
+return ost.str();
+}
+};
+
 CPPUNIT_NS_END
 
 #endif
diff --git a/sd/qa/unit/tiledrendering/CallbackRecorder.hxx 
b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
index fc5117cce6dc..7e6c8a42d07d 100644
--- a/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
+++ b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
@@ -51,6 +51,7 @@ struct CallbackRecorder
 , m_nPart(0)
 , m_nSelectionBeforeSearchResult(0)
 , m_nSelectionAfterSearchResult(0)
+, m_nSearchResultCount(0)
 {
 }
 
@@ -62,6 +63,7 @@ struct CallbackRecorder
 std::vector m_aSearchResultPart;
 int m_nSelectionBeforeSearchResult;
 int m_nSelectionAfterSearchResult;
+int m_nSearchResultCount;
 /// For document size changed callback.
 osl::Condition m_aDocumentSizeCondition;
 
@@ -115,6 +117,7 @@ struct CallbackRecorder
 break;
 case LOK_CALLBACK_SEARCH_RESULT_SELECTION:
 {
+m_nSearchResultCount++;
 m_aSearchResultSelection.clear();
 m_aSearchResultPart.clear();
 boost::property_tree::ptree aTree;
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 33257f12d4ab..8d8b11e43fa1 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -292,21 +292,29 @@ void LOKitSearchTest::testSearchInPDF()
 CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
  pVectorGraphicData->getVectorGraphicDataType());
 
+// Search
 lcl_search("ABC");
 
 CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount);
 
 CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 483"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)),
+ mpCallbackRecorder->m_aSelection[0]);
 
-CPPUNIT_ASSERT_EQUAL(long(3763), 
mpCallbackRecorder->m_aSelection[0].Left());
-CPPUNIT_ASSERT_EQUAL(long(1331), 
mpCallbackRecorder->m_aSelection[0].Top());
-CPPUNIT_ASSERT_EQUAL(long(1433), 
mpCallbackRecorder->m_aSelection[0].GetWidth());
-CPPUNIT_ASSERT_EQUAL(long(484), 
mpCallbackRecorder->m_aSelection[0].GetHeight());
-
+// Search again - same result
 lcl_search("ABC");
+
 CPPUNIT_ASSERT_EQUAL(true, mpCallbackRecorder->m_bFound);
+CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount);
 
 CPPUNIT_ASSERT_EQUAL(size_t(1), 
mpCallbackRecorder->m_aSearchResultSelection.size());
+CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 483"),
+ mpCallbackRecorder->m_aSearchResultSelection[0]);
+CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)),
+ mpCallbackRecorder->m_aSelection[0]);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(LOKitSearchTest);
___
Libreoffice-commits mail

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|   12 +++-
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   79 +
 vcl/source/graphic/VectorGraphicSearch.cxx |   28 +++---
 3 files changed, 90 insertions(+), 29 deletions(-)

New commits:
commit d7e75f660b3cdfa43ffa572f7a150263b7ed27e8
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 23:52:50 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:27:19 2020 +0200

vcl: add search start position support for VectorGraphicSearch

By default we start at the begin of the page, but with this change
make it possible to start at the end. This makes it possible to
search in the backwards direction (set the start position at to
the end and search with "previous").

Change-Id: I78fb1461b86bf9eab2f91c3b9a81cbb5c6557332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95382
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 83d27791fed75941c75d3cc571c3d5cf27d14e8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95930
Tested-by: Tomaž Vajngerl 

diff --git a/include/vcl/VectorGraphicSearch.hxx 
b/include/vcl/VectorGraphicSearch.hxx
index a00c212ad61c..b67c63a844d8 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -21,6 +21,12 @@
 
 class SearchContext;
 
+enum class SearchStartPosition
+{
+Begin,
+End
+};
+
 class VCL_DLLPUBLIC VectorGraphicSearch final
 {
 private:
@@ -29,12 +35,14 @@ private:
 Graphic maGraphic;
 std::unique_ptr mpSearchContext;
 
-bool searchPDF(std::shared_ptr const& rData, OUString 
const& rSearchString);
+bool searchPDF(std::shared_ptr const& rData, OUString 
const& rSearchString,
+   SearchStartPosition eStartPosition);
 
 public:
 VectorGraphicSearch(Graphic const& rGraphic);
 ~VectorGraphicSearch();
-bool search(OUString const& rSearchString);
+bool search(OUString const& rSearchString,
+SearchStartPosition eStartPosition = 
SearchStartPosition::Begin);
 basegfx::B2DSize pageSize();
 bool next();
 bool previous();
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx 
b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 7962c23f4e8f..5f65b4ba7e3d 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -93,32 +93,71 @@ void VectorGraphicSearchTest::testNextPrevious()
 Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
 aGraphic.makeAvailable();
 
-VectorGraphicSearch aSearch(aGraphic);
-CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
+{ // Start from the beginning of the page
+VectorGraphicSearch aSearch(aGraphic);
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
 
-// next - first match found
-CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
-CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+// no previous - we are at the begin
+CPPUNIT_ASSERT_EQUAL(false, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(0, aSearch.index()); // nothing was yet found, so 
it is 0
 
-// next - second match found
-CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
-CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+// next - first position found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
 
-// next - not found, index unchanged
-CPPUNIT_ASSERT_EQUAL(false, aSearch.next());
-CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+// next - second position found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
 
-// previous - first match
-CPPUNIT_ASSERT_EQUAL(true, aSearch.previous());
-CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+// next - not found, index unchanged
+CPPUNIT_ASSERT_EQUAL(false, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
 
-// previous - not found, index unchanged
-CPPUNIT_ASSERT_EQUAL(false, aSearch.previous());
-CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+// previous - first position
+CPPUNIT_ASSERT_EQUAL(true, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
 
-// next - second match found
-CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
-CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+// previous - not found, index unchanged
+CPPUNIT_ASSERT_EQUAL(false, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+// next - second position found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+}
+
+{ // Start from the end of the page
+VectorGraphicSearch aSearch(aGraphic);
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy", 
SearchStartPosition::End));
+
+// no next - we are at the end
+CPPUNIT

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   24 +---
 1 file changed, 5 insertions(+), 19 deletions(-)

New commits:
commit e1c7df9482175dff16baa8720d4f0e962b671a35
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 2 23:15:03 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:25:49 2020 +0200

sd: use getPDFSelection to get the search selection for LOKit

This reduces code duplication.

Change-Id: I0a6a44d696841d1573d23f87353ac055cc92c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95386
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit fcc13ba6a0121cfdf70d1f39318a024777247559)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95928
Tested-by: Tomaž Vajngerl 

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index c33f07ee913c..1275a55fa801 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -742,26 +742,12 @@ void 
SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & pV
 std::vector<::tools::Rectangle> aLogicRects;
 if (mpImpl->mbCurrentIsVectorGraphic)
 {
-basegfx::B2DSize aPdfPageSize = 
mpImpl->mpVectorGraphicSearch->pageSize();
+basegfx::B2DRectangle aSelectionHMM = 
getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
 
-tools::Rectangle aObjectRectTwip = 
OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), 
MapMode(MapUnit::MapTwip));
-basegfx::B2DRectangle 
aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip));
-
-// Setup coordinate conversion matrix to convert the inner PDF
-// coordinates to the page relative coordinates
-basegfx::B2DHomMatrix aB2DMatrix;
-
-aB2DMatrix.scale(aObjectB2DRectTwip.getWidth() / aPdfPageSize.getX(),
- aObjectB2DRectTwip.getHeight() / aPdfPageSize.getY());
-
-aB2DMatrix.translate(aObjectB2DRectTwip.getMinX(), 
aObjectB2DRectTwip.getMinY());
-
-for (auto const & rRectangle : 
mpImpl->mpVectorGraphicSearch->getTextRectangles())
-{
-basegfx::B2DRectangle aRectangle(rRectangle);
-aRectangle *= aB2DMatrix;
-aLogicRects.emplace_back(Point(aRectangle.getMinX(), 
aRectangle.getMinY()), Size(aRectangle.getWidth(), aRectangle.getHeight()));
-}
+tools::Rectangle aSelection(Point(aSelectionHMM.getMinX(), 
aSelectionHMM.getMinY()),
+Size(aSelectionHMM.getWidth(), 
aSelectionHMM.getHeight()));
+aSelection = OutputDevice::LogicToLogic(aSelection, 
MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+aLogicRects.push_back(aSelection);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|1 
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   40 +
 vcl/source/graphic/VectorGraphicSearch.cxx |   14 ++
 3 files changed, 55 insertions(+)

New commits:
commit 9d653f4962aae4dae6c0d4166f020354a5f82711
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 23:26:51 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:26:27 2020 +0200

vcl: add "previous" search to VectorGraphicSearch

Previous moves backwards in the search matches.

Change-Id: I88d402e0b8cb9dc4fd93e7f1ce5b08fb42aadd06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95381
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit e20440effc7a47c8a5e8ef0943e6872cd9b3646a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95929
Tested-by: Tomaž Vajngerl 

diff --git a/include/vcl/VectorGraphicSearch.hxx 
b/include/vcl/VectorGraphicSearch.hxx
index 5420e161448b..a00c212ad61c 100644
--- a/include/vcl/VectorGraphicSearch.hxx
+++ b/include/vcl/VectorGraphicSearch.hxx
@@ -37,6 +37,7 @@ public:
 bool search(OUString const& rSearchString);
 basegfx::B2DSize pageSize();
 bool next();
+bool previous();
 int index();
 std::vector getTextRectangles();
 };
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx 
b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 01022a3fe225..7962c23f4e8f 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -26,9 +26,11 @@ class VectorGraphicSearchTest : public 
test::BootstrapFixtureBase
 }
 
 void test();
+void testNextPrevious();
 
 CPPUNIT_TEST_SUITE(VectorGraphicSearchTest);
 CPPUNIT_TEST(test);
+CPPUNIT_TEST(testNextPrevious);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -81,6 +83,44 @@ void VectorGraphicSearchTest::test()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(6381.04, aRectangles[3].getMaxY(), 1E-2);
 }
 
+// Test next and previous work as expected to move
+// between search matches.
+void VectorGraphicSearchTest::testNextPrevious()
+{
+OUString aURL = getFullUrl("Pangram.pdf");
+SvFileStream aStream(aURL, StreamMode::READ);
+GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
+Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
+aGraphic.makeAvailable();
+
+VectorGraphicSearch aSearch(aGraphic);
+CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
+
+// next - first match found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+// next - second match found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+
+// next - not found, index unchanged
+CPPUNIT_ASSERT_EQUAL(false, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+
+// previous - first match
+CPPUNIT_ASSERT_EQUAL(true, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+// previous - not found, index unchanged
+CPPUNIT_ASSERT_EQUAL(false, aSearch.previous());
+CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+
+// next - second match found
+CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
+CPPUNIT_ASSERT_EQUAL(817, aSearch.index());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index d54f32930276..8b73cab71340 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -104,6 +104,13 @@ public:
 return false;
 }
 
+bool previous()
+{
+if (mpSearchHandle)
+return FPDFText_FindPrev(mpSearchHandle);
+return false;
+}
+
 int index()
 {
 if (mpSearchHandle)
@@ -245,6 +252,13 @@ bool VectorGraphicSearch::next()
 return false;
 }
 
+bool VectorGraphicSearch::previous()
+{
+if (mpSearchContext)
+return mpSearchContext->previous();
+return false;
+}
+
 int VectorGraphicSearch::index()
 {
 if (mpSearchContext)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/qa sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   93 --
 sd/qa/unit/tiledrendering/data/PDFSearch.pdf  |binary
 sd/source/ui/view/Outliner.cxx|   15 
 3 files changed, 102 insertions(+), 6 deletions(-)

New commits:
commit fb81d3f064b24a4fa0585eaac4e5811443a45768
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 23:06:57 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:25:25 2020 +0200

sd: fix not found case in PDF search + add PDF Search tests

When searching the PDF and the search text is not found (anymore)
in the current VectorGraphicSearch, we need to remove it and mark
that we don't currently search in a vector graphic (PDF) anymore.
This wasn't handled correctly and caused a crash.

In addition add a LOKit test for search into a PDF document, to
make sure the not-found case and usual searching case are working
correctly.

Change-Id: I663a6b2cf4879f11d62e440ea0c35ffcd205f81f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95380
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit a99aef3cf0a8ff3f04077d1530d1602505cecaae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95927

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 4474bd8e4751..33257f12d4ab 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -24,10 +24,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 
 using namespace css;
@@ -38,7 +42,7 @@ private:
 static constexpr char DATA_DIRECTORY[] = 
"/sd/qa/unit/tiledrendering/data/";
 
 public:
-LOKitSearchTest() {}
+LOKitSearchTest() = default;
 
 virtual void setUp() override;
 virtual void tearDown() override;
@@ -49,6 +53,8 @@ public:
 void testSearchAllNotifications();
 void testSearchAllFollowedBySearch();
 void testDontSearchInMasterPages();
+void testSearchInPDFNonExisting();
+void testSearchInPDF();
 
 CPPUNIT_TEST_SUITE(LOKitSearchTest);
 CPPUNIT_TEST(testSearch);
@@ -57,6 +63,8 @@ public:
 CPPUNIT_TEST(testSearchAllNotifications);
 CPPUNIT_TEST(testSearchAllFollowedBySearch);
 CPPUNIT_TEST(testDontSearchInMasterPages);
+CPPUNIT_TEST(testSearchInPDFNonExisting);
+CPPUNIT_TEST(testSearchInPDF);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -96,9 +104,11 @@ LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequencedispose();
+
 mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY)
-  + OUString::createFromAscii(pName),
-  
"com.sun.star.presentation.PresentationDocument");
+  + OUString::createFromAscii(pName));
+
+CPPUNIT_ASSERT(mxComponent.is());
 SdXImpressDocument* pImpressDocument = 
dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pImpressDocument);
 pImpressDocument->initializeForTiledRendering(rArguments);
@@ -109,15 +119,20 @@ namespace
 {
 void lcl_search(const OUString& rKey, bool bFindAll = false)
 {
+Scheduler::ProcessEventsToIdle();
+SvxSearchCmd eSearch = bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND;
+
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({
 { "SearchItem.SearchString", uno::makeAny(rKey) },
 { "SearchItem.Backward", uno::makeAny(false) },
-{ "SearchItem.Command", uno::makeAny(static_cast(
-bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND)) },
+{ "SearchItem.Command", uno::makeAny(sal_uInt16(eSearch)) },
 }));
+
 comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
 }
-}
+
+} // end anonymous namespace
 
 void LOKitSearchTest::testSearch()
 {
@@ -228,6 +243,72 @@ void LOKitSearchTest::testDontSearchInMasterPages()
 CPPUNIT_ASSERT_EQUAL(false, mpCallbackRecorder->m_bFound);
 }
 
+void LOKitSearchTest::testSearchInPDFNonExisting()
+{
+SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell);
+mpCallbackRecorder->registerCallbacksFor(pViewShell->GetViewShellBase());
+
+SdPage* pPage = pViewShell->GetActualPage();
+CPPUNIT_ASSERT(pPage);
+
+SdrObject* pObject = pPage->GetObj(0);
+CPPUNIT_ASSERT(pObject);
+
+SdrGrafObj* pGraphicObject = dynamic_cast(pObject);
+CPPUNIT_ASSERT(pGraphicObject);
+
+Graphic aGraphic = pGraphicObject->GetGraphic();
+auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
+CPPUNIT_ASSERT(pVectorGraphicData);
+CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
+ pVectorGraphicData->getVecto

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/CppunitTest_sd_tiledrendering.mk sd/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/CppunitTest_sd_tiledrendering.mk|1 
 sd/qa/unit/sdmodeltestbase.hxx |2 
 sd/qa/unit/tiledrendering/CallbackRecorder.hxx |  142 +++
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx  |  233 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |  140 +--
 5 files changed, 388 insertions(+), 130 deletions(-)

New commits:
commit 38f68c0b81e62def94fd4f90e6fb1804b7ef0f82
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 18:18:40 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:24:42 2020 +0200

sd: move LOK search tests out of tiledrendering.cxx

Change-Id: I76ff3e251afc877b0dcf54d772da95bb7a60e823
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95351
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b40f1d657affbe87f60bfd358199a91c9fea7454)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95926

diff --git a/sd/CppunitTest_sd_tiledrendering.mk 
b/sd/CppunitTest_sd_tiledrendering.mk
index 9b643c869a84..3b555860f963 100644
--- a/sd/CppunitTest_sd_tiledrendering.mk
+++ b/sd/CppunitTest_sd_tiledrendering.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sd_tiledrendering))
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sd_tiledrendering))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sd_tiledrendering, \
+sd/qa/unit/tiledrendering/LOKitSearchTest \
 sd/qa/unit/tiledrendering/tiledrendering \
 ))
 
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 8fef3182ee3e..dd76e2349e23 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -73,7 +73,7 @@ pFilterName: 
 pTypeName: ...
 nFormatType: ...
 */
-FileFormat aFileFormats[] =
+static FileFormat aFileFormats[] =
 {
 { "odp",  "impress8", "impress8", "", ODP_FORMAT_TYPE },
 { "ppt",  "MS PowerPoint 97", "impress_MS_PowerPoint_97", "sdfilt", 
PPT_FORMAT_TYPE },
diff --git a/sd/qa/unit/tiledrendering/CallbackRecorder.hxx 
b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
new file mode 100644
index ..fc5117cce6dc
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/CallbackRecorder.hxx
@@ -0,0 +1,142 @@
+/* -*- 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 
+#include 
+#include 
+#include 
+#include 
+
+namespace
+{
+std::vector lcl_convertSeparated(const OUString& rString, 
sal_Unicode nSeparator)
+{
+std::vector aRet;
+
+sal_Int32 nIndex = 0;
+do
+{
+OUString aToken = rString.getToken(0, nSeparator, nIndex);
+aToken = aToken.trim();
+if (!aToken.isEmpty())
+aRet.push_back(aToken);
+} while (nIndex >= 0);
+
+return aRet;
+}
+
+void lcl_convertRectangle(const OUString& rString, tools::Rectangle& 
rRectangle)
+{
+uno::Sequence aSeq = 
comphelper::string::convertCommaSeparated(rString);
+CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
+rRectangle.setX(aSeq[0].toInt32());
+rRectangle.setY(aSeq[1].toInt32());
+rRectangle.setWidth(aSeq[2].toInt32());
+rRectangle.setHeight(aSeq[3].toInt32());
+}
+}
+
+struct CallbackRecorder
+{
+CallbackRecorder()
+: m_bFound(true)
+, m_nPart(0)
+, m_nSelectionBeforeSearchResult(0)
+, m_nSelectionAfterSearchResult(0)
+{
+}
+
+tools::Rectangle m_aInvalidation;
+std::vector<::tools::Rectangle> m_aSelection;
+bool m_bFound;
+sal_Int32 m_nPart;
+std::vector m_aSearchResultSelection;
+std::vector m_aSearchResultPart;
+int m_nSelectionBeforeSearchResult;
+int m_nSelectionAfterSearchResult;
+/// For document size changed callback.
+osl::Condition m_aDocumentSizeCondition;
+
+static void callback(int nType, const char* pPayload, void* pData)
+{
+static_cast(pData)->processCallback(nType, 
pPayload);
+}
+
+void processCallback(int nType, const char* pPayload)
+{
+switch (nType)
+{
+case LOK_CALLBACK_INVALIDATE_TILES:
+{
+OUString aPayload = OUString::createFromAscii(pPayload);
+if (aPayload != "EMPTY" && m_aInvalidation.IsEmpty())
+lcl_convertRectangle(aPayload, m_aInvalidation);
+}
+break;
+case LOK_CALLBACK_TEXT_SELECTION:
+{
+OUString aPayload = OUString::createFromAscii(pPayload);
+m_aSelection.clear();
+for (const OUString& rString : lcl_convertSeparated(aPayload, 
u';'))
+{
+::tools::Rectangle aRectangle;
+ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)

New commits:
commit 42cfe2309bd9731d0e5b497356af5834757521bb
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 08:33:42 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:23:38 2020 +0200

sd: remove code dupl. when getting PDF text selection for LOK

Change-Id: I61d0a9851e9cfe60e9672acec38946b0b25f310f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95349
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 06ddbd4a7a15b80b0286b359bd0a05812fd7ee75)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95924
Tested-by: Tomaž Vajngerl 

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0d69cf872090..f60748bb13a5 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -704,11 +704,16 @@ basegfx::B2DRange b2DRectangleFromRectangle( const 
::tools::Rectangle& rRect )
  rRect.IsHeightEmpty() ? rRect.Top() : 
rRect.Bottom());
 }
 
-void getPDFSelections(std::vector & rSubSelections,
-  std::unique_ptr & 
rVectorGraphicSearch,
-  SdrObject* pObject)
+basegfx::B2DRectangle getPDFSelection(std::unique_ptr & 
rVectorGraphicSearch,
+   SdrObject* pObject)
 {
-basegfx::B2DSize aPdfPageSize = rVectorGraphicSearch->pageSize();
+basegfx::B2DRectangle aSelection;
+
+auto const & rTextRectangles = rVectorGraphicSearch->getTextRectangles();
+if (rTextRectangles.empty())
+return aSelection;
+
+basegfx::B2DSize aPdfPageSizeHMM = rVectorGraphicSearch->pageSize();
 
 basegfx::B2DRectangle 
aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect()));
 
@@ -716,24 +721,24 @@ void getPDFSelections(std::vector 
& rSubSelections,
 // coordinates to the page relative coordinates
 basegfx::B2DHomMatrix aB2DMatrix;
 
-aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSize.getX(),
- aObjectB2DRectHMM.getHeight() / aPdfPageSize.getY());
+aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSizeHMM.getX(),
+ aObjectB2DRectHMM.getHeight() / aPdfPageSizeHMM.getY());
 
 aB2DMatrix.translate(aObjectB2DRectHMM.getMinX(), 
aObjectB2DRectHMM.getMinY());
 
-basegfx::B2DRectangle aCombined;
 
 for (auto const & rRectangle : rVectorGraphicSearch->getTextRectangles())
 {
 basegfx::B2DRectangle aRectangle(rRectangle);
 aRectangle *= aB2DMatrix;
-if (aCombined.isEmpty())
-aCombined = aRectangle;
+
+if (aSelection.isEmpty())
+aSelection = aRectangle;
 else
-aCombined.expand(aRectangle);
+aSelection.expand(aRectangle);
 }
 
-rSubSelections.push_back(aCombined);
+return aSelection;
 }
 
 } // end namespace
@@ -862,7 +867,9 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti
 mpView->UnmarkAllObj(pPageView);
 
 std::vector aSubSelections;
-getPDFSelections(aSubSelections, 
mpImpl->mpVectorGraphicSearch, mpObj);
+basegfx::B2DRectangle aSubSelection = 
getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
+if (!aSubSelection.isEmpty())
+aSubSelections.push_back(aSubSelection);
 mpView->MarkObj(mpObj, pPageView, false, false, 
aSubSelections);
 }
 }
@@ -1263,7 +1270,10 @@ void SdOutliner::ProvideNextTextObject()
 mpView->UnmarkAllObj(pPageView);
 
 std::vector aSubSelections;
-getPDFSelections(aSubSelections, 
mpImpl->mpVectorGraphicSearch, mpObj);
+basegfx::B2DRectangle aSubSelection = 
getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
+if (!aSubSelection.isEmpty())
+aSubSelections.push_back(aSubSelection);
+
 mpView->MarkObj(mpObj, pPageView, false, false, 
aSubSelections);
 
 mpDrawDocument->GetDocSh()->SetWaitCursor( false );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 2c402eb238ef375971b1604c5dbfe6c6eedc2000
Author: Tomaž Vajngerl 
AuthorDate: Fri May 29 08:36:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:24:07 2020 +0200

sd: use b2DRectangleFromRectangle from canvastools.hxx

Change-Id: I8604b80f887a2c3a1143b8a9bc70f429576512f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95350
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit beb0fc465163e5edc0b7f978ad46c6ad0cd9e2de)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95925

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index f60748bb13a5..041f08c9b0a5 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -694,15 +695,6 @@ bool SdOutliner::SearchAndReplaceAll()
 
 namespace
 {
-basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect )
-{
-if (rRect.IsWidthEmpty() && rRect.IsHeightEmpty())
-return basegfx::B2DRange(basegfx::B2DTuple(rRect.Left(), rRect.Top()));
-return basegfx::B2DRectangle(rRect.Left(),
- rRect.Top(),
- rRect.IsWidthEmpty() ? rRect.Left() : 
rRect.Right(),
- rRect.IsHeightEmpty() ? rRect.Top() : 
rRect.Bottom());
-}
 
 basegfx::B2DRectangle getPDFSelection(std::unique_ptr & 
rVectorGraphicSearch,
SdrObject* pObject)
@@ -715,7 +707,7 @@ basegfx::B2DRectangle 
getPDFSelection(std::unique_ptr & rVe
 
 basegfx::B2DSize aPdfPageSizeHMM = rVectorGraphicSearch->pageSize();
 
-basegfx::B2DRectangle 
aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect()));
+basegfx::B2DRectangle 
aObjectB2DRectHMM(vcl::unotools::b2DRectangleFromRectangle(pObject->GetLogicRect()));
 
 // Setup coordinate conversion matrix to convert the inner PDF
 // coordinates to the page relative coordinates
@@ -753,7 +745,7 @@ void 
SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & pV
 basegfx::B2DSize aPdfPageSize = 
mpImpl->mpVectorGraphicSearch->pageSize();
 
 tools::Rectangle aObjectRectTwip = 
OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), 
MapMode(MapUnit::MapTwip));
-basegfx::B2DRectangle 
aObjectB2DRectTwip(b2DRectangleFromRectangle(aObjectRectTwip));
+basegfx::B2DRectangle 
aObjectB2DRectTwip(vcl::unotools::b2DRectangleFromRectangle(aObjectRectTwip));
 
 // Setup coordinate conversion matrix to convert the inner PDF
 // coordinates to the page relative coordinates
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - svx/source

2020-06-09 Thread Stephan Bergmann (via logerrit)
 svx/source/items/customshapeitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 55cd7bde81910f85fffb778f3c0a6ad143dff392
Author: Stephan Bergmann 
AuthorDate: Mon Jun 8 22:44:40 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 9 15:24:13 2020 +0200

tdf#126025: Non-const GetPropertyValueByName must use non-const Sequence []

...which internally calls getArray to make sure it references a unique 
sequence.
Regression introduced with 85f28ec44a2c169c91dac9346e9c71feda6a6cab "Clean 
up C-
style casts from pointers to void".

Change-Id: Id80b75f06322c65fc31040cc0b1892fe3a0aeaab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95862
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit dd74e75c2692ee50535e2a9c7cf344fafc0e724a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95872

diff --git a/svx/source/items/customshapeitem.cxx 
b/svx/source/items/customshapeitem.cxx
index 8626d893ed7e..57ec15e6b5e3 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -90,7 +90,7 @@ css::uno::Any* 
SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUStrin
 PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( 
PropertyPair( rSequenceName, rPropName ) ) );
 if ( aHashIter != aPropPairHashMap.end() )
 {
-pRet = const_cast(&(*rSecSequence)[ 
(*aHashIter).second ].Value);
+pRet = 
&const_cast &>(*rSecSequence)[ 
(*aHashIter).second ].Value;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/svx svx/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdmrkv.hxx   |   10 +++-
 svx/source/svdraw/svdmrkv.cxx |   48 --
 2 files changed, 55 insertions(+), 3 deletions(-)

New commits:
commit fe69802e22bb2c8365b7542f3f0fbf71cb6182e7
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 15:27:14 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:22:23 2020 +0200

svx: add ability to show sub-selections in a marked object

Draws selection rectangles inside the object window.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95347
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit cf812f15b3295a17a9b5d7e3a1c51b00dcbf2629)

Change-Id: I994477426489ea4cea89c86f9e51c9978f16b350
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95921
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 5b57da626d4f..f080a57d1bbb 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -26,6 +26,8 @@
 #include 
 #include 
 #include 
+#include 
+
 
 class SfxViewShell;
 
@@ -84,6 +86,7 @@ enum class ImpGetDescriptionOptions
 };
 
 class ImplMarkingOverlay;
+class MarkingSubSelectionOverlay;
 
 class SVX_DLLPUBLIC SdrMarkView : public SdrSnapView
 {
@@ -94,6 +97,8 @@ class SVX_DLLPUBLIC SdrMarkView : public SdrSnapView
 std::unique_ptr mpMarkPointsOverlay;
 std::unique_ptr mpMarkGluePointsOverlay;
 
+std::unique_ptr 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 maSubSelectionList;
 tools::RectanglemaMarkedObjRect;
 tools::RectanglemaMarkedPointsRect;
 tools::RectanglemaMarkedGluePointsRect;
@@ -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 const & rSubSelections = 
std::vector());
 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 c6dd6928c755..326de3db561f 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -134,6 +135,38 @@ void ImplMarkingOverlay::SetSecondPosition(const 
basegfx::B2DPoint& rNewPosition
 }
 }
 
+class MarkingSubSelectionOverlay
+{
+sdr::overlay::OverlayObjectList maObjects;
+
+public:
+MarkingSubSelectionOverlay(const SdrPaintView& rView, 
std::vector 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& xTargetOverlay 
= pCandidate->GetOverlayManager();
+
+if (xTargetOverlay.is())
+{
+const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+const Color aHighlightColor = 
aSvtOptionsDrawinglayer.getHilightColor();
+
+std::unique_ptr pNew =
+std::make_unique(
+sdr::overlay::OverlayType::Transparent,
+aHighlightColor, rSelections, false);
+
+xTargetOverlay->add(*pNew);
+maObjects.append(std::move(pNew));
+}
+}
+}
+};
+
 
 // MarkView
 
@@ -929,6 +962,8 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
 SdrHdlKind eSaveKind(SdrHdlKind::Move);
 SdrObject* pSaveObj = nullptr;
 
+mpMarkingSubSelectionOverlay.reset();
+
 if(pSaveOldFocusHdl
 && pSaveOldFocusHdl->GetObj()
 && dynamic_cast(pSaveOldFocusHdl->GetObj()) != 
nullptr
@@ -1023,6 +1058,11 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 {
 return;
 }
+
+if (!maSubSelectionL

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |  247 ++---
 1 file changed, 209 insertions(+), 38 deletions(-)

New commits:
commit 894b1a2f412ecc889a9932df3935c69e30852c6f
Author: Tomaž Vajngerl 
AuthorDate: Thu May 28 08:07:51 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:22:46 2020 +0200

sd: Search inside PDF document that were inserted as a graphic

This implements searching inside PDF documents that were inserted
into the Draw/Impress document as a graphics and marks the areas
of text that matches the search string. Complex (regex) search is
not supported.

Change-Id: I55d67772a2fe876ae72b9164998347304025d3e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95348
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7a84dffb44d4b1fa6e2a3cd3e3dc7d942f3c3e80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95923

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index c2cff89909a7..0d69cf872090 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -96,6 +98,11 @@ public:
 */
 void ReleaseOutlinerView();
 
+/** Search in vector graphic
+ */
+bool mbCurrentIsVectorGraphic;
+std::unique_ptr mpVectorGraphicSearch;
+
 private:
 /** Flag that specifies whether we own the outline view pointed to by
 mpOutlineView and thus have to
@@ -685,21 +692,93 @@ bool SdOutliner::SearchAndReplaceAll()
 return bRet;
 }
 
+namespace
+{
+basegfx::B2DRange b2DRectangleFromRectangle( const ::tools::Rectangle& rRect )
+{
+if (rRect.IsWidthEmpty() && rRect.IsHeightEmpty())
+return basegfx::B2DRange(basegfx::B2DTuple(rRect.Left(), rRect.Top()));
+return basegfx::B2DRectangle(rRect.Left(),
+ rRect.Top(),
+ rRect.IsWidthEmpty() ? rRect.Left() : 
rRect.Right(),
+ rRect.IsHeightEmpty() ? rRect.Top() : 
rRect.Bottom());
+}
+
+void getPDFSelections(std::vector & rSubSelections,
+  std::unique_ptr & 
rVectorGraphicSearch,
+  SdrObject* pObject)
+{
+basegfx::B2DSize aPdfPageSize = rVectorGraphicSearch->pageSize();
+
+basegfx::B2DRectangle 
aObjectB2DRectHMM(b2DRectangleFromRectangle(pObject->GetLogicRect()));
+
+// Setup coordinate conversion matrix to convert the inner PDF
+// coordinates to the page relative coordinates
+basegfx::B2DHomMatrix aB2DMatrix;
+
+aB2DMatrix.scale(aObjectB2DRectHMM.getWidth() / aPdfPageSize.getX(),
+ aObjectB2DRectHMM.getHeight() / aPdfPageSize.getY());
+
+aB2DMatrix.translate(aObjectB2DRectHMM.getMinX(), 
aObjectB2DRectHMM.getMinY());
+
+basegfx::B2DRectangle aCombined;
+
+for (auto const & rRectangle : rVectorGraphicSearch->getTextRectangles())
+{
+basegfx::B2DRectangle aRectangle(rRectangle);
+aRectangle *= aB2DMatrix;
+if (aCombined.isEmpty())
+aCombined = aRectangle;
+else
+aCombined.expand(aRectangle);
+}
+
+rSubSelections.push_back(aCombined);
+}
+
+} // end namespace
+
 void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr & 
pViewShell,
  OutlinerView* pOutlinerView,
  std::vector* 
pSelections)
 {
 std::vector<::tools::Rectangle> aLogicRects;
-pOutlinerView->GetSelectionRectangles(aLogicRects);
+if (mpImpl->mbCurrentIsVectorGraphic)
+{
+basegfx::B2DSize aPdfPageSize = 
mpImpl->mpVectorGraphicSearch->pageSize();
+
+tools::Rectangle aObjectRectTwip = 
OutputDevice::LogicToLogic(mpObj->GetLogicRect(), MapMode(MapUnit::Map100thMM), 
MapMode(MapUnit::MapTwip));
+basegfx::B2DRectangle 
aObjectB2DRectTwip(b2DRectangleFromRectangle(aObjectRectTwip));
+
+// Setup coordinate conversion matrix to convert the inner PDF
+// coordinates to the page relative coordinates
+basegfx::B2DHomMatrix aB2DMatrix;
+
+aB2DMatrix.scale(aObjectB2DRectTwip.getWidth() / aPdfPageSize.getX(),
+ aObjectB2DRectTwip.getHeight() / aPdfPageSize.getY());
+
+aB2DMatrix.translate(aObjectB2DRectTwip.getMinX(), 
aObjectB2DRectTwip.getMinY());
 
-// 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 (auto const & rRectangle : 
mpImpl->mpVectorGraphic

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 76ba829bf18123daf552afe253a8304a982ceb8d
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 14:27:30 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:21:26 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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95309
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 43a6def48f425361d79dff46dca41685d5ee03fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95920

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* 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(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* 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* pSelecti
 }
 }
 }
-else if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( 
pViewShell.get() ))
+else if (nullptr != dynamic_cast(pViewShell.get()))
 {
 mpDrawDocument->GetDocSh()->SetWaitCursor(false);
 // The following loop is executed more than once only when a
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/Outliner.cxx |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 7824545abeb308a89c08aa98e20901df05934625
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 14:20:44 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:19:10 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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95308
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 29e06da2b63441f4458c482eae1cd36bd10b4728)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95919

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(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 pViewShell (mpWeakViewShell.lock());
 std::shared_ptr 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( 
SfxViewShell::Current() );
+sd::ViewShellBase* pBase = getViewShellBase();
 if (pBase != nullptr)
 SetViewShell (pBase->GetMainViewShell());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/inc sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/inc/Outliner.hxx|7 ---
 sd/source/ui/view/Outliner.cxx |   20 +---
 2 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit 5bc2314a95199337e796de9be23650a71dff9294
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 14:13:02 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 15:18:43 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.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95307
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 14b55b3a8de070935489acd4f6f8be7b6a3d96a4)

Change-Id: I867dc4f465a694e61b6102b19f8e54ce623e2858
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95918
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 39e2720f6a01..3e6514f16b80 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -411,13 +411,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( mpObj );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/owncloud-android-lib

2020-06-09 Thread Tor Lillqvist (via logerrit)
 external/owncloud-android-lib/Module_owncloud-android-lib.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit b2a7703bec86810f5c790622ce762e6475b6997e
Author: Tor Lillqvist 
AuthorDate: Thu Apr 23 17:24:10 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Jun 9 15:09:31 2020 +0200

No owncloud-android-lib if we don't want to use Java at build time

Experimental. Let's see whether it makes sense to not use Java when
building the LO core for the (newer, Online-based) Android app.

Change-Id: I119861704d02bbfaa0cfd9f72c7b437f1730e48e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95847
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/external/owncloud-android-lib/Module_owncloud-android-lib.mk 
b/external/owncloud-android-lib/Module_owncloud-android-lib.mk
index 486ed4053829..a57e70a79b84 100644
--- a/external/owncloud-android-lib/Module_owncloud-android-lib.mk
+++ b/external/owncloud-android-lib/Module_owncloud-android-lib.mk
@@ -9,9 +9,11 @@
 
 $(eval $(call gb_Module_Module,owncloud_android_lib))
 
+ifneq ($(ENABLE_JAVA),)
 $(eval $(call gb_Module_add_targets,owncloud_android_lib, \
ExternalProject_owncloud_android_lib \
UnpackedTarball_owncloud_android_lib \
 ))
+endif
 
 # vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: scripting/IwyuFilter_scripting.yaml scripting/source

2020-06-09 Thread Gabor Kelemen (via logerrit)
 scripting/IwyuFilter_scripting.yaml   |6 ++
 scripting/source/basprov/baslibnode.hxx   |1 -
 scripting/source/basprov/basmethnode.cxx  |1 -
 scripting/source/basprov/basmethnode.hxx  |2 +-
 scripting/source/basprov/basmodnode.cxx   |1 -
 scripting/source/basprov/basmodnode.hxx   |1 -
 scripting/source/basprov/basprov.cxx  |4 
 scripting/source/basprov/basprov.hxx  |1 -
 scripting/source/basprov/basscript.cxx|2 --
 scripting/source/dlgprov/dlgevtatt.cxx|2 --
 scripting/source/dlgprov/dlgprov.cxx  |1 -
 scripting/source/inc/util/MiscUtils.hxx   |8 +---
 scripting/source/protocolhandler/scripthandler.cxx|2 --
 scripting/source/protocolhandler/scripthandler.hxx|1 -
 scripting/source/provider/ActiveMSPList.cxx   |5 -
 scripting/source/provider/ActiveMSPList.hxx   |3 +--
 scripting/source/provider/BrowseNodeFactoryImpl.cxx   |8 
 scripting/source/provider/BrowseNodeFactoryImpl.hxx   |2 --
 scripting/source/provider/MasterScriptProvider.cxx|5 +
 scripting/source/provider/MasterScriptProvider.hxx|1 -
 scripting/source/provider/MasterScriptProviderFactory.cxx |4 
 scripting/source/provider/MasterScriptProviderFactory.hxx |2 --
 scripting/source/provider/ProviderCache.cxx   |3 +--
 scripting/source/provider/ProviderCache.hxx   |3 ---
 scripting/source/provider/URIHelper.cxx   |1 +
 scripting/source/provider/URIHelper.hxx   |3 +--
 scripting/source/stringresource/stringresource.cxx|5 -
 scripting/source/vbaevents/eventhelper.cxx|6 --
 28 files changed, 13 insertions(+), 71 deletions(-)

New commits:
commit 2c0906bceef2889830cf9bd152b9e06b15f989a8
Author: Gabor Kelemen 
AuthorDate: Sat Jun 6 16:01:24 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 9 14:55:24 2020 +0200

tdf#42949 Fix IWYU warnings in scripting/

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I014631ec79242d9a5f735d7401fe0f5e323c69a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95649
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/scripting/IwyuFilter_scripting.yaml 
b/scripting/IwyuFilter_scripting.yaml
new file mode 100644
index ..2f3f8c37ae20
--- /dev/null
+++ b/scripting/IwyuFilter_scripting.yaml
@@ -0,0 +1,6 @@
+---
+assumeFilename: scripting/source/stringresource/stringresource.cxx
+blacklist:
+scripting/source/protocolhandler/scripthandler.cxx:
+# Actually used
+- com/sun/star/lang/XSingleServiceFactory.hpp
diff --git a/scripting/source/basprov/baslibnode.hxx 
b/scripting/source/basprov/baslibnode.hxx
index 1124974644cc..1e21c496fe4a 100644
--- a/scripting/source/basprov/baslibnode.hxx
+++ b/scripting/source/basprov/baslibnode.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SCRIPTING_SOURCE_BASPROV_BASLIBNODE_HXX
 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASLIBNODE_HXX
 
-#include 
 #include 
 #include 
 #include 
diff --git a/scripting/source/basprov/basmethnode.cxx 
b/scripting/source/basprov/basmethnode.cxx
index 2b950556c9e8..26ed5f08ed80 100644
--- a/scripting/source/basprov/basmethnode.cxx
+++ b/scripting/source/basprov/basmethnode.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/scripting/source/basprov/basmethnode.hxx 
b/scripting/source/basprov/basmethnode.hxx
index ce112afbf148..8910a8c6f728 100644
--- a/scripting/source/basprov/basmethnode.hxx
+++ b/scripting/source/basprov/basmethnode.hxx
@@ -21,7 +21,7 @@
 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASMETHNODE_HXX
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/scripting/source/basprov/basmodnode.cxx 
b/scripting/source/basprov/basmodnode.cxx
index 485b66bd0fa7..b5c3cf1a08e4 100644
--- a/scripting/source/basprov/basmodnode.cxx
+++ b/scripting/source/basprov/basmodnode.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/scripting/source/basprov/basmodnode.hxx 
b/scripting/source/basprov/basmodnode.hxx
index fa2010a5fc46..d537a92a3026 100644
--- a/scripting/source/basprov/basmodnode.hxx
+++ b/scripting/source/basprov/basmodnode.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SCRIPTING_SOURCE_BASPROV_BASMODNODE_HXX
 #define INCLUDED_SCRIPTING_SOURCE_BASPROV_BASMODNODE_HXX
 
-#include 
 #include 
 #include 
 #include 
diff --git a/scripting/source/basprov/basprov.cxx 
b/scripting/source/basprov/basprov.cxx
index 0d247130ff9f..6c7ede60649f 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - writerfilter/source

2020-06-09 Thread Michael Stahl (via logerrit)
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit e0e1c3bcc9445c177a4d97ba11639ae4f2f83163
Author: Michael Stahl 
AuthorDate: Mon Jun 8 13:05:27 2020 +0200
Commit: Michael Stahl 
CommitDate: Tue Jun 9 14:43:49 2020 +0200

tdf#132596 writerfilter: fix paste of RTF with header/footer

The problem is that writerfilter inserts the content of header/footer
into the body text, but then DomainMapper_Impl::PopPageHeaderFooter()
calls RemoveLastParagraph() and deletes a body paragraph containing a
fieldmark, and then in Undo some SwHistoryTextFieldmark can't find it,
and since ffb26b81e1c7ff1d64959200247bb2edd5a569da this crashes.

This is because of the borked error handling in
DomainMapper_Impl::PushPageHeaderFooter(); the
m_xBodyText->createTextCursorByRange() call throws an exception that is
swallowed, so the m_aTextAppendStack doesn't have an entry containing
the position in the header.

To fix the error handling, set m_bDiscardHeaderFooter = false only when
everything was successful.

Also fix the call to be xText->createTextCursorByRange instead
(this is a regression from 232ad2f2588beff50cb5c1f3b689c581ba317583).

Then it turns out that Undo still crashes, because sw can't Undo
changes of header/footer content, so just return early unless it's
a new document.

Change-Id: Ie5aeb45447c5fbd4b3ae15c4cffb9800583a6d1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95797
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 7a5afa492a7233b36165b3aba2774a1b03cdefc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95823

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 155105c466df..abde5e06db47 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2370,6 +2370,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 const PropertyIds ePropTextLeft = bHeader? PROP_HEADER_TEXT_LEFT: 
PROP_FOOTER_TEXT_LEFT;
 const PropertyIds ePropText = bHeader? PROP_HEADER_TEXT: PROP_FOOTER_TEXT;
 
+m_bDiscardHeaderFooter = true;
 m_eInHeaderFooterImport
 = bHeader ? HeaderFooterImportState::header : 
HeaderFooterImportState::footer;
 
@@ -2383,6 +2384,11 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 // content is not copied from the previous section
 pSectionContext->ClearHeaderFooterLinkToPrevious(bHeader, eType);
 
+if (!m_bIsNewDoc)
+{
+return; // TODO sw cannot Undo insert header/footer without 
crashing
+}
+
 uno::Reference< beans::XPropertySet > xPageStyle =
 pSectionContext->GetPageStyle(
 *this,
@@ -2410,15 +2416,15 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 xPageStyle->getPropertyValue(getPropertyName(bLeft? 
ePropTextLeft: ePropText)) >>= xText;
 
 m_aTextAppendStack.push(TextAppendContext(uno::Reference< 
text::XTextAppend >(xText, uno::UNO_QUERY_THROW),
-m_bIsNewDoc? uno::Reference(): 
m_xBodyText->createTextCursorByRange(xText->getStart(;
-}
-else
-{
-m_bDiscardHeaderFooter = true;
+m_bIsNewDoc
+? uno::Reference()
+: xText->createTextCursorByRange(xText->getStart(;
+m_bDiscardHeaderFooter = false; // set only on success!
 }
 }
 catch( const uno::Exception& )
 {
+DBG_UNHANDLED_EXCEPTION("writerfilter.dmapper");
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - dtrans/source

2020-06-09 Thread Luboš Luňák (via logerrit)
 dtrans/source/win32/clipb/WinClipbImpl.cxx |   12 
 dtrans/source/win32/clipb/WinClipbImpl.hxx |1 +
 2 files changed, 13 insertions(+)

New commits:
commit bb96d35f4dbe8b3f13e9a67f76ddcd95fa27ad57
Author: Luboš Luňák 
AuthorDate: Fri May 29 18:15:30 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 9 14:43:08 2020 +0200

cache foreign content in win32 clipboard code (tdf#133267)

The slowness in tdf#133267 on Windows is because the Calc operation
repeatedly calls ScDocument::IsClipboardSource(), which calls
ScModule::GetClipDoc(), which proceeds to fetch the clipboard
content, which means fetching it from the system clipboard if it's
not owned by LO.
Other LO clipboard implementations such as gtk3 or qt5 already
do caching, and it seems that it's easy to do for the win32 code.

Change-Id: I4696cc7488d66803fd5dd2963d27900957decdec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95163
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Luboš Luňák 
(cherry picked from commit fda6ad1458fcd5087c3dde56300b9d0367af6db5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95246
Reviewed-by: Xisco Fauli 
(cherry picked from commit 9b311cabd908c6bc9e7f7d461ee11eaf0ea6b18c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95749
Reviewed-by: Noel Grandin 

diff --git a/dtrans/source/win32/clipb/WinClipbImpl.cxx 
b/dtrans/source/win32/clipb/WinClipbImpl.cxx
index 003a266f84bc..8d59be7ca430 100644
--- a/dtrans/source/win32/clipb/WinClipbImpl.cxx
+++ b/dtrans/source/win32/clipb/WinClipbImpl.cxx
@@ -83,6 +83,10 @@ Reference< XTransferable > CWinClipbImpl::getContents( )
 return m_pCurrentClipContent->m_XTransferable;
 }
 
+// Content cached?
+if (m_foreignContent.is())
+return m_foreignContent;
+
 // release the mutex, so that the variable may be
 // changed by other threads
 }
@@ -101,6 +105,9 @@ Reference< XTransferable > CWinClipbImpl::getContents( )
 
 // remember pIDo destroys itself due to the smart pointer
 rClipContent = CDOTransferable::create( m_pWinClipboard->m_xContext, 
pIDo );
+
+MutexGuard aGuard(m_ClipContentMutex);
+m_foreignContent = rClipContent;
 }
 
 return rClipContent;
@@ -117,6 +124,8 @@ void CWinClipbImpl::setContents(
 {
 MutexGuard aGuard(m_ClipContentMutex);
 
+m_foreignContent.clear();
+
 m_pCurrentClipContent
 = new 
CXNotifyingDataObject(CDTransObjFactory::createDataObjFromTransferable(
 m_pWinClipboard->m_xContext, 
xTransferable),
@@ -176,7 +185,10 @@ void WINAPI CWinClipbImpl::onClipboardContentChanged()
 
 // reassociation to instance through static member
 if ( nullptr != s_pCWinClipbImpl )
+{
+s_pCWinClipbImpl->m_foreignContent.clear();
 s_pCWinClipbImpl->m_pWinClipboard->notifyAllClipboardListener( );
+}
 }
 
 void CWinClipbImpl::onReleaseDataObject( CXNotifyingDataObject* theCaller )
diff --git a/dtrans/source/win32/clipb/WinClipbImpl.hxx 
b/dtrans/source/win32/clipb/WinClipbImpl.hxx
index 55a9d8d600bc..cd5878e6b794 100644
--- a/dtrans/source/win32/clipb/WinClipbImpl.hxx
+++ b/dtrans/source/win32/clipb/WinClipbImpl.hxx
@@ -87,6 +87,7 @@ private:
 CMtaOleClipboardm_MtaOleClipboard;
 CWinClipboard*  m_pWinClipboard;
 CXNotifyingDataObject*  m_pCurrentClipContent;
+com::sun::star::uno::Reference< 
com::sun::star::datatransfer::XTransferable > m_foreignContent;
 osl::Mutex  m_ClipContentMutex;
 
 static osl::Mutex   s_aMutex;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Michael D. Warner license statement

2020-06-09 Thread Stephan Bergmann

On 24/05/2020 04:13, Michael Warner wrote:

All of my past & future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.


put on file at 
 
"added Michael Warner"


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: loleaflet/admin loleaflet/Makefile.am loleaflet/package.json loleaflet/po loleaflet/tsconfig.json

2020-06-09 Thread gokaysatir (via logerrit)
 loleaflet/Makefile.am  |9 +
 loleaflet/admin/src/AdminSocketSettings.js |   27 ++---
 loleaflet/admin/src/ModalDialogCreator.ts  |  138 +
 loleaflet/package.json |5 -
 loleaflet/po/templates/loleaflet-ui.pot|4 
 loleaflet/tsconfig.json|   19 +++
 6 files changed, 183 insertions(+), 19 deletions(-)

New commits:
commit a0748dda45ede8ec3d8c2b45f2b3446b0ad0e882
Author: gokaysatir 
AuthorDate: Tue Jun 9 11:13:52 2020 +0300
Commit: Dennis Francis 
CommitDate: Tue Jun 9 14:33:40 2020 +0200

leaflet: Introduce typescript. Initiate  a modal library with typescript.

Change-Id: I92113f7552f938f0874e8b16904e8bef0b5249a3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95624
Reviewed-by: Michael Meeks 
Reviewed-by: Dennis Francis 
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index b411a4f7c..ff2071a04 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -95,7 +95,8 @@ LOLEAFLET_ADMIN_JS =\
admin/src/AdminSocketAnalytics.js \
admin/src/AdminSocketSettings.js \
admin/src/AdminSocketHistory.js \
-   admin/src/AdminSocketLog.js
+   admin/src/AdminSocketLog.js \
+   admin/src/ModalDialogCreator.js
 
 NODE_MODULES_SRC =\
autolinker@3.14.1 \
@@ -391,7 +392,11 @@ if !ENABLE_MOBILEAPP
 ADMIN_BUNDLE = $(DIST_FOLDER)/admin-bundle.js
 endif
 
-build-loleaflet: $(LOLEAFLET_L10N_DST) \
+compilets:
+   $(srcdir)/node_modules/typescript/bin/tsc
+
+build-loleaflet: compilets \
+   $(LOLEAFLET_L10N_DST) \
$(L10N_JSON) \
$(LOLEAFLET_IMAGES_DST) \
$(LOLEAFLET_IMAGES_CUSTOM_DST) \
diff --git a/loleaflet/admin/src/AdminSocketSettings.js 
b/loleaflet/admin/src/AdminSocketSettings.js
index f57423634..6b4f41f4d 100644
--- a/loleaflet/admin/src/AdminSocketSettings.js
+++ b/loleaflet/admin/src/AdminSocketSettings.js
@@ -2,7 +2,7 @@
 /*
Socket to be intialized on opening the settings page in Admin console
 */
-/* global vex $ AdminSocketBase Admin _ */
+/* global DlgYesNo $ AdminSocketBase Admin _ */
 var AdminSocketSettings = AdminSocketBase.extend({
constructor: function(host) {
this.base(host);
@@ -29,21 +29,18 @@ var AdminSocketSettings = AdminSocketBase.extend({
socketSettings.send(command);
});
 
-   $('#btnShutdown').click(function() {
-   vex.dialog.confirm({
-   message: _('Are you sure you want to 
shut down the server?'),
-   buttons: [
-   $.extend({}, 
vex.dialog.buttons.YES, { text: _('OK') }),
-   $.extend({}, 
vex.dialog.buttons.NO, { text: _('Cancel') })
-   ],
-   callback: function(value) {
-   // TODO: Prompt for reason.
-   if (value) {
-   
socketSettings.send('shutdown maintenance');
-   }
-   }
+   document.getElementById('btnShutdown').onclick = 
function() {
+   var dialog = (new DlgYesNo())
+   .title(_('Confirmation'))
+   .text(_('Are you sure you want to shut down the 
server?'))
+   .yesButtonText(_('OK'))
+   .noButtonText(_('Cancel'))
+   .type('warning')
+   .yesFunction(function() {
+   socketSettings.send('shutdown 
maintenance');
});
-   });
+   dialog.open();
+   };
});
},
 
diff --git a/loleaflet/admin/src/ModalDialogCreator.ts 
b/loleaflet/admin/src/ModalDialogCreator.ts
new file mode 100644
index 0..13dd9f8c3
--- /dev/null
+++ b/loleaflet/admin/src/ModalDialogCreator.ts
@@ -0,0 +1,138 @@
+/* eslint-disable */
+
+/// Available types: info, warning, danger, link, success, primary. Works with 
bulma.css.
+
+// Every "set" function returns the instance. So you can do this:
+// (new DlgYesNo).Title('some title').Text('some 
text').YesButtonText('yes').NoButtonText('no').YesFunction(function () {/* 
*/}).NoFunction(function() {/** */});
+// "Yes" and "No" buttons call callback function, close the modal and destroy 
the modal.
+
+class DlgYesNo {
+static _instanceCount: number = 0;
+_instance: DlgYesNo;
+_modalID: number;
+
+constructor()

[Libreoffice-commits] online.git: wsd/README

2020-06-09 Thread Pedro Pinto Silva (via logerrit)
 wsd/README |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a2fb3207bcc09c2c51ecdb007eb61ab9115eb28b
Author: Pedro Pinto Silva 
AuthorDate: Tue Jun 9 14:16:34 2020 +0200
Commit: Pedro Silva 
CommitDate: Tue Jun 9 14:32:51 2020 +0200

Server README: add missing instalation instructions for openSuse Leap 15.1

Change-Id: I23997f9fee48a0ddf46ce0dd6e57ed8e01dc5a31
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95936
Tested-by: Jenkins
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 

diff --git a/wsd/README b/wsd/README
index a91314cd8..d3b615dd7 100644
--- a/wsd/README
+++ b/wsd/README
@@ -18,7 +18,7 @@ website.
 On openSUSE Leap 15.1, you can use:
 
 zypper ar 
http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_Leap_15.1/devel:libraries:c_c++.repo
-zypper in poco-devel libcap-progs
+zypper in poco-devel libcap-progs python3-polib libcap-devel npm
 
 Similar repos exist for other openSUSE and SLE releases.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/js/global.js |   35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

New commits:
commit 95fae63098d42a28e559c39ca79021a079cd7b57
Author: Michael Meeks 
AuthorDate: Tue Jun 9 10:44:30 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Jun 9 14:27:03 2020 +0200

Proxy: don't implement a magic re-connecting socket.

Websockets don't magically re-connect, so we shouldn't either.
Also avoid starting our send interval timer until we've opened
to simplify.

Change-Id: Id71049da2d4b4d0ac2f38a3d7410f2446d04f0b1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95906
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
(cherry picked from commit 19b544477e3f425fb55ca6e51be255860c6b13b1)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95885
Reviewed-by: Andras Timar 

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index 0cafa649c..c6590389b 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -354,15 +354,15 @@
{
this.onerror();
this.onclose();
-   clearInterval(this.waitInterval);
-   clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
-   this.sessionId = 'open';
-   this.inSerial = 0;
-   this.outSerial = 0;
-   this.msgInflight = 0;
-   this.openInflight = 0;
}
+   clearInterval(this.waitInterval);
+   clearTimeout(this.delaySession);
+   this.waitInterval = undefined;
+   this.sessionId = 'open';
+   this.inSerial = 0;
+   this.outSerial = 0;
+   this.msgInflight = 0;
+   this.openInflight = 0;
this.readyState = 3; // CLOSED
};
this._setPollInterval = function(intervalMs) {
@@ -373,10 +373,7 @@
if (that.sessionId === 'open')
{
if (that.readyState === 3)
-   {
-   console.debug('Session closed, opening 
a new one.');
-   that.getSessionId();
-   }
+   console.debug('Error: sending on closed 
socket');
return;
}
 
@@ -488,11 +485,17 @@
console.debug('Error: failed to fetch 
session id! error: ' + this.status);
that._signalErrorClose();
}
-   else
+   else // we connected - lets get going ...
{
that.sessionId = this.responseText;
that.readyState = 1;
that.onopen();
+
+   // For those who think that 
long-running sockets are a
+   // better way to wait: you're so right. 
However, each
+   // consumes a scarce server worker 
thread while it waits,
+   // so ... back in the real world:
+   that.pollInterval = 
setInterval(that.doSend, that.curPollMs);
}
});
req.addEventListener('loadend', function() {
@@ -555,12 +558,6 @@
 
// queue fetch of session id.
this.getSessionId();
-
-   // For those who think that long-running sockets are a
-   // better way to wait: you're so right. However, each
-   // consumes a scarce server worker thread while it waits,
-   // so ... back in the real world:
-   this.pollInterval = setInterval(this.doSend, this.curPollMs);
};
 
if (global.socketProxy)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/inc sd/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 sd/inc/Outliner.hxx|4 +
 sd/source/ui/view/Outliner.cxx |  110 ++---
 2 files changed, 65 insertions(+), 49 deletions(-)

New commits:
commit 6eec4e40f6f8ea88d3136295d5485ee73ef7bf2c
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 14:07:10 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 14:01:04 2020 +0200

sd: move LOK search result logic to it's own method

Change-Id: I67cbe4d3d63bffdab72c09b3a956f67806588348
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95306
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit e9dbdc9fc6ff943650e6e18986ed1cce913971ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95917
Tested-by: Tomaž Vajngerl 

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index d935d6f1d6a8..39e2720f6a01 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -355,6 +355,10 @@ private:
 */
 bool SearchAndReplaceOnce(std::vector<::sd::SearchSelection>* pSelections 
= nullptr);
 
+void sendLOKSearchResultCallback(std::shared_ptr& 
pViewShell,
+ OutlinerView* pOutlinerView,
+ std::vector* 
pSelections);
+
 /** Detect changes of the document or view and react accordingly.  Such
 changes may occur because different calls to
 SearchAndReplace() 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 & 
pViewShell,
+ OutlinerView* pOutlinerView,
+ std::vector* 
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 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* 
pSelections)
 {
 DetectChange ();
@@ -764,55 +824,7 @@ bool 
SdOutliner::SearchAndReplaceOnce(std::vector* 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
-

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 3 commits - basegfx/test include/svx include/tools svx/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 basegfx/test/B2DHomMatrixTest.cxx |   32 
 include/svx/svdmrkv.hxx   |6 +++---
 include/tools/UnitConversion.hxx  |6 +-
 svx/source/svdraw/svdmrkv.cxx |   24 +---
 4 files changed, 49 insertions(+), 19 deletions(-)

New commits:
commit 716fa0cc58a39a9975a6827088e9209b7b3311e6
Author: Tomaž Vajngerl 
AuthorDate: Wed May 27 12:54:54 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:55:52 2020 +0200

svx: convert ImplMarkingOverlay and friends to use unique_ptr

Change-Id: I19ba9e93f2804fded237b760a28f3ce62e4b2c5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95305
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit a6c0dc079700d662e14d422d18c6c3a9c2c3b7af)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95916
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index b62749f41335..5b57da626d4f 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -90,9 +90,9 @@ class SVX_DLLPUBLIC SdrMarkView : public SdrSnapView
 friend classSdrPageView;
 
 // #114409#-3 Migrate selections
-ImplMarkingOverlay* mpMarkObjOverlay;
-ImplMarkingOverlay* mpMarkPointsOverlay;
-ImplMarkingOverlay* 
mpMarkGluePointsOverlay;
+std::unique_ptr mpMarkObjOverlay;
+std::unique_ptr mpMarkPointsOverlay;
+std::unique_ptr 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 937464b85571..c6dd6928c755 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -165,9 +165,6 @@ SdrMarkView::SdrMarkView(
 SdrModel& rSdrModel,
 OutputDevice* pOut)
 :   SdrSnapView(rSdrModel, pOut),
-mpMarkObjOverlay(nullptr),
-mpMarkPointsOverlay(nullptr),
-mpMarkGluePointsOverlay(nullptr),
 maHdlList(this)
 {
 ImpClearVars();
@@ -363,10 +360,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();
@@ -410,8 +407,7 @@ void SdrMarkView::BrkMarkObj()
 if(IsMarkObj())
 {
 DBG_ASSERT(mpMarkObjOverlay, "SdrSnapView::MovSetPageOrg: no 
ImplPageOriginOverlay (!)");
-delete mpMarkObjOverlay;
-mpMarkObjOverlay = nullptr;
+mpMarkObjOverlay.reset();
 }
 }
 
@@ -422,9 +418,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();
@@ -475,8 +471,7 @@ void SdrMarkView::BrkMarkPoints()
 if(IsMarkPoints())
 {
 DBG_ASSERT(mpMarkPointsOverlay, "SdrSnapView::MovSetPageOrg: no 
ImplPageOriginOverlay (!)");
-delete mpMarkPointsOverlay;
-mpMarkPointsOverlay = nullptr;
+mpMarkPointsOverlay.reset();
 }
 }
 
@@ -487,10 +482,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);
@@ -534,8 +529,7 @@ void SdrMarkView::BrkMarkGluePoints()
 if(IsMarkGluePoints())
 {
 DBG_ASSERT(mpMarkGluePointsOverlay, "SdrSnapView::MovSetPageOrg: no 
ImplPageOriginOverlay (!)");
-delete mpMarkGluePoint

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|2 +
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   51 ++---
 vcl/source/graphic/VectorGraphicSearch.cxx |   31 +
 3 files changed, 65 insertions(+), 19 deletions(-)

New commits:
commit f73fef6b9b519adaadf51abb5aa1fb3dd0cda9a9
Author: Tomaž Vajngerl 
AuthorDate: Sun May 17 20:32:49 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:41:49 2020 +0200

vcl: VectorGraphicSearch return text rectangles in 100th mm

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95261
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 936a670f61fed891f8aaec77b2422f366240f193)

Change-Id: I12e7ad10dc3ed68d20d94713acece1361da27e81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95834
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

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 
 
 #include 
+#include 
 
 #include 
 
@@ -34,6 +35,7 @@ public:
 VectorGraphicSearch(Graphic const& rGraphic);
 ~VectorGraphicSearch();
 bool search(OUString const& rSearchString);
+basegfx::B2DSize pageSize();
 bool next();
 int index();
 std::vector 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/VectorGr

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - tools/qa

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 tools/qa/cppunit/test_100mm2twips.cxx |   38 +-
 1 file changed, 24 insertions(+), 14 deletions(-)

New commits:
commit 20e02bc30ada3c824a6d025d96af1b1de8a608e9
Author: Tomaž Vajngerl 
AuthorDate: Thu May 21 11:47:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:42:27 2020 +0200

tools: extend test for UnitConversion

Change-Id: I8fbc2a83f40fb04656f690b4b63d3cac9f0410c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95273
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit b1c007cd06c01078df481e020d9d81afd4de6a91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95835
Tested-by: Tomaž Vajngerl 

diff --git a/tools/qa/cppunit/test_100mm2twips.cxx 
b/tools/qa/cppunit/test_100mm2twips.cxx
index 80ceda2ffb3f..bfed8c2e2ba9 100644
--- a/tools/qa/cppunit/test_100mm2twips.cxx
+++ b/tools/qa/cppunit/test_100mm2twips.cxx
@@ -23,29 +23,39 @@
 #include 
 
 #include 
+#include 
 
-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(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(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: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/qa vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|3 +
 vcl/qa/cppunit/VectorGraphicSearchTest.cxx |   23 +
 vcl/source/graphic/VectorGraphicSearch.cxx |   49 -
 3 files changed, 74 insertions(+), 1 deletion(-)

New commits:
commit 4d823e2cfa3171a54f20c313d7670be8ed9fa604
Author: Tomaž Vajngerl 
AuthorDate: Sat May 16 19:45:41 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:41:18 2020 +0200

vcl: VectorGraphicSearch - add search result selection rectangles

Change-Id: Ia0c5610f600719bcfb5de503f3876fc896cb630a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95256
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4062b3f87689e48fd250d9cf0297a24b5427bf59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95833

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 
 #include 
 
+#include 
+
 #include 
 
 class SearchContext;
@@ -34,6 +36,7 @@ public:
 bool search(OUString const& rSearchString);
 bool next();
 int index();
+std::vector 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 
 #include 
+
 #include 
 #include 
 
@@ -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 53127b85d9c1..a00df2555fb5 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -8,9 +8,10 @@
  *
  */
 
-#include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -93,6 +94,44 @@ public:
 return FPDFText_GetSchResultIndex(mpSearchHandle);
 return -1;
 }
+
+int size()
+{
+if (mpSearchHandle)
+return FPDFText_GetSchCount(mpSearchHandle);
+return -1;
+}
+
+std::vector getTextRectangles()
+{
+std::vector 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 VectorGraphicSearch::getTextRectangles()
+{
+if (mpSearchContext)
+return mpSearchContext->getTextRectangles();
+
+return std::vector();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab:

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/tools

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/tools/UnitConversion.hxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 5eb4a8b5562fde916b4049580c62a3e400922446
Author: Tomaž Vajngerl 
AuthorDate: Sun May 17 20:12:33 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:40:10 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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95260
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 0e29e9ea7f4fe58d8dbdc7a9b9f58543a93d5bf5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95831
Tested-by: Tomaž Vajngerl 

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.278; }
+
 // Convert PPT's "master unit" (1/576 inch) to twips
 constexpr sal_Int64 convertMasterUnitToTwip(sal_Int64 n) { return n * 2540.0 / 
576.0; }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/source

2020-06-09 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/VectorGraphicSearch.hxx|6 ++--
 vcl/source/graphic/VectorGraphicSearch.cxx |   35 +
 2 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit 2514c23a4bde8adf0872494c9009bae6b8dba816
Author: Tomaž Vajngerl 
AuthorDate: Fri May 15 12:20:42 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 9 13:40:35 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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95255
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 115655a09868d5977f740995d88e36d958f30bb5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95832
Tested-by: Tomaž Vajngerl 

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 
 #include 
 
-#include 
-
 #include 
 
 class SearchContext;
@@ -23,9 +21,11 @@ class SearchContext;
 class VCL_DLLPUBLIC VectorGraphicSearch final
 {
 private:
+class Implementation;
+std::unique_ptr mpImplementation;
 Graphic maGraphic;
-FPDF_DOCUMENT mpPdfDocument;
 std::unique_ptr mpSearchContext;
+
 bool searchPDF(std::shared_ptr const& rData, OUString 
const& rSearchString);
 
 public:
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx 
b/vcl/source/graphic/VectorGraphicSearch.cxx
index 864c65f2dda2..53127b85d9c1 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -11,8 +11,26 @@
 #include 
 #include 
 
+#include 
 #include 
 
+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())
+, 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 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())
@@ -144,9 +160,10 @@ bool 
VectorGraphicSearch::searchPDF(std::shared_ptr const& rD
 return false;
 }
 
-sal_Int32 nPageIndex = std::max(rData->getPageIndex(), 0);
+sal_Int32 nPageIndex = std::max(rData->getPageIndex(), sal_Int32(0));
 
-mpSearchContext.reset(new SearchContext(mpPdfDocument, nPageIndex, 
rSearchString));
+mpSearchContext.reset(
+new SearchContext(mpImplementation->mpPdfDocument, nPageIndex, 
rSearchString));
 
 return mpSearchContext->initialize();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source sc/uiconfig

2020-06-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dialogs/searchresults.cxx |   31 +++
 sc/source/ui/inc/searchresults.hxx |2 ++
 sc/uiconfig/scalc/ui/searchresults.ui  |3 +++
 3 files changed, 36 insertions(+)

New commits:
commit 066d70da9391b43e9586736812b1064028aa53fc
Author: Caolán McNamara 
AuthorDate: Tue Jun 9 09:27:56 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 13:30:44 2020 +0200

Resolves: tdf#133780 allow sorting search result treeview columns

Change-Id: I7d5b1ffdaf99fd2e28dfd124db0fbbd4036e2dd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95896
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index 76cffa4664a5..8032a7962549 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -24,6 +24,7 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 , aSkipped(ScResId(SCSTR_SKIPPED))
 , mpBindings(_pBindings)
 , mpDoc(nullptr)
+, mbSorted(false)
 , mxList(m_xBuilder->weld_tree_view("results"))
 , mxSearchResults(m_xBuilder->weld_label("lbSearchResults"))
 , mxShowDialog(m_xBuilder->weld_check_button("cbShow"))
@@ -35,6 +36,7 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, 
weld::Window* pParen
 aWidths.push_back(mxList->get_approximate_digit_width() * 10);
 mxList->set_column_fixed_widths(aWidths);
 mxList->connect_changed(LINK(this, SearchResultsDlg, ListSelectHdl));
+mxList->connect_column_clicked(LINK(this, SearchResultsDlg, 
HeaderBarClick));
 }
 
 SearchResultsDlg::~SearchResultsDlg()
@@ -161,6 +163,35 @@ void SearchResultsDlg::Close()
 SfxDialogController::Close();
 }
 
+IMPL_LINK(SearchResultsDlg, HeaderBarClick, int, nColumn, void)
+{
+if (!mbSorted)
+{
+mxList->make_sorted();
+mbSorted = true;
+}
+
+bool bSortAtoZ = mxList->get_sort_order();
+
+//set new arrow positions in headerbar
+if (nColumn == mxList->get_sort_column())
+{
+bSortAtoZ = !bSortAtoZ;
+mxList->set_sort_order(bSortAtoZ);
+}
+else
+{
+mxList->set_sort_indicator(TRISTATE_INDET, mxList->get_sort_column());
+mxList->set_sort_column(nColumn);
+}
+
+if (nColumn != -1)
+{
+//sort lists
+mxList->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, 
nColumn);
+}
+}
+
 IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl, weld::TreeView&, void )
 {
 if (!mpDoc)
diff --git a/sc/source/ui/inc/searchresults.hxx 
b/sc/source/ui/inc/searchresults.hxx
index de48e1c9c4ac..cf48fb239ece 100644
--- a/sc/source/ui/inc/searchresults.hxx
+++ b/sc/source/ui/inc/searchresults.hxx
@@ -24,11 +24,13 @@ class SearchResultsDlg : public SfxDialogController
 OUString aSkipped;
 SfxBindings* mpBindings;
 ScDocument* mpDoc;
+bool mbSorted;
 std::unique_ptr mxList;
 std::unique_ptr mxSearchResults;
 std::unique_ptr mxShowDialog;
 
 DECL_LINK(ListSelectHdl, weld::TreeView&, void);
+DECL_LINK(HeaderBarClick, int, void);
 DECL_STATIC_LINK(SearchResultsDlg, OnShowToggled, weld::ToggleButton&, 
void);
 public:
 SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParent);
diff --git a/sc/uiconfig/scalc/ui/searchresults.ui 
b/sc/uiconfig/scalc/ui/searchresults.ui
index cb8fbaf44e7e..ca56a9950a7f 100644
--- a/sc/uiconfig/scalc/ui/searchresults.ui
+++ b/sc/uiconfig/scalc/ui/searchresults.ui
@@ -100,6 +100,7 @@
 True
 6
 Sheet
+True
 
   
   
@@ -113,6 +114,7 @@
 True
 6
 Cell
+True
 
   
   
@@ -126,6 +128,7 @@
 True
 6
 Content
+True
 
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - cui/source

2020-06-09 Thread Caolán McNamara (via logerrit)
 cui/source/inc/autocdlg.hxx  |2 +-
 cui/source/tabpages/autocdlg.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1afbe253c41e0157dfd4c024e427085413038d5e
Author: Caolán McNamara 
AuthorDate: Sat Jun 6 20:27:24 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 13:31:14 2020 +0200

Resolves: tdf#125981 use original label, not current label

Change-Id: Iddc1d3e38e70d91d60947d9867dcfb03cb5128d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95678
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 083f3824713c..4a283c8229ad 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -286,7 +286,7 @@ private:
 std::unique_ptr m_xDblEndQuotePB;
 std::unique_ptr m_xDblEndExFT;
 std::unique_ptr m_xDblStandardPB;
-std::unique_ptr m_xStandard;
+OUString m_sStandard;
 /// For anything but writer
 std::unique_ptr m_xCheckLB;
 /// Just for writer
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index cae7b77fdd40..0ea7f65c9b25 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1553,7 +1553,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(weld::Container* pPage, 
weld::DialogController*
 , m_xDblEndQuotePB(m_xBuilder->weld_button("enddouble"))
 , m_xDblEndExFT(m_xBuilder->weld_label("doubleendex"))
 , m_xDblStandardPB(m_xBuilder->weld_button("defaultdouble"))
-, m_xStandard(m_xBuilder->weld_label("singlestartex"))
+, m_sStandard(m_xSglStartExFT->get_label())
 , m_xCheckLB(m_xBuilder->weld_tree_view("checklist"))
 , m_xSwCheckLB(m_xBuilder->weld_tree_view("list"))
 {
@@ -1830,7 +1830,7 @@ IMPL_LINK(OfaQuoteTabPage, StdQuoteHdl, weld::Button&, 
rBtn, void)
 OUString OfaQuoteTabPage::ChangeStringExt_Impl( sal_UCS4 cChar )
 {
 if (!cChar)
-return m_xStandard->get_label();
+return m_sStandard;
 
 // convert codepoint value to unicode-hex string
 sal_UCS4 aStrCodes[32] = { 0, ' ', '(', 'U', '+', '0' };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - translations

2020-06-09 Thread Christian Lohmaier (via logerrit)
 translations |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cbefc4d85034f1dd751360a40a5ab01391acc3f9
Author: Christian Lohmaier 
AuthorDate: Tue Jun 9 13:23:17 2020 +0200
Commit: Gerrit Code Review 
CommitDate: Tue Jun 9 13:23:17 2020 +0200

Update git submodules

* Update translations from branch 'libreoffice-6-4'
  to c5cb3837549e8a2cfaeaf2afd3ad1a13f801d7cb
  - update translations for 6.4.5 rc1

and force-fix errors using pocheck

Change-Id: I239cedab570e1b84982ec412851223028aadcaaa

diff --git a/translations b/translations
index 41bf8bdf7ca1..c5cb3837549e 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 41bf8bdf7ca135ccb088126c2fac1856d59437ca
+Subproject commit c5cb3837549e8a2cfaeaf2afd3ad1a13f801d7cb
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - svx/source

2020-06-09 Thread Stephan Bergmann (via logerrit)
 svx/source/items/customshapeitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a195fb60c091e4e42111fb8c23324badacb35b7
Author: Stephan Bergmann 
AuthorDate: Mon Jun 8 22:44:40 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 9 13:22:35 2020 +0200

tdf#126025: Non-const GetPropertyValueByName must use non-const Sequence []

...which internally calls getArray to make sure it references a unique 
sequence.
Regression introduced with 85f28ec44a2c169c91dac9346e9c71feda6a6cab "Clean 
up C-
style casts from pointers to void".

Change-Id: Id80b75f06322c65fc31040cc0b1892fe3a0aeaab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95862
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit b505cd8635171e39d055b9a800f672a6313d8cea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95873
Reviewed-by: Michael Stahl 

diff --git a/svx/source/items/customshapeitem.cxx 
b/svx/source/items/customshapeitem.cxx
index 095aa6cec868..b67a8d6eca54 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -90,7 +90,7 @@ css::uno::Any* 
SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUStrin
 PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( 
PropertyPair( rSequenceName, rPropName ) ) );
 if ( aHashIter != aPropPairHashMap.end() )
 {
-pRet = const_cast(&(*rSecSequence)[ 
(*aHashIter).second ].Value);
+pRet = 
&const_cast &>(*rSecSequence)[ 
(*aHashIter).second ].Value;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/css loleaflet/src

2020-06-09 Thread Pedro Pinto Silva (via logerrit)
 loleaflet/css/toolbar.css  |5 +
 loleaflet/src/control/Control.DocumentNameInput.js |2 ++
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 4ad75ca85dc8be2399f99e71fbbff685de0ffe80
Author: Pedro Pinto Silva 
AuthorDate: Tue Jun 9 11:25:16 2020 +0200
Commit: Pedro Silva 
CommitDate: Tue Jun 9 13:10:48 2020 +0200

Desktop: Set (on LayerInit)  document name's size dynamically according to 
its value

Change-Id: I5e15b50c4ecf51d8e713cfc0fe116b44294e1e45
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95904
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 45b1531ec..13eb379d5 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -154,7 +154,6 @@ w2ui-toolbar {
font-size: 16px;
border: 1px solid transparent;
background-color: transparent;
-   width: 200px;
 }
 
 #document-name-input.editable {
@@ -169,7 +168,6 @@ w2ui-toolbar {
border: none;
box-shadow: inset 0 0 2px 1px #f0f0f0, 0 0 0.1px 1px #bbb;
background-color: white;
-   width: 200px;
 }
 
 #document-name-input.editable:hover:not(:focus) {
@@ -179,8 +177,7 @@ w2ui-toolbar {
background-image: url('images/baseline-edit.svg');
background-position: right;
background-repeat: no-repeat;
-   padding-right: 20px;
-   width: 181px;
+   padding-right: 2px;
 }
 #tb_editbar_item_fold table.w2ui-button {
margin: 0px 14px 0px 4px !important;
diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index e11d6bf95..13f83c4d2 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -59,6 +59,8 @@ L.Control.DocumentNameInput = L.Control.extend({
},
 
onDocLayerInit: function() {
+   $('#document-name-input').attr('size', 
$('#document-name-input').val().length);
+
// FIXME: Android app would display a temporary filename, not 
the actual filename
if (window.ThisIsTheAndroidApp) {
$('#document-name-input').hide();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - loleaflet/images

2020-06-09 Thread Pedro Pinto Silva (via logerrit)
 loleaflet/images/lc_latest-updates.svg |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit acd2d39a7c75b8c671462398246f72b25d3cd8ac
Author: Pedro Pinto Silva 
AuthorDate: Mon Apr 20 17:18:38 2020 +0200
Commit: Pedro Silva 
CommitDate: Tue Jun 9 13:10:08 2020 +0200

Add missing latest updates icons

Change-Id: I41fa30979a121672516cea06905e071ff8486297
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92586
Tested-by: Pedro Pinto da Silva 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pedro Pinto da Silva 
Reviewed-by: Muhammet Kara 
(cherry picked from commit 55a985dc73419cc6651e44da4707b314a55e713b)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92532
Reviewed-by: Pedro Silva 

diff --git a/loleaflet/images/lc_latest-updates.svg 
b/loleaflet/images/lc_latest-updates.svg
new file mode 100644
index 0..085adb2c1
--- /dev/null
+++ b/loleaflet/images/lc_latest-updates.svg
@@ -0,0 +1,19 @@
+http://www.w3.org/2000/svg"; 
xmlns:cc="http://creativecommons.org/ns#"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
+ 
+  
+   
+image/svg+xml
+http://purl.org/dc/dcmitype/StillImage"/>
+
+   
+  
+ 
+ 
+ 
+ 
+  
+  
+  
+  
+ 
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: 6.4.4.4 libssl error

2020-06-09 Thread Jan-Marek Glogowski
Am 09.06.20 um 06:48 schrieb Chetan Aru:
> I am trying to build the LibreOffice 6.4.4.4 tag on Windows machine
> (Virtual Machine). I have installed cygwin 64-bit and doing 64-bit
> build. I am getting the following errors. Can someone please help? Seems
> that having this patch ( https://gerrit.libreoffice.org/c/core/+/95559)
> helps, but how is it that 6.4.4.4 was built on Windows machine without this?

...
[windows PDB SSL error messages]
...

As already discussed in the original / master Gerrit change
(https://gerrit.libreoffice.org/c/core/+/87358), please use the
libreoffice-6-4 branch, or otherwise just cherry-pick the fix to your
libreoffice-6-4-4 branch.

git cherry-pick 2786e5a0e79c8e3b30fed02e27cc9973e28cd76c
should just do that.

And nobody investigated further, why the source built for all other
people ignoring the msbuild error, but it broke for me. Still fixing the
error is definitely the correct solution, so I suggest you just do that too.

Jan-Narek
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: Branch 'refs/tags/cp-4.2.4-3' - 3 commits - loleaflet/images loleaflet/js

2020-06-09 Thread Michael Meeks (via logerrit)
Rebased ref, commits from common ancestor:
commit e77e689e10bbb86ee52f357e70947f6142bd886b
Author: Michael Meeks 
AuthorDate: Tue Jun 9 11:29:11 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Jun 9 12:47:33 2020 +0200

Proxy: detect un-responsive sockets & close after 30secs.

Also:
+ fix double poll timer in error
+ remove & rename incorrect interval timer names

Change-Id: Idfae44c0a388312b248c78fc9ad04fe3725990b6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95910
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index c6590389b..6a0bd23df 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -350,14 +350,16 @@
};
this.sendQueue = '';
this._signalErrorClose = function() {
+   clearInterval(this.pollInterval);
+   clearTimeout(this.delaySession);
+   this.pollInterval = undefined;
+   this.delaySession = undefined;
+
if (that.readyState < 3)
{
this.onerror();
this.onclose();
}
-   clearInterval(this.waitInterval);
-   clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
this.sessionId = 'open';
this.inSerial = 0;
this.outSerial = 0;
@@ -365,9 +367,14 @@
this.openInflight = 0;
this.readyState = 3; // CLOSED
};
+   // For those who think that long-running sockets are a
+   // better way to wait: you're so right. However, each
+   // consumes a scarce server worker thread while it waits,
+   // so ... back in the real world:
this._setPollInterval = function(intervalMs) {
-   clearInterval(that.pollInterval);
-   that.pollInterval = setInterval(that.doSend, 
intervalMs);
+   clearInterval(this.pollInterval);
+   if (this.readyState === 1)
+   this.pollInterval = setInterval(this.doSend, 
intervalMs);
},
this.doSend = function () {
if (that.sessionId === 'open')
@@ -388,6 +395,11 @@
console.debug('High latency connection 
- too much in-flight, throttling to ' + that.curPollMs + ' ms.');
that._setPollInterval(that.curPollMs);
}
+   else if (performance.now() - 
that.lastDataTimestamp > 30 * 1000)
+   {
+   console.debug('Close connection after 
no response for 30secs');
+   that._signalErrorClose();
+   }
else
console.debug('High latency connection 
- too much in-flight, pausing.');
return;
@@ -490,12 +502,7 @@
that.sessionId = this.responseText;
that.readyState = 1;
that.onopen();
-
-   // For those who think that 
long-running sockets are a
-   // better way to wait: you're so right. 
However, each
-   // consumes a scarce server worker 
thread while it waits,
-   // so ... back in the real world:
-   that.pollInterval = 
setInterval(that.doSend, that.curPollMs);
+   that._setPollInterval(that.curPollMs);
}
});
req.addEventListener('loadend', function() {
@@ -540,9 +547,9 @@
console.debug('proxy: close socket');
this.readyState = 3;
this.onclose();
-   clearInterval(this.waitInterval);
+   clearInterval(this.pollInterval);
clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
+   this.pollInterval = undefined;
if (oldState === 1) // was open
this.sendCloseMsg(this.unloading);
this.sessionId = 'open';
commit 80d8018b40ff893ff8d2cb0865dd827455506a1a
Author: Michael Meeks 
AuthorDate: Tue Jun 9 10:44:30 2020 +0100
Commit: Andras Timar 
CommitDate:

[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-4' - 2 commits - loleaflet/js

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/js/global.js |   50 ++---
 1 file changed, 27 insertions(+), 23 deletions(-)

New commits:
commit e77e689e10bbb86ee52f357e70947f6142bd886b
Author: Michael Meeks 
AuthorDate: Tue Jun 9 11:29:11 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Jun 9 12:47:33 2020 +0200

Proxy: detect un-responsive sockets & close after 30secs.

Also:
+ fix double poll timer in error
+ remove & rename incorrect interval timer names

Change-Id: Idfae44c0a388312b248c78fc9ad04fe3725990b6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95910
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index c6590389b..6a0bd23df 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -350,14 +350,16 @@
};
this.sendQueue = '';
this._signalErrorClose = function() {
+   clearInterval(this.pollInterval);
+   clearTimeout(this.delaySession);
+   this.pollInterval = undefined;
+   this.delaySession = undefined;
+
if (that.readyState < 3)
{
this.onerror();
this.onclose();
}
-   clearInterval(this.waitInterval);
-   clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
this.sessionId = 'open';
this.inSerial = 0;
this.outSerial = 0;
@@ -365,9 +367,14 @@
this.openInflight = 0;
this.readyState = 3; // CLOSED
};
+   // For those who think that long-running sockets are a
+   // better way to wait: you're so right. However, each
+   // consumes a scarce server worker thread while it waits,
+   // so ... back in the real world:
this._setPollInterval = function(intervalMs) {
-   clearInterval(that.pollInterval);
-   that.pollInterval = setInterval(that.doSend, 
intervalMs);
+   clearInterval(this.pollInterval);
+   if (this.readyState === 1)
+   this.pollInterval = setInterval(this.doSend, 
intervalMs);
},
this.doSend = function () {
if (that.sessionId === 'open')
@@ -388,6 +395,11 @@
console.debug('High latency connection 
- too much in-flight, throttling to ' + that.curPollMs + ' ms.');
that._setPollInterval(that.curPollMs);
}
+   else if (performance.now() - 
that.lastDataTimestamp > 30 * 1000)
+   {
+   console.debug('Close connection after 
no response for 30secs');
+   that._signalErrorClose();
+   }
else
console.debug('High latency connection 
- too much in-flight, pausing.');
return;
@@ -490,12 +502,7 @@
that.sessionId = this.responseText;
that.readyState = 1;
that.onopen();
-
-   // For those who think that 
long-running sockets are a
-   // better way to wait: you're so right. 
However, each
-   // consumes a scarce server worker 
thread while it waits,
-   // so ... back in the real world:
-   that.pollInterval = 
setInterval(that.doSend, that.curPollMs);
+   that._setPollInterval(that.curPollMs);
}
});
req.addEventListener('loadend', function() {
@@ -540,9 +547,9 @@
console.debug('proxy: close socket');
this.readyState = 3;
this.onclose();
-   clearInterval(this.waitInterval);
+   clearInterval(this.pollInterval);
clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
+   this.pollInterval = undefined;
if (oldState === 1) // was open
this.sendCloseMsg(this.unloading);
this.sessionId = 'open';
commit 80d8018b40ff893ff8d2cb0865dd827455506a1a
Aut

[Libreoffice-commits] online.git: loleaflet/js

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/js/global.js |   33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

New commits:
commit 28517a499391273aa5bf2ec32e02012d5bfc5313
Author: Michael Meeks 
AuthorDate: Tue Jun 9 11:29:11 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jun 9 12:43:05 2020 +0200

Proxy: detect un-responsive sockets & close after 30secs.

Also:
+ fix double poll timer in error
+ remove & rename incorrect interval timer names

Change-Id: Idfae44c0a388312b248c78fc9ad04fe3725990b6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95910
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index d033e2f64..3420b9c13 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -350,14 +350,16 @@
};
this.sendQueue = '';
this._signalErrorClose = function() {
+   clearInterval(this.pollInterval);
+   clearTimeout(this.delaySession);
+   this.pollInterval = undefined;
+   this.delaySession = undefined;
+
if (that.readyState < 3)
{
this.onerror();
this.onclose();
}
-   clearInterval(this.waitInterval);
-   clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
this.sessionId = 'open';
this.inSerial = 0;
this.outSerial = 0;
@@ -365,9 +367,14 @@
this.openInflight = 0;
this.readyState = 3; // CLOSED
};
+   // For those who think that long-running sockets are a
+   // better way to wait: you're so right. However, each
+   // consumes a scarce server worker thread while it waits,
+   // so ... back in the real world:
this._setPollInterval = function(intervalMs) {
-   clearInterval(that.pollInterval);
-   that.pollInterval = setInterval(that.doSend, 
intervalMs);
+   clearInterval(this.pollInterval);
+   if (this.readyState === 1)
+   this.pollInterval = setInterval(this.doSend, 
intervalMs);
},
this.doSend = function () {
if (that.sessionId === 'open')
@@ -388,6 +395,11 @@
console.debug('High latency connection 
- too much in-flight, throttling to ' + that.curPollMs + ' ms.');
that._setPollInterval(that.curPollMs);
}
+   else if (performance.now() - 
that.lastDataTimestamp > 30 * 1000)
+   {
+   console.debug('Close connection after 
no response for 30secs');
+   that._signalErrorClose();
+   }
else
console.debug('High latency connection 
- too much in-flight, pausing.');
return;
@@ -490,12 +502,7 @@
that.sessionId = this.responseText;
that.readyState = 1;
that.onopen();
-
-   // For those who think that 
long-running sockets are a
-   // better way to wait: you're so right. 
However, each
-   // consumes a scarce server worker 
thread while it waits,
-   // so ... back in the real world:
-   that.pollInterval = 
setInterval(that.doSend, that.curPollMs);
+   that._setPollInterval(that.curPollMs);
}
});
req.addEventListener('loadend', function() {
@@ -540,9 +547,9 @@
console.debug('proxy: close socket');
this.readyState = 3;
this.onclose();
-   clearInterval(this.waitInterval);
+   clearInterval(this.pollInterval);
clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
+   this.pollInterval = undefined;
if (oldState === 1) // was open
this.sendCloseMsg(this.unloading);
this.sessionId = 'open';
___
Libreoffice-commit

[Libreoffice-commits] core.git: vcl/unx

2020-06-09 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkinst.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 341cc5bfa06e895f091523bbf8c159ca626b6f1a
Author: Caolán McNamara 
AuthorDate: Mon Jun 8 14:38:08 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 9 12:18:29 2020 +0200

tdf#133412 replicate active entry to ComboBox replacement

Change-Id: Ifde87738710406fb9f28008fa96241d59c52f450
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95808
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index da66005a8a9e..6d692f76405d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13848,6 +13848,7 @@ public:
 , m_nMRUCount(0)
 , m_nMaxMRUCount(0)
 {
+int nActive = gtk_combo_box_get_active(m_pComboBox);
 insertAsParent(GTK_WIDGET(m_pComboBox), GTK_WIDGET(getContainer()));
 gtk_widget_set_visible(GTK_WIDGET(m_pComboBox), false);
 gtk_widget_set_no_show_all(GTK_WIDGET(m_pComboBox), true);
@@ -13936,6 +13937,9 @@ public:
 
 g_list_free(cells);
 
+if (nActive != -1)
+tree_view_set_cursor(nActive);
+
 g_signal_connect(m_pMenuWindow, "grab-broken-event", 
G_CALLBACK(signalGrabBroken), this);
 g_signal_connect(m_pMenuWindow, "button-press-event", 
G_CALLBACK(signalButtonPress), this);
 g_signal_connect(m_pMenuWindow, "motion-notify-event", 
G_CALLBACK(signalMotion), this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa writerfilter/source

2020-06-09 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf133455.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx|   17 ++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   39 +--
 writerfilter/source/dmapper/TableManager.cxx |   16 ++
 writerfilter/source/dmapper/TableManager.hxx |   33 
 writerfilter/source/dmapper/TablePropertiesHandler.cxx   |4 -
 writerfilter/source/dmapper/TablePropertiesHandler.hxx   |   11 
 7 files changed, 81 insertions(+), 39 deletions(-)

New commits:
commit c043b589c4b185dc4f78e52ef16e2600c121decb
Author: László Németh 
AuthorDate: Thu Jun 4 13:32:53 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 9 12:07:41 2020 +0200

tdf#133455 DOCX import: fix table border regression

caused by commit 8ffc1299ebf83450e67cf2a89304859e2558cd27
(tdf#95033 DOCX import: apply tblPrEx table border).

Change-Id: Ief4da3bce3282b5dab1ce4dabb4e075efcc1abaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95504
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 3593dd550882783b5f776262e928fc058c4dbd9d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95550
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf133455.docx 
b/sw/qa/extras/ooxmlexport/data/tdf133455.docx
new file mode 100644
index ..e852976995e6
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133455.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 74e98cfb49da..c2aaec5c64a9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -726,6 +726,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95033, "tdf95033.docx")
 assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[9]/w:tc[2]/w:tcPr/w:tcBorders/w:bottom[@w:val = 
'nil']", 0);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf133455, "tdf133455.docx")
+{
+xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+if (!pXmlDocument)
+return;
+
+//Not disabled table cell borders
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:start[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:end[@w:val = 
'nil']", 0);
+assertXPath(pXmlDocument, 
"/w:document/w:body/w:tbl/w:tr[11]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 
'nil']", 0);
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx")
 {
 // The problem was that not hidden shapes anchored to empty hidden 
paragraphs were imported as hidden.
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index dd5a14b732eb..c32b33af10c4 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -762,11 +762,6 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 pCellProperties[nRow].realloc( aRowOfCellsIterator->size() );
 beans::PropertyValues* pSingleCellProperties = 
pCellProperties[nRow].getArray();
 
-static const PropertyIds pBorders[] =
-{
-PROP_TOP_BORDER, PROP_LEFT_BORDER, PROP_BOTTOM_BORDER, 
PROP_RIGHT_BORDER
-};
-
 while( aCellIterator != aCellIteratorEnd )
 {
 PropertyMapPtr pAllCellProps( new PropertyMap );
@@ -823,33 +818,15 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 PropertyMapPtr pStyleProps = 
rInfo.pTableStyle->GetProperties( nCnfStyleMask );
 
 // Check if we need to clean up some empty border 
definitions to match what Word does.
-// Apply also possible tblPrEx borders on cells
+static const PropertyIds pBorders[] =
+{
+PROP_TOP_BORDER, PROP_LEFT_BORDER, PROP_BOTTOM_BORDER, 
PROP_RIGHT_BORDER
+};
 for (const PropertyIds& rBorder : pBorders)
 {
 std::optional oStyleCellBorder 
= pStyleProps->getProperty(rBorder);
  

[Libreoffice-commits] online.git: loleaflet/js

2020-06-09 Thread Michael Meeks (via logerrit)
 loleaflet/js/global.js |   35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

New commits:
commit 19b544477e3f425fb55ca6e51be255860c6b13b1
Author: Michael Meeks 
AuthorDate: Tue Jun 9 10:44:30 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jun 9 12:02:56 2020 +0200

Proxy: don't implement a magic re-connecting socket.

Websockets don't magically re-connect, so we shouldn't either.
Also avoid starting our send interval timer until we've opened
to simplify.

Change-Id: Id71049da2d4b4d0ac2f38a3d7410f2446d04f0b1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95906
Tested-by: Jenkins CollaboraOffice 
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index d50739193..d033e2f64 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -354,15 +354,15 @@
{
this.onerror();
this.onclose();
-   clearInterval(this.waitInterval);
-   clearTimeout(this.delaySession);
-   this.waitInterval = undefined;
-   this.sessionId = 'open';
-   this.inSerial = 0;
-   this.outSerial = 0;
-   this.msgInflight = 0;
-   this.openInflight = 0;
}
+   clearInterval(this.waitInterval);
+   clearTimeout(this.delaySession);
+   this.waitInterval = undefined;
+   this.sessionId = 'open';
+   this.inSerial = 0;
+   this.outSerial = 0;
+   this.msgInflight = 0;
+   this.openInflight = 0;
this.readyState = 3; // CLOSED
};
this._setPollInterval = function(intervalMs) {
@@ -373,10 +373,7 @@
if (that.sessionId === 'open')
{
if (that.readyState === 3)
-   {
-   console.debug('Session closed, opening 
a new one.');
-   that.getSessionId();
-   }
+   console.debug('Error: sending on closed 
socket');
return;
}
 
@@ -488,11 +485,17 @@
console.debug('Error: failed to fetch 
session id! error: ' + this.status);
that._signalErrorClose();
}
-   else
+   else // we connected - lets get going ...
{
that.sessionId = this.responseText;
that.readyState = 1;
that.onopen();
+
+   // For those who think that 
long-running sockets are a
+   // better way to wait: you're so right. 
However, each
+   // consumes a scarce server worker 
thread while it waits,
+   // so ... back in the real world:
+   that.pollInterval = 
setInterval(that.doSend, that.curPollMs);
}
});
req.addEventListener('loadend', function() {
@@ -555,12 +558,6 @@
 
// queue fetch of session id.
this.getSessionId();
-
-   // For those who think that long-running sockets are a
-   // better way to wait: you're so right. However, each
-   // consumes a scarce server worker thread while it waits,
-   // so ... back in the real world:
-   this.pollInterval = setInterval(this.doSend, this.curPollMs);
};
 
if (global.socketProxy)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-4' - loleaflet/images

2020-06-09 Thread Pedro Pinto Silva (via logerrit)
 loleaflet/images/lc_wordcountdialog.svg |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 91455bfd999c6438313974f949eb2f5e7b248014
Author: Pedro Pinto Silva 
AuthorDate: Tue Jun 9 09:40:10 2020 +0200
Commit: Pedro Silva 
CommitDate: Tue Jun 9 11:29:48 2020 +0200

Mobile: Add world count icon to the hamburger menu

Change-Id: Ie637ef42b05904d4399363f86d094bcf3a5e257d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95894
Tested-by: Jenkins
Tested-by: Pedro Silva 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pedro Silva 
(cherry picked from commit bd1c6ff8b60f638117741d233bba0104364d7319)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95875

diff --git a/loleaflet/images/lc_wordcountdialog.svg 
b/loleaflet/images/lc_wordcountdialog.svg
new file mode 100644
index 0..f5c43498d
--- /dev/null
+++ b/loleaflet/images/lc_wordcountdialog.svg
@@ -0,0 +1 @@
+http://www.w3.org/2000/svg";>
\ No newline at end of file
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: common/SigUtil.cpp common/SigUtil.hpp loolwsd.xml.in wsd/Admin.cpp wsd/Admin.hpp wsd/AdminModel.cpp wsd/AdminModel.hpp wsd/LOOLWSD.cpp

2020-06-09 Thread Gabriel Masei (via logerrit)
 common/SigUtil.cpp |6 ++---
 common/SigUtil.hpp |3 +-
 loolwsd.xml.in |7 +
 wsd/Admin.cpp  |   26 +++--
 wsd/Admin.hpp  |4 +++
 wsd/AdminModel.cpp |   63 -
 wsd/AdminModel.hpp |   60 ++
 wsd/LOOLWSD.cpp|   15 
 8 files changed, 167 insertions(+), 17 deletions(-)

New commits:
commit ac17984226dac695fbd68699e168e2332f1ab9c7
Author: Gabriel Masei 
AuthorDate: Mon Jun 8 13:41:03 2020 +0300
Commit: Michael Meeks 
CommitDate: Tue Jun 9 11:25:44 2020 +0200

admin: cleanup resource consuming kits

Change-Id: Ifafbadc61b788adc90c03fb92e0231f9e599c360
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95794
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index 5a587f30d..4891010db 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -355,13 +355,13 @@ namespace SigUtil
 sigaction(SIGUSR1, &action, nullptr);
 }
 
-/// Kill the given pid with SIGTERM.  Returns true when the pid does not 
exist any more.
-bool killChild(const int pid)
+/// Kill the given pid with SIGKILL as default.  Returns true when the pid 
does not exist any more.
+bool killChild(const int pid, const int signal)
 {
 LOG_DBG("Killing PID: " << pid);
 // Don't kill anything in the fuzzer case: pid == 0 would kill the 
fuzzer itself, and
 // killing random other processes is not a great idea, either.
-if (Util::isFuzzing() || kill(pid, SIGKILL) == 0 || errno == ESRCH)
+if (Util::isFuzzing() || kill(pid, signal) == 0 || errno == ESRCH)
 {
 // Killed or doesn't exist.
 return true;
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index 9bccf0256..d3eaf9726 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 
 #if MOBILEAPP
 static constexpr bool ShutdownRequestFlag(false);
@@ -73,7 +74,7 @@ namespace SigUtil
 /// Kills a child process and returns true when
 /// child pid is removed from the process table
 /// after a certain (short) timeout.
-bool killChild(const int pid);
+bool killChild(const int pid, const int signal = SIGKILL);
 
 /// Dump a signal-safe back-trace
 void dumpBacktrace();
diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index e66f3526d..27e1d6e87 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -30,6 +30,13 @@
 0
 100
 100
+
+1
+60
+300
+3072
+85
+
 
 
 
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 78956b222..c1aec45da 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -389,7 +389,8 @@ Admin::Admin() :
 _lastRecvCount(0),
 _cpuStatsTaskIntervalMs(DefStatsIntervalMs),
 _memStatsTaskIntervalMs(DefStatsIntervalMs * 2),
-_netStatsTaskIntervalMs(DefStatsIntervalMs * 2)
+_netStatsTaskIntervalMs(DefStatsIntervalMs * 2),
+_cleanupIntervalMs(DefStatsIntervalMs * 10)
 {
 LOG_INF("Admin ctor.");
 
@@ -415,13 +416,14 @@ Admin::~Admin()
 
 void Admin::pollingThread()
 {
-std::chrono::steady_clock::time_point lastCPU, lastMem, lastNet;
+std::chrono::steady_clock::time_point lastCPU, lastMem, lastNet, 
lastCleanup;
 
 _model.setThreadOwner(std::this_thread::get_id());
 
 lastCPU = std::chrono::steady_clock::now();
 lastMem = lastCPU;
 lastNet = lastCPU;
+lastCleanup = lastCPU;
 
 while (!isStop() && !SigUtil::getTerminationFlag() && 
!SigUtil::getShutdownRequestFlag())
 {
@@ -483,6 +485,19 @@ void Admin::pollingThread()
 lastNet = now;
 }
 
+int cleanupWait = _cleanupIntervalMs -
+std::chrono::duration_cast(now - 
lastCleanup).count();
+if (cleanupWait <= MinStatsIntervalMs / 2) // Close enough
+{
+if (_defDocProcSettings.getCleanupSettings().getEnable())
+{
+cleanupResourceConsumingDocs();
+
+cleanupWait += _cleanupIntervalMs;
+lastCleanup = now;
+}
+}
+
 // (re)-connect (with sync. DNS - urk) to one monitor at a time
 if (_pendingConnects.size())
 {
@@ -495,7 +510,7 @@ void Admin::pollingThread()
 }
 
 // Handle websockets & other work.
-const int timeout = capAndRoundInterval(std::min(std::min(cpuWait, 
memWait), netWait));
+const int timeout = 
capAndRoundInterval(std::min(std::min(std::min(cpuWait, memWait), netWait), 
cleanupWait));
 LOG_TRC("Admin poll for " << timeout << "ms.");
 poll(timeout * 1000); // continue with ms for admin, settings etc.
 }
@@ -773,6 +788,11 @@ void Admin::notifyDocsMemDirtyChanged()
 _model.notifyDocsMemDirtyCh

[Libreoffice-commits] core.git: uitest/libreoffice

2020-06-09 Thread Stephan Bergmann (via logerrit)
 uitest/libreoffice/connection.py |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 41d4458310bfd68cf756094ba9484ac071b20db0
Author: Stephan Bergmann 
AuthorDate: Tue Jun 9 09:43:45 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 9 11:15:30 2020 +0200

Print more information about the swallowed exceptions

Change-Id: I126413f9eb5c5698e4500c4fc5e04f31a9c574fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95895
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py
index 68330b47d6cf..2b0e9c227479 100644
--- a/uitest/libreoffice/connection.py
+++ b/uitest/libreoffice/connection.py
@@ -7,6 +7,7 @@
 
 import subprocess
 import time
+import traceback
 import uuid
 import os
 
@@ -126,10 +127,10 @@ class OfficeConnection:
 xDesktop.terminate()
 print("...done")
 except 
pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
-print("caught UnknownPropertyException while TearDown")
+print("caught while TearDown:\n", traceback.format_exc())
 pass  # ignore, also means disposed
 except pyuno.getClass("com.sun.star.lang.DisposedException"):
-print("caught DisposedException while TearDown")
+print("caught while TearDown:\n", traceback.format_exc())
 pass  # ignore
 else:
 self.soffice.terminate()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - 2 commits - filter/source include/oox oox/source sc/source writerfilter/source

2020-06-09 Thread Michael Stahl (via logerrit)
 filter/source/msfilter/eschesdo.cxx   |   23 -
 include/oox/token/relationship.hxx|1 
 oox/source/token/relationship.inc |1 
 sc/source/filter/excel/excdoc.cxx |7 
 sc/source/filter/excel/xeescher.cxx   |  351 --
 sc/source/filter/inc/xcl97rec.hxx |2 
 sc/source/filter/inc/xeescher.hxx |   17 +
 sc/source/filter/xcl97/xcl97rec.cxx   |   58 +++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   16 -
 9 files changed, 430 insertions(+), 46 deletions(-)

New commits:
commit c9d842ddc54b701eb57cc79032fabcf14391a3a1
Author: Michael Stahl 
AuthorDate: Mon Jun 8 13:05:27 2020 +0200
Commit: Michael Stahl 
CommitDate: Tue Jun 9 10:40:13 2020 +0200

tdf#132596 writerfilter: fix paste of RTF with header/footer

The problem is that writerfilter inserts the content of header/footer
into the body text, but then DomainMapper_Impl::PopPageHeaderFooter()
calls RemoveLastParagraph() and deletes a body paragraph containing a
fieldmark, and then in Undo some SwHistoryTextFieldmark can't find it,
and since ffb26b81e1c7ff1d64959200247bb2edd5a569da this crashes.

This is because of the borked error handling in
DomainMapper_Impl::PushPageHeaderFooter(); the
m_xBodyText->createTextCursorByRange() call throws an exception that is
swallowed, so the m_aTextAppendStack doesn't have an entry containing
the position in the header.

To fix the error handling, set m_bDiscardHeaderFooter = false only when
everything was successful.

Also fix the call to be xText->createTextCursorByRange instead
(this is a regression from 232ad2f2588beff50cb5c1f3b689c581ba317583).

Then it turns out that Undo still crashes, because sw can't Undo
changes of header/footer content, so just return early unless it's
a new document.

Change-Id: Ie5aeb45447c5fbd4b3ae15c4cffb9800583a6d1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95797
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 27151ccf2305eac4192f8c4c267170096a19)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95824
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1130007df6f7..76ba72b32aad 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2212,6 +2212,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 const PropertyIds ePropTextLeft = bHeader? PROP_HEADER_TEXT_LEFT: 
PROP_FOOTER_TEXT_LEFT;
 const PropertyIds ePropText = bHeader? PROP_HEADER_TEXT: PROP_FOOTER_TEXT;
 
+m_bDiscardHeaderFooter = true;
 m_eInHeaderFooterImport
 = bHeader ? HeaderFooterImportState::header : 
HeaderFooterImportState::footer;
 
@@ -2225,6 +2226,11 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 // content is not copied from the previous section
 pSectionContext->ClearHeaderFooterLinkToPrevious(bHeader, eType);
 
+if (!m_bIsNewDoc)
+{
+return; // TODO sw cannot Undo insert header/footer without 
crashing
+}
+
 uno::Reference< beans::XPropertySet > xPageStyle =
 pSectionContext->GetPageStyle(
 *this,
@@ -2252,15 +2258,15 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool 
bHeader, SectionPropertyMap::P
 xPageStyle->getPropertyValue(getPropertyName(bLeft? 
ePropTextLeft: ePropText)) >>= xText;
 
 m_aTextAppendStack.push(TextAppendContext(uno::Reference< 
text::XTextAppend >(xText, uno::UNO_QUERY_THROW),
-m_bIsNewDoc? uno::Reference(): 
m_xBodyText->createTextCursorByRange(xText->getStart(;
-}
-else
-{
-m_bDiscardHeaderFooter = true;
+m_bIsNewDoc
+? uno::Reference()
+: xText->createTextCursorByRange(xText->getStart(;
+m_bDiscardHeaderFooter = false; // set only on success!
 }
 }
 catch( const uno::Exception& )
 {
+DBG_UNHANDLED_EXCEPTION("writerfilter.dmapper");
 }
 }
 }
commit 577dd32b1c4eb0a4cff574fbabca987cb52b831b
Author: Serge Krot 
AuthorDate: Wed May 13 22:52:52 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 10:34:32 2020 +0200

tdf#106181 XLSX export: output form controls

Prepared general algorithm to ouput form controls into XLSX.
For now only CHECKBOX is supported with a possibility to
link withem to any worksheet/cell.

Change-Id: Ide8739d81ffb755aeae074c4ebecf24251383e34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94161

[Libreoffice-commits] core.git: 4 commits - sc/uiconfig sd/uiconfig sw/source sw/uiconfig

2020-06-09 Thread Michael Stahl (via logerrit)
 sc/uiconfig/scalc/ui/notebookbar.ui   |   11 
 sd/uiconfig/sdraw/ui/notebookbar.ui   |   11 
 sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui|  124 +-
 sd/uiconfig/simpress/ui/notebookbar.ui|   11 
 sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui |  172 +++---
 sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui|  164 ++---
 sw/source/filter/ww8/wrtw8nds.cxx |6 
 sw/source/ui/misc/bookmark.cxx|4 
 sw/uiconfig/swriter/ui/insertbookmark.ui  |7 
 sw/uiconfig/swriter/ui/notebookbar.ui |   11 
 10 files changed, 243 insertions(+), 278 deletions(-)

New commits:
commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc
Author: Michael Stahl 
AuthorDate: Mon Jun 8 17:24:18 2020 +0200
Commit: Michael Stahl 
CommitDate: Tue Jun 9 10:38:53 2020 +0200

tdf#133604 sw: DOCX export: put CH_TXT_ATR_FORMELEMENT in its own run

Commit b03fefcc4dbdfee3b9eeb5fa0e586dd12ddcd3d2 ought to have fixed this
but didn't; the run following the CH_TXT_ATR_FORMELEMENT still ended up
inside the field result.

But when importing that into Writer, it appeared correct; Word shows the
problem.

(regression from 94e0b8407b02d76b27324b8b08012eb024aca9e9)

Change-Id: I1fc1328223353422a83d403e8f790d156dbec4e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95843
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index b66745241dd9..4df9bd3f9761 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -252,7 +252,11 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
 }
 sal_Int32 fieldSepPos = aText.indexOf(CH_TXT_ATR_FIELDSEP, nStartPos);
 sal_Int32 fieldStartPos = aText.indexOf(CH_TXT_ATR_FIELDSTART, nStartPos);
-sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, 
nStartPos);
+sal_Int32 formElementPos = aText.indexOf(CH_TXT_ATR_FORMELEMENT, nStartPos 
- 1);
+if (0 <= formElementPos && formElementPos < nStartPos)
+{
+++formElementPos; // tdf#133604 put this in its own run
+}
 
 const sal_Int32 pos = lcl_getMinPos(
 lcl_getMinPos(lcl_getMinPos(fieldEndPos, fieldSepPos), fieldStartPos),
commit 3a371da71ab738a99e81e75c736fa5e384ebd9d3
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 10:33:30 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1c67f547558c..29f090f94ff6 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -343,6 +343,10 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 }
 
 m_bAreProtected = 
rSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS);
+
+// disabled until "Hide" flag is not checked
+m_xConditionED->set_sensitive(false);
+m_xConditionFT->set_sensitive(false);
 }
 
 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index f062451af767..8b65bfc619b9 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -71,9 +71,9 @@
 
   
   
-True
-True
-6
+False
+False
+7
   
 
 
@@ -145,6 +145,7 @@
 True
 False
 start
+start
 True
 True
   
commit 7e4372c8569595adb4ee9ac225ada7f576121c48
Author: andreas kainz 
AuthorDate: Sun Jun 7 23:42:45 2020 +0200
Commit: Andreas Kainz 🦅 
CommitDate: Tue Jun 9 10:32:43 2020 +0200

tdf#127122 Sync View and Review group in groupedbar apps

Change-Id: I3b583ef79e651385a044f47b17684a21541467db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95771
Tested-by: Jenkins
Reviewed-by: Andreas Kainz 🦅 

diff --git a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui 
b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
index 3d8998f4b711..0b580540e368 100644
--- a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
+++ b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
@@ -3950,11 +3950,11 @@
   
 

Re: 6.4.4.4 libssl error

2020-06-09 Thread Michael Stahl

On 09.06.20 09:42, Chetan Aru wrote:

Thanks.
There is a difference in how I invoke the build.
LO: '--enable-dbgutil --disable-symbols --disable-64-bit 
--disable-dependency-tracking 
--srcdir=/home/tdf/lode/jenkins/workspace/gerrit_windows 
--enable-option-checking=fatal'
Me:--with-external-tar=/path --with-junit=/path --with-ant-home=/path 
--enable-pch --disable-ccache --enable-release-build --enable-64-bit 
--disable-dependency-tracking --with-visual-studio=2019 
--with-jdk-home="/cygdrive/c/Program Files/AdoptOpenJDK/jdk-11-hotspot"


that's probably irrelevant. most likely you have a different MSBuild.exe 
version.


The SSL DLL errors are from the tar files related to external 
tar openssl-1.0.2t.tar.gz.
I was going with options mentioned on 
https://wiki.documentfoundation.org/Development/BuildingOnWindows
If I don't specify --with-external-tar, do I need to install more stuff? 
Where can I find more documentation on that?


--with-external-tar only changes which directory is used to store tarballs.

it's not possible to use "system" libraries on Windows that don't exist 
in the Windows SDK, like OpenSSL.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: dbaccess/source

2020-06-09 Thread Samuel Mehrbrodt (via logerrit)
 dbaccess/source/core/dataaccess/ModelImpl.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bed8c65ca4143f66ec5cfdcc3fb5213f04035220
Author: Samuel Mehrbrodt 
AuthorDate: Fri May 8 12:14:50 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Jun 9 10:13:50 2020 +0200

Fix variable name

Change-Id: I307f4bca16cc54de8c049df570ba36c635f4e4d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93713
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 9aa56fe53787..2fae3b051ba6 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -846,7 +846,7 @@ bool 
ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
 bool bTryToPreserveScriptSignature = false;
 utl::TempFile aTempFile;
 aTempFile.EnableKillingFile();
-OUString m_sTmpFileUrl = aTempFile.GetURL();
+OUString sTmpFileUrl = aTempFile.GetURL();
 SignatureState aSignatureState = getScriptingSignatureState();
 if (aSignatureState == SignatureState::OK
 || aSignatureState == SignatureState::NOTVALIDATED
@@ -855,7 +855,7 @@ bool 
ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
 bTryToPreserveScriptSignature = true;
 // We need to first save the file (which removes the macro signature), 
then add the macro signature again.
 // For that, we need a temporary copy of the original file.
-osl::File::RC rc = osl::File::copy(getDocFileLocation(), 
m_sTmpFileUrl);
+osl::File::RC rc = osl::File::copy(getDocFileLocation(), sTmpFileUrl);
 if (rc != osl::FileBase::E_None)
 throw uno::RuntimeException("Could not create temp file");
 }
@@ -887,9 +887,9 @@ bool 
ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference<
 {
 Reference xReadOrig
 = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
-ZIP_STORAGE_FORMAT_STRING, m_sTmpFileUrl, 
ElementModes::READ);
+ZIP_STORAGE_FORMAT_STRING, sTmpFileUrl, 
ElementModes::READ);
 if (!xReadOrig.is())
-throw uno::RuntimeException("Could not read " + 
m_sTmpFileUrl);
+throw uno::RuntimeException("Could not read " + 
sTmpFileUrl);
 uno::Reference xMetaInf
 = xReadOrig->openStorageElement("META-INF", 
embed::ElementModes::READ);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >