[Libreoffice-commits] core.git: include/svtools svtools/source svx/source
include/svtools/ctrlbox.hxx|2 ++ svtools/source/control/ctrlbox.cxx | 31 ++- svx/source/tbxctrls/tbcontrl.cxx |2 +- 3 files changed, 17 insertions(+), 18 deletions(-) New commits: commit 23548f4ff51e28fec6751604a0a28197d6680773 Author: Michael Weghorn AuthorDate: Wed Mar 3 15:28:15 2021 +0100 Commit: Michael Weghorn CommitDate: Thu Mar 4 08:15:29 2021 +0100 Related tdf#140762 Add texts for "Border style" toolbar item Make 'GetLineStyleName' a static method of 'SvtLineListBox' and use it to retrieve and set the names for the items used in the "Border Style" dropdown button in Calc's formatting toolbar. This ensures that the corresponding names are available as tooltips and for screen readers. Change-Id: I6b775e1bcd62deefd8a8a6a778dcee426bf3a1f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111905 Tested-by: Michael Weghorn Reviewed-by: Michael Weghorn diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 43347a14ce40..0aff598ff705 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -207,6 +207,8 @@ public: SvtLineListBox(std::unique_ptr pControl); ~SvtLineListBox(); +static OUString GetLineStyleName(SvxBorderLineStyle eStyle); + /** Set the width in Twips */ void SetWidth(tools::Long nWidth) { diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2f7c3eb4dfdd..393c7439e2cb 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1403,23 +1403,6 @@ void SvtLineListBox::ImpGetLine( tools::Long nLine1, tools::Long nLine2, tools:: rBmp = aVirDev->GetBitmapEx( Point(), Size( aSize.Width(), n1+nDist+n2 ) ); } -namespace -{ -OUString GetLineStyleName(SvxBorderLineStyle eStyle) -{ -OUString sRet; -for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(RID_SVXSTR_BORDERLINE); ++i) -{ -if (eStyle == RID_SVXSTR_BORDERLINE[i].second) -{ -sRet = SvtResId(RID_SVXSTR_BORDERLINE[i].first); -break; -} -} -return sRet; -} -} - SvtLineListBox::SvtLineListBox(std::unique_ptr pControl) : m_xControl(std::move(pControl)) , m_xBuilder(Application::CreateBuilder(m_xControl.get(), "svt/ui/linewindow.ui")) @@ -1486,6 +1469,20 @@ SvtLineListBox::~SvtLineListBox() { } +OUString SvtLineListBox::GetLineStyleName(SvxBorderLineStyle eStyle) +{ +OUString sRet; +for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(RID_SVXSTR_BORDERLINE); ++i) +{ +if (eStyle == RID_SVXSTR_BORDERLINE[i].second) +{ +sRet = SvtResId(RID_SVXSTR_BORDERLINE[i].first); +break; +} +} +return sRet; +} + sal_Int32 SvtLineListBox::GetStylePos( sal_Int32 nListPos ) { sal_Int32 nPos = -1; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index e9cb9b1a0d31..ab4a7d124e63 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -738,7 +738,7 @@ private: GetColorLine2( GetItemCount( ) ), GetColorDist( GetItemCount( ) ), pData->GetStyle(), aBmp ); -InsertItem(nId, Image(aBmp)); +InsertItem(nId, Image(aBmp), SvtLineListBox::GetLineStyleName(pData->GetStyle())); Size aBmpSize = aBmp.GetSizePixel(); if (aBmpSize.Width() > aSize.Width()) aSize.setWidth(aBmpSize.getWidth()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx svx/source
include/svx/strings.hrc |5 + svx/source/tbxctrls/tbcontrl.cxx | 35 ++- 2 files changed, 23 insertions(+), 17 deletions(-) New commits: commit 6065e4f400390702080c7de3bcc3de670453a347 Author: Michael Weghorn AuthorDate: Wed Mar 3 11:03:48 2021 +0100 Commit: Michael Weghorn CommitDate: Thu Mar 4 08:15:11 2021 +0100 tdf#140762 Set texts for items in "Borders" dropdown button Associate textual descriptions with the images for the items in the "Borders" dropdown button in Calc's formatting toolbar. This e.g. makes them show up as tooltips when hovering over the images with the mouse and makes them accessible to screen readers (e.g. Orca with the gtk3 VCL plugin now says those texts instead of just saying "item 1", "item 2",...). This also adds the strings for the items where no corresponding ones exist yet. Change-Id: I02ce8abfa4aa59e06ca1ab45aff0685a19c323f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111871 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index c8f71976d322..1b59e4d765e8 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1765,12 +1765,17 @@ #define RID_SVXSTR_TABLE_PRESET_ONLYOUTER NC_("RID_SVXSTR_TABLE_PRESET_ONLYOUTER", "Set Outer Border Only") #define RID_SVXSTR_TABLE_PRESET_OUTERHORI NC_("RID_SVXSTR_TABLE_PRESET_OUTERHORI", "Set Outer Border and Horizontal Lines") #define RID_SVXSTR_TABLE_PRESET_OUTERALL NC_("RID_SVXSTR_TABLE_PRESET_OUTERALL", "Set Outer Border and All Inner Lines") +#define RID_SVXSTR_TABLE_PRESET_OUTERVERI NC_("RID_SVXSTR_TABLE_PRESET_OUTERVERI", "Set Outer Border and Vertical Lines") #define RID_SVXSTR_TABLE_PRESET_OUTERINNER NC_("RID_SVXSTR_TABLE_PRESET_OUTERINNER", "Set Outer Border Without Changing Inner Lines") #define RID_SVXSTR_PARA_PRESET_DIAGONAL NC_("RID_SVXSTR_PARA_PRESET_DIAGONAL", "Set Diagonal Lines Only") #define RID_SVXSTR_PARA_PRESET_ALL NC_("RID_SVXSTR_PARA_PRESET_ALL", "Set All Four Borders") #define RID_SVXSTR_PARA_PRESET_LEFTRIGHT NC_("RID_SVXSTR_PARA_PRESET_LEFTRIGHT", "Set Left and Right Borders Only") #define RID_SVXSTR_PARA_PRESET_TOPBOTTOM NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOM", "Set Top and Bottom Borders Only") +#define RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI", "Set Top and Bottom Borders, and All Horizontal Lines") #define RID_SVXSTR_PARA_PRESET_ONLYLEFT NC_("RID_SVXSTR_PARA_PRESET_ONLYLEFT", "Set Left Border Only") +#define RID_SVXSTR_PARA_PRESET_ONLYRIGHT NC_("RID_SVXSTR_PARA_PRESET_ONLYRIGHT", "Set Right Border Only") +#define RID_SVXSTR_PARA_PRESET_ONLYTOP NC_("RID_SVXSTR_PARA_PRESET_ONLYTOP", "Set Top Border Only") +#define RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM NC_("RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM", "Set Bottom Border Only") #define RID_SVXSTR_HOR_PRESET_ONLYHOR NC_("RID_SVXSTR_HOR_PRESET_ONLYHOR", "Set Top and Bottom Borders, and All Inner Lines") #define RID_SVXSTR_VER_PRESET_ONLYVER NC_("RID_SVXSTR_VER_PRESET_ONLYVER", "Set Left and Right Borders, and All Inner Lines") diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index c2765155c3b8..e9cb9b1a0d31 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -453,7 +453,7 @@ private: rtl::Reference mxControl; std::unique_ptr mxFrameSet; std::unique_ptr mxFrameSetWin; -std::vector aImgVec; +std::vector> aImgVec; boolbParagraphMode; void InitImageList(); @@ -2180,12 +2180,12 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl, weld: sal_uInt16 i = 0; for ( i=1; i<9; i++ ) -mxFrameSet->InsertItem(i, Image(aImgVec[i-1])); +mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second); //bParagraphMode should have been set in StateChanged if ( !bParagraphMode ) for ( i = 9; i < 13; i++ ) -mxFrameSet->InsertItem(i, Image(aImgVec[i-1])); +mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second); mxFrameSet->SetColCount( 4 ); mxFrameSet->SetSelectHdl( LINK( this, SvxFrameWindow_Impl, SelectHdl ) ); @@ -2354,7 +2354,7 @@ void SvxFrameWindow_Impl::statusChanged( const css::frame::FeatureStateEvent& rE else if ( !bTableMode && !bParagraphMode ) { for ( sal_uInt16 i = 9; i < 13; i++ ) -mxFrameSet->InsertItem(i, Image(aImgVec[i-1])); +mxFrameSet->InsertItem(i, Image(aImgVec[i-1].first), aImgVec[i-1].second); bResize = true; } @@ -2376,19 +2376,20 @@ void SvxFrameWindow_Impl::CalcSizeValueSet() vo
[Libreoffice-commits] core.git: cui/inc cui/source include/svx
cui/inc/strings.hrc| 12 cui/source/tabpages/border.cxx |1 + include/svx/strings.hrc| 15 +++ 3 files changed, 16 insertions(+), 12 deletions(-) New commits: commit 0cbd8a5d4571cdf3601ca8deb64d734d35e234f9 Author: Michael Weghorn AuthorDate: Wed Mar 3 11:03:42 2021 +0100 Commit: Michael Weghorn CommitDate: Thu Mar 4 08:14:54 2021 +0100 tdf#140762 Move RIDs related to borders to include/svx They'll be reused for the items in the "Borders" dropdown button in Calc's formatting toolbar in a subsequent step. Change-Id: I895d787d185a69f7aa7d3db3c490271184152ddb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111870 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 257fa4ae554f..9ec01b758738 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -349,18 +349,6 @@ #define RID_SVXSTR_STARTQUOTE NC_("RID_SVXSTR_STARTQUOTE", "Start Quote") #define RID_SVXSTR_ENDQUOTE NC_("RID_SVXSTR_ENDQUOTE", "End Quote") -#define RID_SVXSTR_TABLE_PRESET_NONE NC_("RID_SVXSTR_TABLE_PRESET_NONE", "Set No Borders") -#define RID_SVXSTR_TABLE_PRESET_ONLYOUTER NC_("RID_SVXSTR_TABLE_PRESET_ONLYOUTER", "Set Outer Border Only") -#define RID_SVXSTR_TABLE_PRESET_OUTERHORI NC_("RID_SVXSTR_TABLE_PRESET_OUTERHORI", "Set Outer Border and Horizontal Lines") -#define RID_SVXSTR_TABLE_PRESET_OUTERALL NC_("RID_SVXSTR_TABLE_PRESET_OUTERALL", "Set Outer Border and All Inner Lines") -#define RID_SVXSTR_TABLE_PRESET_OUTERINNER NC_("RID_SVXSTR_TABLE_PRESET_OUTERINNER", "Set Outer Border Without Changing Inner Lines") -#define RID_SVXSTR_PARA_PRESET_DIAGONAL NC_("RID_SVXSTR_PARA_PRESET_DIAGONAL", "Set Diagonal Lines Only") -#define RID_SVXSTR_PARA_PRESET_ALL NC_("RID_SVXSTR_PARA_PRESET_ALL", "Set All Four Borders") -#define RID_SVXSTR_PARA_PRESET_LEFTRIGHT NC_("RID_SVXSTR_PARA_PRESET_LEFTRIGHT", "Set Left and Right Borders Only") -#define RID_SVXSTR_PARA_PRESET_TOPBOTTOM NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOM", "Set Top and Bottom Borders Only") -#define RID_SVXSTR_PARA_PRESET_ONLYLEFT NC_("RID_SVXSTR_PARA_PRESET_ONLYLEFT", "Set Left Border Only") -#define RID_SVXSTR_HOR_PRESET_ONLYHOR NC_("RID_SVXSTR_HOR_PRESET_ONLYHOR", "Set Top and Bottom Borders, and All Inner Lines") -#define RID_SVXSTR_VER_PRESET_ONLYVER NC_("RID_SVXSTR_VER_PRESET_ONLYVER", "Set Left and Right Borders, and All Inner Lines") #define RID_SVXSTR_SHADOW_STYLE_NONE NC_("RID_SVXSTR_SHADOW_STYLE_NONE", "No Shadow") #define RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT NC_("RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT", "Cast Shadow to Bottom Right") #define RID_SVXSTR_SHADOW_STYLE_TOPRIGHT NC_("RID_SVXSTR_SHADOW_STYLE_TOPRIGHT", "Cast Shadow to Top Right") diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index b6e3d8d39ed5..cb7429928d44 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index b2c3822757dd..c8f71976d322 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1759,6 +1759,21 @@ #define RID_SVXSTR_TRANSPARENCY NC_("RID_SVXSTR_TRANSPARENCY", "Transparency:") + +// strings related to borders +#define RID_SVXSTR_TABLE_PRESET_NONE NC_("RID_SVXSTR_TABLE_PRESET_NONE", "Set No Borders") +#define RID_SVXSTR_TABLE_PRESET_ONLYOUTER NC_("RID_SVXSTR_TABLE_PRESET_ONLYOUTER", "Set Outer Border Only") +#define RID_SVXSTR_TABLE_PRESET_OUTERHORI NC_("RID_SVXSTR_TABLE_PRESET_OUTERHORI", "Set Outer Border and Horizontal Lines") +#define RID_SVXSTR_TABLE_PRESET_OUTERALL NC_("RID_SVXSTR_TABLE_PRESET_OUTERALL", "Set Outer Border and All Inner Lines") +#define RID_SVXSTR_TABLE_PRESET_OUTERINNER NC_("RID_SVXSTR_TABLE_PRESET_OUTERINNER", "Set Outer Border Without Changing Inner Lines") +#define RID_SVXSTR_PARA_PRESET_DIAGONAL NC_("RID_SVXSTR_PARA_PRESET_DIAGONAL", "Set Diagonal Lines Only") +#define RID_SVXSTR_PARA_PRESET_ALL NC_("RID_SVXSTR_PARA_PRESET_ALL", "Set All Four Borders") +#define RID_SVXSTR_PARA_PRESET_LEFTRIGHT NC_("RID_SVXSTR_PARA_PRESET_LEFTRIGHT", "Set Left and Right Borders Only") +#define RID_SVXSTR_PARA_PRESET_TOPBOTTOM NC_("RID_SVXSTR_PARA_PRESET_TOPBOTTOM", "Set Top and Bottom Borders Only") +#define RID_SVXSTR_PARA_PRESET_ONLYLEFT NC_("RID_SVXSTR_PARA_PRESET_ONLYLEFT", "Set Left Border Only") +#define RID_SVXSTR_HOR_PRESET_ONLYHOR NC_("RID_SVXSTR_HOR_PRESET_ONLYHOR", "Set Top and Bottom Bord
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - include/xmloff xmloff/source
include/xmloff/xmlictxt.hxx |4 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |3 +-- xmloff/source/core/xmlimp.cxx | 11 ++- 3 files changed, 15 insertions(+), 3 deletions(-) New commits: commit fed3ed5828eda88f82d97e95b34dfdd1ca0c9dec Author: Noel AuthorDate: Fri Feb 12 13:02:25 2021 +0200 Commit: Noel Grandin CommitDate: Thu Mar 4 07:46:05 2021 +0100 restore namespace unwinding in SvXMLImport accidentally lost during the fastparser conversion Change-Id: I7d53e9f32dd8cff650b9ffb6dae493419ce8461f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110813 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit e5f436bc53e0d07654901ef7cc8ff56d04f0686e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111897 diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 82f4c11632f1..3e6f25329d98 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -53,6 +53,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public css::xml::sax::XFastContextHa oslInterlockedCountm_nRefCount; sal_uInt16 mnPrefix; bool mbPrefixAndLocalNameFilledIn; +std::unique_ptr m_pRewindMap; + +SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } +SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { m_pRewindMap = std::move(p); } protected: diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index a8cc84392627..5f6073d171bc 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -82,8 +82,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLEmbeddedObjectImpor sal_Int32 , const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { -// we carry no state, so just re-use the same instance -return this; +return new XMLEmbeddedObjectImportContext_Impl(GetImport(), mxFastHandler); } void XMLEmbeddedObjectImportContext_Impl::startFastElement( diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index c47ad94ceffa..4a8241e4ea69 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -765,7 +765,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, maNamespaceAttrList->Clear(); maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList ); -processNSAttributes( maNamespaceAttrList.get() ); +std::unique_ptr pRewindMap = processNSAttributes( maNamespaceAttrList.get() ); SvXMLImportContextRef xContext; const bool bRootContext = maContexts.empty(); @@ -828,6 +828,10 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element, if ( !xContext ) xContext.set( new SvXMLImportContext( *this ) ); +// Remember old namespace map. +if( pRewindMap ) +xContext->PutRewindMap(std::move(pRewindMap)); + // Call a startElement at the new context. xContext->startFastElement( Element, Attribs ); @@ -917,8 +921,13 @@ void SAL_CALL SvXMLImport::endFastElement (sal_Int32 Element) return; } SvXMLImportContextRef xContext = std::move(maContexts.top()); +// Get a namespace map to rewind. +std::unique_ptr pRewindMap = xContext->TakeRewindMap(); maContexts.pop(); xContext->endFastElement( Element ); +// Rewind a namespace map. +if (pRewindMap) +mpNamespaceMap = std::move(pRewindMap); } void SAL_CALL SvXMLImport::endUnknownElement (const OUString & rPrefix, const OUString & rLocalName) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Minutes from the UX/design meeting 2020-Mar-03
Present: Sascha, Heiko Comments: Andreas Tickets/Topic * FILEOPEN: easier access to scale drawings + https://bugs.documentfoundation.org/show_bug.cgi?id=66470 + add a Scale section to the statusbar showing the actual value and allow to change per context menu + saving at the document could be handy (Sascha) => feedback/access per statusbar * UI: [Enhancement] Option to keep cursor vertically centered in viewport + https://bugs.documentfoundation.org/show_bug.cgi?id=66975 + ideally add a command for customization and perhaps assign it to scroll lock; should be shown in the statusbar + maybe good for an extension; definitely low priority (Sascha) + what happens at document end? activate the direct cursor mode? what on jump via Navigator what if the position is occupied by an object? => recommend to resolve WF but if someone volunteers... * Page naming "right" and "left" is wrong for right-to-to left documents should be "odd" and "even" + https://bugs.documentfoundation.org/show_bug.cgi?id=140655 + see also bug 94847 + left/right has no meaning and even/odd would have been better + but changing left/right to even/odd has a many consequences, eg. header/footer "same content on..." + hinting for l10n might be a solution in some cases but irritate people who switch between languages => agreement to the change * UI: Footnote area in Tools _> Footnotes and endnotes not self-explaining + https://bugs.documentfoundation.org/show_bug.cgi?id=140347 + anything unclear in respect to comment 2? + labels are not self-explanatory (Sascha) + change "Text area" and "Footnote area" to "Text marker" and "Footnote marker" => do it easyhackable * Add 4 more default bullet types to toolbar split button and dialog + https://bugs.documentfoundation.org/show_bug.cgi?id=106507 + what bullets/numbering schemes exactly should we use? + see also bug 120905 (revamp the dialog) and attachment to bug 140612 + provide better bullets (Andreas) + more items don't solve the issue of bad presets and configurability (neither when improving the presets) + preferably we have a kind of favorite function and users can pick the best eight out of unlimited and self-made list styles (Heiko) + small-screen users want small widgets (Sascha) => no objection when the bullets are improved but better revamp the dialog than adding more items * func keyword entry on Elements pane should insert a function name suggesting user to modify it + https://bugs.documentfoundation.org/show_bug.cgi?id=140726 + func () is hard to understand + func () is not localizable + but since this function is likely used by experts and the terminology is well-known this solution hurts less => go for it OpenPGP_signature Description: OpenPGP digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
testXAdES failing since 2021-03-03
Hi! Since yesterday, I see testXAdES failing locally: $ make CppunitTest_xmlsecurity_signing CPPUNIT_TEST_NAME=testXAdES C:/cygwin64/opt/lo/bin/make -j 14 -rs -f C:/lo/src/core/Makefile.gbuild CppunitTest_xmlsecurity_signing [build PRL] CustomTarget/postprocess/images/sorted.lst [build PRL] CustomTarget/postprocess/images/commandimagelist.ilst [build PRL] CustomTarget/postprocess/images/images_colibre.zip [build PKG] postprocess_images [build CUT] xmlsecurity_signing [_RUN_] testXAdES::TestBody warn:sfx.appl:8804:9072:sfx2/source/appl/app.cxx:150: No DDE-Service possible. Error: 16399 warn:vcl:8804:9072:vcl/win/window/salframe.cxx:1086: WinSalFrame::SetIcon(): Could not load large icon ! warn:vcl:8804:9072:vcl/win/window/salframe.cxx:1087: WinSalFrame::SetIcon(): Could not load small icon ! warn:basic:8804:9072:basic/source/uno/namecont.cxx:967: Cannot access extensions! warn:basic:8804:9072:basic/source/uno/namecont.cxx:967: Cannot access extensions! warn:xmlsecurity.comp:8804:9072:xmlsecurity/source/helper/xmlsignaturehelper.cxx:655: X509Data do not form a chain: certificate in cycle: CN=E9F172FF-9203-4DB8-A589-184C7A58C071 Assertion failed: signatureInfo.GetSigningCertificate(), file C:/lo/src/core/xmlsecurity/source/helper/xsecctl.cxx, line 761 abort() has been calledwarn:legacy.osl:8804:9072:sw/source/core/layout/newfrm.cxx:313: Who didn't deregister? warn:legacy.osl:8804:9072:sw/source/core/layout/newfrm.cxx:313: Who didn't deregister? warn:legacy.osl:8804:9072:sw/source/core/layout/newfrm.cxx:313: Who didn't deregister? warn:svl.items:8804:9072:svl/source/items/style.cxx:50: SfxStyleSheetBase left 1; SfxStyleSheetBasePool left 1 warn:unotools.config:8804:9072:unotools/source/config/configmgr.cxx:140: ConfigManager not empty Error: a unit test failed, please do one of: make CppunitTest_xmlsecurity_signing CPPUNITTRACE=TRUE # which is a shortcut for the following line make CppunitTest_xmlsecurity_signing CPPUNITTRACE="'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.exe' /debugexe" # for interactive debugging in Visual Studio make CppunitTest_xmlsecurity_signing CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH) You can limit the execution to just one particular test by: make CppunitTest_xmlsecurity_signing CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params... make[1]: *** [C:/lo/src/core/solenv/gbuild/CppunitTest.mk:125: C:/lo/src/build/workdir/CppunitTest/xmlsecurity_signing.test] Error 1 make: *** [Makefile:166: CppunitTest_xmlsecurity_signing] Error 2 It is 100% reproducible. -- Best regards, Mike Kaganski ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdview.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit c10955a4617c3ce3c329083109ac7c7be514da8f Author: mert AuthorDate: Mon Mar 1 06:00:11 2021 +0300 Commit: Mert Tumer CommitDate: Thu Mar 4 04:35:55 2021 +0100 Fix crash while moving handle when shape text is active Change-Id: Ie21398917bc204245837215f1eade78e11c61890 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111726 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111740 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 6e26091a8e43..f2d36bbf5f4e 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1409,6 +1409,9 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark) bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint) { +if (GetHdlList().IsMoveOutside()) +return false; + if (!GetMarkedObjectList().GetMarkCount()) return false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source vcl/source
desktop/source/lib/init.cxx|1 + vcl/source/control/notebookbar.cxx |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit 94958cc478d9f97b33bc0da654b7bd19c3c99eea Author: mert AuthorDate: Thu Feb 25 11:41:24 2021 +0300 Commit: Mert Tumer CommitDate: Thu Mar 4 04:35:30 2021 +0100 Init Notebookbar for Online Draw Signed-off-by: mert Change-Id: I85a25820d3968070dd8a05156b4bb4a1ebe59f99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111517 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2b56bdb2112d..5701f5965ce2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6382,6 +6382,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char activateNotebookbar(u"Writer"); activateNotebookbar(u"Calc"); activateNotebookbar(u"Impress"); +activateNotebookbar(u"Draw"); } return bInitialized; diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 8506ce965273..f7b58dfc3416 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -75,7 +75,8 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU bool bIsWelded = comphelper::LibreOfficeKit::isActive() && (rUIXMLDescription == "modules/swriter/ui/notebookbar.ui" || rUIXMLDescription == "modules/scalc/ui/notebookbar.ui" -|| rUIXMLDescription == "modules/simpress/ui/notebookbar.ui"); +|| rUIXMLDescription == "modules/simpress/ui/notebookbar.ui" +|| rUIXMLDescription == "modules/sdraw/ui/notebookbar.ui"); if (bIsWelded) { m_bIsWelded = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2b9f0509d27343bb524ca2eac1f554747b9c05b8 Author: Adolfo Jayme Barrientos AuthorDate: Wed Mar 3 21:32:05 2021 -0600 Commit: Gerrit Code Review CommitDate: Thu Mar 4 04:32:05 2021 +0100 Update git submodules * Update helpcontent2 from branch 'master' to bfc47545287facda8260143acf5ff84ea7e79aa1 - Remove more improper ellipses and fix a couple of capitalizations Change-Id: I3cea0b968dd38d93381268c6b0ede5c90dc8a5a9 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111945 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/helpcontent2 b/helpcontent2 index c34bb965f993..bfc47545287f 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit c34bb965f993bef53fa739de6f3aaa97de2c2ef9 +Subproject commit bfc47545287facda8260143acf5ff84ea7e79aa1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/sbasic/python/python_dialogs.xhp |4 ++-- source/text/sbasic/shared/03/lib_euro.xhp |2 +- source/text/sbasic/shared/03/lib_gimmicks.xhp |2 +- source/text/sbasic/shared/03/lib_importwiz.xhp |2 +- source/text/sbasic/shared/03/sf_l10n.xhp |4 ++-- source/text/scalc/00/0407.xhp |2 +- source/text/swriter/01/05030800.xhp|4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) New commits: commit bfc47545287facda8260143acf5ff84ea7e79aa1 Author: Adolfo Jayme Barrientos AuthorDate: Wed Mar 3 21:20:37 2021 -0600 Commit: Adolfo Jayme Barrientos CommitDate: Thu Mar 4 04:32:05 2021 +0100 Remove more improper ellipses and fix a couple of capitalizations Change-Id: I3cea0b968dd38d93381268c6b0ede5c90dc8a5a9 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111945 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/source/text/sbasic/python/python_dialogs.xhp b/source/text/sbasic/python/python_dialogs.xhp index 7f728b495..844e206ad 100644 --- a/source/text/sbasic/python/python_dialogs.xhp +++ b/source/text/sbasic/python/python_dialogs.xhp @@ -25,7 +25,7 @@ %PRODUCTNAME static dialogs are created with the Dialog editor and are stored in varying places according to their personal (My Macros), shared (%PRODUCTNAME Macros) or document-embedded nature. In reverse, dynamic dialogs are constructed at runtime, from Basic or Python scripts, or using any other %PRODUCTNAME supported language for that matter. Opening static dialogs with Python is illustrated herewith. Exception handling and internationalization are omitted for clarity. My Macros or %PRODUCTNAME Macros dialogs -The examples below open Access2Base Trace console or the imported TutorialsDialog dialog with Tools – Macros – Run Macro... menu: +The examples below open Access2Base Trace console or the imported TutorialsDialog dialog with Tools - Macros - Run Macro menu: # -*- coding: utf-8 -*- from __future__ import unicode_literals @@ -49,7 +49,7 @@ g_exportedScripts = (consoleDlg, tutorDialog) Document embedded dialogs -The example below opens a newly edited Dialog1 dialog from a document with Tools – Macros – Run Macro... menu: +The example below opens a newly edited Dialog1 dialog from a document with Tools - Macros - Run Macro menu: # -*- coding: utf-8 -*- from __future__ import unicode_literals diff --git a/source/text/sbasic/shared/03/lib_euro.xhp b/source/text/sbasic/shared/03/lib_euro.xhp index 95ec26207..d975c69d4 100644 --- a/source/text/sbasic/shared/03/lib_euro.xhp +++ b/source/text/sbasic/shared/03/lib_euro.xhp @@ -31,7 +31,7 @@ Euro.AutoPilotRun.StartAutoPilot Euro.ConvertRun.Main -Selecting the Euro Converter… wizard loads the following libraries in memory: +Selecting the Euro Converter wizard loads the following libraries in memory: Euro ImportWizard diff --git a/source/text/sbasic/shared/03/lib_gimmicks.xhp b/source/text/sbasic/shared/03/lib_gimmicks.xhp index 4473e3567..01c7d0171 100644 --- a/source/text/sbasic/shared/03/lib_gimmicks.xhp +++ b/source/text/sbasic/shared/03/lib_gimmicks.xhp @@ -30,7 +30,7 @@ GlobalScope.BasicLibraries.LoadLibrary("Gimmicks") Description -The Gimmicks library is used by the AutoText... wizard. +The Gimmicks library is used by the AutoText wizard. Its entry points are: Gimmicks.AutoText.Main diff --git a/source/text/sbasic/shared/03/lib_importwiz.xhp b/source/text/sbasic/shared/03/lib_importwiz.xhp index 663bd49d1..cd327b470 100644 --- a/source/text/sbasic/shared/03/lib_importwiz.xhp +++ b/source/text/sbasic/shared/03/lib_importwiz.xhp @@ -25,7 +25,7 @@ Description -The ImportWizard library is used by the Document converter... wizard. +The ImportWizard library is used by the Document Converter wizard. Its entry point is: ImportWizard.Main.Main diff --git a/source/text/sbasic/shared/03/sf_l10n.xhp b/source/text/sbasic/shared/03/sf_l10n.xhp index 9dc27284f..fd84b0f71 100644 --- a/source/text/sbasic/shared/03/sf_l10n.xhp +++ b/source/text/sbasic/shared/03/sf_l10n.xhp @@ -36,10 +36,10 @@ -The L10N service is based on the GNU implementation of PO (portable object) files. To learn more about this file format, visit https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html"; name="GetText">GNU GetText Utilities: PO Files. +The L10N service is based on the GNU implementation of PO (portable object) files. To learn more about this file format, visit https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html"; name="GetText">GNU gettext Utilities: PO Files. PO files have long been promoted in the free software community as a means to providing multilingual user inte
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/wordcountctrl.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit 75175049972239cfceab15c7b756fe0a2c4059be Author: Jim Raykowski AuthorDate: Sun Feb 28 20:42:53 2021 -0900 Commit: Jim Raykowski CommitDate: Thu Mar 4 01:21:01 2021 +0100 tdf#116136 don't show status bar word count control tool tip in print preview Change-Id: Iad07d1d4951cba284c67d711ebd83507ca265864 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111728 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx index 93eba3c736df..d617c611c500 100644 --- a/sw/source/uibase/utlui/wordcountctrl.cxx +++ b/sw/source/uibase/utlui/wordcountctrl.cxx @@ -31,9 +31,15 @@ void SwWordCountStatusBarControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if (eState == SfxItemState::DEFAULT) // Can access pState +{ GetStatusBar().SetItemText( GetId(), static_cast(pState)->GetValue() ); - -GetStatusBar().SetQuickHelpText(GetId(), SwResId(STR_WORDCOUNT_HINT)); +GetStatusBar().SetQuickHelpText(GetId(), SwResId(STR_WORDCOUNT_HINT)); +} +else +{ +GetStatusBar().SetItemText(GetId(), u""); +GetStatusBar().SetQuickHelpText(GetId(), u""); +} } /* 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: sc/qa
sc/qa/unit/data/ods/tdf42481.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 17 + 2 files changed, 17 insertions(+) New commits: commit 722ec600e85cca2e94e82e69f8d13773061172b9 Author: Xisco Fauli AuthorDate: Wed Mar 3 21:08:21 2021 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 3 23:46:39 2021 +0100 tdf#42481: sc_subsequent_filters: Add unittest Change-Id: Ie8bccee362dc14ce3b5d635151f46564026ccd48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111938 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/data/ods/tdf42481.ods b/sc/qa/unit/data/ods/tdf42481.ods new file mode 100644 index ..ce84fa7b1665 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf42481.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index fa969a78c4d0..fd553fa15260 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -285,6 +285,7 @@ public: void testTdf130583(); void testTdf85617(); void testTdf134234(); +void testTdf42481(); void testNamedExpressionsXLSXML(); void testEmptyRowsXLSXML(); void testBorderDirectionsXLSXML(); @@ -477,6 +478,7 @@ public: CPPUNIT_TEST(testTdf130583); CPPUNIT_TEST(testTdf85617); CPPUNIT_TEST(testTdf134234); +CPPUNIT_TEST(testTdf42481); CPPUNIT_TEST(testNamedExpressionsXLSXML); CPPUNIT_TEST(testEmptyRowsXLSXML); CPPUNIT_TEST(testBorderDirectionsXLSXML); @@ -4635,6 +4637,21 @@ void ScFiltersTest::testTdf134234() CPPUNIT_ASSERT_EQUAL(sal_uInt32(833), static_cast(rDoc.GetValue(ScAddress(3,0,1; } +void ScFiltersTest::testTdf42481() +{ +ScDocShellRef xDocSh = loadDoc(u"tdf42481.", FORMAT_ODS); +CPPUNIT_ASSERT_MESSAGE("Failed to load the document", xDocSh.is()); +ScDocument& rDoc = xDocSh->GetDocument(); + +CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), rDoc.GetString(ScAddress(3,9,0))); + +// Without the fix in place, this test would have failed with +// - Expected: #VALUE! +// - Actual : 14 +CPPUNIT_ASSERT_EQUAL(OUString("#VALUE!"), rDoc.GetString(ScAddress(3,10,0))); +CPPUNIT_ASSERT_EQUAL(OUString("14"), rDoc.GetString(ScAddress(3,11,0))); +} + void ScFiltersTest::testNamedExpressionsXLSXML() { { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/inc cppuhelper/inc dbaccess/inc desktop/inc drawinglayer/inc reportdesign/inc sd/inc starmath/inc svl/inc svx/inc sw/inc xmlsecurity/inc
connectivity/inc/pch/precompiled_ado.hxx |2 +- cppuhelper/inc/pch/precompiled_cppuhelper.hxx |3 ++- dbaccess/inc/pch/precompiled_dba.hxx |3 ++- desktop/inc/pch/precompiled_deploymentmisc.hxx|3 +-- drawinglayer/inc/pch/precompiled_drawinglayer.hxx |3 +-- reportdesign/inc/pch/precompiled_rptui.hxx|6 +- sd/inc/pch/precompiled_sd.hxx |3 +-- starmath/inc/pch/precompiled_sm.hxx |4 +--- svl/inc/pch/precompiled_svl.hxx |4 +--- svx/inc/pch/precompiled_svxcore.hxx |4 +++- sw/inc/pch/precompiled_msword.hxx |4 +++- sw/inc/pch/precompiled_swui.hxx |3 ++- xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx |2 +- 13 files changed, 20 insertions(+), 24 deletions(-) New commits: commit 1e092b6bde40d5e69c1ef92fca201896ff75bf18 Author: Caolán McNamara AuthorDate: Tue Mar 2 11:17:56 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 20:47:52 2021 +0100 update pches Change-Id: Ide49c48738ecd537d4eb69390d22807561d3b4e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111828 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/connectivity/inc/pch/precompiled_ado.hxx b/connectivity/inc/pch/precompiled_ado.hxx index 09d093666578..ef81fdf7c9f7 100644 --- a/connectivity/inc/pch/precompiled_ado.hxx +++ b/connectivity/inc/pch/precompiled_ado.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-02-22 20:24:22 using: + Generated on 2021-03-02 11:16:15 using: ./bin/update_pch connectivity ado --cutoff=2 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: diff --git a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx index 309943e43037..74cce7214943 100644 --- a/cppuhelper/inc/pch/precompiled_cppuhelper.hxx +++ b/cppuhelper/inc/pch/precompiled_cppuhelper.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-02-19 15:34:37 using: + Generated on 2021-03-02 11:16:17 using: ./bin/update_pch cppuhelper cppuhelper --cutoff=3 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx index 637920d0d028..b35765ded705 100644 --- a/dbaccess/inc/pch/precompiled_dba.hxx +++ b/dbaccess/inc/pch/precompiled_dba.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-02-22 20:24:27 using: + Generated on 2021-03-02 11:16:19 using: ./bin/update_pch dbaccess dba --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include diff --git a/desktop/inc/pch/precompiled_deploymentmisc.hxx b/desktop/inc/pch/precompiled_deploymentmisc.hxx index 4cefa0cc6f22..353d457753b7 100644 --- a/desktop/inc/pch/precompiled_deploymentmisc.hxx +++ b/desktop/inc/pch/precompiled_deploymentmisc.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-02-19 15:34:41 using: + Generated on 2021-03-02 11:16:20 using: ./bin/update_pch desktop deploymentmisc --cutoff=3 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -34,7 +34,6 @@ #if PCH_LEVEL >= 2 #include #include -#include #include #include #include diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx index 50f16c182456..acf013126176 100644 --- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx +++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-02-22 20:24:29 using: + Generated on 2021-03-02 11:16:21 using: ./bin/update_pch drawinglayer drawinglayer --cutoff=4 --exclude:system --exclude:module --exclude:local If after updating b
Re: Modify Libreoffice UI
Hi Drew, nice to hear from you again. As far as I know some work is ongoing how the Notebookbar handles its data. And there is some bit of hope that with switching to an XML-based solution we get customization. But today it's hard-coded like any dialog. Cheers, Heiko On 03.03.21 17:59, Drew Jensen wrote: Howdy Heiko, Since I've switched almost entirely to use of the tabbed interface I was wondering if there is any time frame for fully updating the tabbed (notebookbar) interface using the customization dialog? I know there is a limited support currently but far short of what is available for the legacy toolbar. Thanks Drew On Wed, Mar 3, 2021 at 11:43 AM Heiko Tietze wrote: Hi Mai, it is possible to modify/add toolbars (or menus) per Tools > Customization. See [1] for the documentation of this feature. And you can also apply it to a specific document by changing the "Scope". Good place to ask specific questions is [2] or the user mailing lists [3]. This one is intended for developers- and from what you ask I guess you don't plan to change the source code. Cheers, Heiko [1] https://help.libreoffice.org/latest/en-US/text/shared/guide/edit_symbolbar.html?DbPAR=SHARED#bm_id3159201 [2] https://ask.libreoffice.org/ [3] https://www.libreoffice.org/get-help/mailing-lists/ On 03.03.21 16:40, Mai Dinh wrote: Hi there, I was looking into LibreOffice open source and potentially modifying the UI to add a new toolbar field on the top of files I open, such as document and spreadsheet. I was hoping for help in the direction to look at the source code. Any help would be appreciated, thank you! Mai ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice -- Dr. Heiko Tietze, UX-Designer and UX-Mentor Tel: +49 30 5557992-63 | Mail: heiko.tie...@documentfoundation.org The Document Foundation, Kurfürstendamm 188, 10707 Berlin, DE Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts Legal details: https://www.documentfoundation.org/imprint ___ 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 -- Dr. Heiko Tietze, UX-Designer and UX-Mentor Tel: +49 30 5557992-63 | Mail: heiko.tie...@documentfoundation.org The Document Foundation, Kurfürstendamm 188, 10707 Berlin, DE Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts Legal details: https://www.documentfoundation.org/imprint OpenPGP_signature Description: OpenPGP digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Extensions Tab in the Tabbed interface
Hi! I am developing an extension for LO Calc and I'd like to add it to the "Extensions" tab in the Tabbed interface. For that, I read the documentation in the following wiki: https://wiki.documentfoundation.org/Development/NotebookBar/Extensions I would like the final result to be as shown in this image of the Wiki page (icon with a label beneath it): https://wiki.documentfoundation.org/File:Extensions_in_NotebookBar.png However, no matter what I do in the Addons.xcu file, the final result is always a small icon without any label. Hence I'd like to know if it is possible to achieve the result shown in the image linked above? What I tried so far: 1) I downloaded and studied all the examples in the Google Drive folder linked in the wiki page. 2) I tried installing the examples from the Wiki page and they only result in a single icon being added to the extensions tab (which differ from the image in the Wiki) 3) I tried different settings for the "Style" property, using "icon+text", but nothing changed If it is possible to achieve this, I volunteer to update the Wiki page detailing the process. Thanks! Rafael Lima ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source
desktop/source/lib/init.cxx |6 ++ include/vcl/svapp.hxx|1 + vcl/source/window/dialog.cxx |4 3 files changed, 11 insertions(+) New commits: commit a207551215ca4d7445bf129a3f6863418d75383e Author: Henry Castro AuthorDate: Wed Feb 17 16:47:27 2021 -0400 Commit: Henry Castro CommitDate: Wed Mar 3 19:27:41 2021 +0100 lok: add batch mode option to load the document When the LibreOffice Kit is active by default is set to headless mode, with the flag "DialogCancelMode::Silent", according to the documentation it should close the dialog, but it was changed for dialog tunneling. However the dialog tunneling is being deprecated, and in order to not produce any regression, it will be used temporary a new state "DialogCancelMode::LOKSilent", to disable any dialog interactivity. Change-Id: I3b6cce38c37f75dc1b24dda352f6caec19438ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111087 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky (cherry picked from commit 5f3fbb019bd79bd57eed94e01bd2202efd9a0c06) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111319 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d62ceac29c74..2b56bdb2112d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2239,6 +2239,12 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const OUString aDeviceFormFactor = extractParameter(aOptions, u"DeviceFormFactor"); SfxLokHelper::setDeviceFormFactor(aDeviceFormFactor); +const OUString aBatch = extractParameter(aOptions, u"Batch"); +if (!aBatch.isEmpty()) +{ + Application::SetDialogCancelMode(DialogCancelMode::LOKSilent); +} + uno::Sequence aFilterOptions(3); aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions", 0, diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index bfa92cf88321..b0b5a069af4b 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -212,6 +212,7 @@ private: enum class DialogCancelMode { Off, ///< do not automatically cancel dialogs Silent, ///< silently cancel any dialogs +LOKSilent, ///< silently cancel any dialogs (LOK case) Fatal ///< cancel any dialogs by std::abort }; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 67dc19a7be99..f354e8a32d85 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -950,6 +950,10 @@ bool Dialog::ImplStartExecute() "Dialog \"" << ImplGetDialogText(this) << "\"cancelled in silent mode"); return false; + +case DialogCancelMode::LOKSilent: +return false; + default: // default cannot happen case DialogCancelMode::Fatal: std::abort(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/data/xlsx/dateAutofilter.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 25 sc/source/filter/excel/excrecds.cxx | 31 ++ sc/source/filter/inc/excrecds.hxx |2 - sc/source/filter/oox/autofilterbuffer.cxx |2 + sc/source/ui/unoobj/datauno.cxx |1 6 files changed, 56 insertions(+), 5 deletions(-) New commits: commit 6072bc982782398a9b01a11dbbb6730a2c1fbe17 Author: Balazs Varga AuthorDate: Wed Jan 20 12:11:14 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 19:24:53 2021 +0100 tdf#139809 sc ooxml export autofiltered date columns Export XML_dateGroupItem, XML_year, XML_month, XML_day, XML_dateTimeGrouping based on the OOXML standard. Follow up commit of: d101a6f8579df8241dcd8100908868cd7d7c3f8a (tdf#116818 sc OOXML: import autofiltered date columns) Note: DOCX round-trip is not lossless here, because instead of exporting the original yearly and monthly dataGroupItem filtering, the export contains daily level dataGroupItem elements for each day. Change-Id: I456b2240213839725e2b416622986ee4a9cf60d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109699 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit eea523b686b27b4807ab21b62805ce9fbddf74ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111914 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/data/xlsx/dateAutofilter.xlsx b/sc/qa/unit/data/xlsx/dateAutofilter.xlsx new file mode 100644 index ..1c836511d0dc Binary files /dev/null and b/sc/qa/unit/data/xlsx/dateAutofilter.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 8df43f1e4922..7b4a69846d3f 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -214,6 +214,7 @@ public: void testTdf95640_ods_to_xlsx(); void testTdf95640_ods_to_xlsx_with_standard_list(); void testTdf95640_xlsx_to_xlsx(); +void testDateAutofilterXLSX(); void testRefStringXLSX(); void testRefStringConfigXLSX(); @@ -385,6 +386,7 @@ public: CPPUNIT_TEST(testTdf95640_ods_to_xlsx); CPPUNIT_TEST(testTdf95640_ods_to_xlsx_with_standard_list); CPPUNIT_TEST(testTdf95640_xlsx_to_xlsx); +CPPUNIT_TEST(testDateAutofilterXLSX); CPPUNIT_TEST(testRefStringXLSX); CPPUNIT_TEST(testRefStringConfigXLSX); @@ -4454,6 +4456,29 @@ void ScExportTest::testTdf95640_xlsx_to_xlsx() "Low,Medium,High"); } +void ScExportTest::testDateAutofilterXLSX() +{ +// XLSX Roundtripping autofilter with date list +ScDocShellRef xDocSh = loadDoc(u"dateAutofilter.", FORMAT_XLSX); +CPPUNIT_ASSERT(xDocSh.is()); + +xmlDocUniquePtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/worksheets/sheet1.xml", FORMAT_XLSX); +CPPUNIT_ASSERT(pDoc); + +assertXPath(pDoc, "//x:autoFilter", "ref", "A1:B4"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]", "day", "02"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]", "month", "03"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]", "year", "2017"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[1]", "dateTimeGrouping", "day"); + +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]", "day", "01"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]", "month", "10"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]", "year", "2014"); +assertXPath(pDoc, "//x:autoFilter/x:filterColumn/x:filters/x:dateGroupItem[2]", "dateTimeGrouping", "day"); + +xDocSh->DoClose(); +} + void ScExportTest::testTdf88657ODS() { ScDocShellRef xDocSh = loadDoc("tdf88657.", FORMAT_ODS); diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index ce6b05970e6d..3f87f5874f4b 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -24,6 +24,7 @@ #include #include +#include #include @@ -774,7 +775,7 @@ void XclExpAutofilter::AddMultiValueEntry( const ScQueryEntry& rEntry ) meType = MultiValue; const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems(); for (const auto& rItem : rItems) -maMultiValues.push_back(rItem.maString.getString()); +maMultiValues.push_back( std::make_pair(rItem.maString.getString(), rItem.meType == ScQueryEntry::ByDate) ); } void XclExpAutofilter::WriteBody( XclExpStream& rStrm ) @@ -832,9 +833,31 @@ void XclExpAutofilter::SaveXml( XclExpXmlStream& rStrm ) rWorksheet->startElement(XML_filters); for (const auto& rMultiValue : maMulti
[Libreoffice-commits] core.git: vcl/inc vcl/skia
vcl/inc/skia/salbmp.hxx |4 ++ vcl/skia/salbmp.cxx | 68 +--- 2 files changed, 69 insertions(+), 3 deletions(-) New commits: commit 3c9936a9b77fe18396d048de2f97b9e8eb66a787 Author: Luboš Luňák AuthorDate: Wed Mar 3 11:29:49 2021 +0100 Commit: Luboš Luňák CommitDate: Wed Mar 3 19:06:42 2021 +0100 try to avoid skia alpha blending with fully opaque bitmaps E.g. the document in tdf#140753 has a PNG which technically has an alpha channel, but it's actually completely opaque. Doing this avoids having the pixel data for the separate alpha bitmap, and it also avoids the pointless (somewhat costly in the raster case) alpha blending. Change-Id: I0916962e5894a111002c667a2f98782765aacb1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111893 Tested-by: Luboš Luňák Reviewed-by: Luboš Luňák diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx index 2a1d309a7fec..0509ed3381b6 100644 --- a/vcl/inc/skia/salbmp.hxx +++ b/vcl/inc/skia/salbmp.hxx @@ -123,6 +123,10 @@ private: void EraseInternal(const Color& color); // Sets pixels to the erase color. void PerformErase(); +// Try to find out if the content is completely black. Used for optimizations, +// not guaranteed to always return true for such bitmaps. +bool IsAllBlack() const; +void ReleaseBuffer(BitmapBuffer* pBuffer, BitmapAccessMode nMode, bool dontChangeToErase); SkBitmap GetAsSkBitmap() const; bool ConserveMemory() const; void verify() const diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index c8d8f1a766b2..68d2f9a76964 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -278,6 +278,12 @@ BitmapBuffer* SkiaSalBitmap::AcquireBuffer(BitmapAccessMode nMode) } void SkiaSalBitmap::ReleaseBuffer(BitmapBuffer* pBuffer, BitmapAccessMode nMode) +{ +ReleaseBuffer(pBuffer, nMode, false); +} + +void SkiaSalBitmap::ReleaseBuffer(BitmapBuffer* pBuffer, BitmapAccessMode nMode, + bool dontChangeToErase) { if (nMode == BitmapAccessMode::Write) { @@ -298,6 +304,62 @@ void SkiaSalBitmap::ReleaseBuffer(BitmapBuffer* pBuffer, BitmapAccessMode nMode) assert(pBuffer->mpBits == mBuffer.get() || nMode == BitmapAccessMode::Info); verify(); delete pBuffer; +if (nMode == BitmapAccessMode::Write && !dontChangeToErase) +{ +// This saves memory and is also used by IsFullyOpaqueAsAlpha() to avoid unnecessary +// alpha blending. +if (IsAllBlack()) +{ +SAL_INFO("vcl.skia.trace", "releasebuffer(" << this << "): erasing to black"); +EraseInternal(COL_BLACK); +} +} +} + +static bool isAllZero(const sal_uInt8* data, size_t size) +{ // For performance, check in larger data chunks. +#ifdef UINT64_MAX +const int64_t* d = reinterpret_cast(data); +#else +const int32_t* d = reinterpret_cast(data); +#endif +constexpr size_t step = sizeof(*d) * 8; +for (size_t i = 0; i < size / step; ++i) +{ // Unrolled loop. +if (d[0] != 0) +return false; +if (d[1] != 0) +return false; +if (d[2] != 0) +return false; +if (d[3] != 0) +return false; +if (d[4] != 0) +return false; +if (d[5] != 0) +return false; +if (d[6] != 0) +return false; +if (d[7] != 0) +return false; +d += 8; +} +for (size_t i = size / step * step; i < size; ++i) +if (data[i] != 0) +return false; +return true; +} + +bool SkiaSalBitmap::IsAllBlack() const +{ +if (mBitCount % 8 != 0 || (!!mPalette && mPalette[0] != COL_BLACK)) +return false; // Don't bother. +if (mSize.Width() * mBitCount / 8 == mScanlineSize) +return isAllZero(mBuffer.get(), mScanlineSize * mSize.Height()); +for (tools::Long y = 0; y < mSize.Height(); ++y) +if (!isAllZero(mBuffer.get() + mScanlineSize * y, mSize.Width() * mBitCount / 8)) +return false; +return true; } bool SkiaSalBitmap::GetSystemData(BitmapSystemData&) @@ -899,8 +961,8 @@ sk_sp SkiaSalBitmap::GetAlphaSkShader(const SkSamplingOptions& samplin bool SkiaSalBitmap::IsFullyOpaqueAsAlpha() const { -if (!mEraseColorSet) -return false; // don't bother figuring it out from the pixels +if (!mEraseColorSet) // Set from Erase() or ReleaseBuffer(). +return false; // If the erase color is set so that this bitmap used as alpha would // mean a fully opaque alpha mask (= noop), we can skip using it. // Note that for alpha bitmaps we use the VCL "transparency" convention, @@ -943,7 +1005,7 @@ void SkiaSalBitmap::PerformErase() memcpy(scanline + y * bitmapBuffer->mnScanlineSize, scanline, bitmapBuffer->mnScanlineSize); } -ReleaseBuffer(bitmapBu
[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - svtools/source
svtools/source/uno/wizard/wizardshell.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 21511280f9a376906a57dde082f899aa9f7b37a7 Author: Ilhan Yesil AuthorDate: Tue Nov 10 18:22:39 2020 +0100 Commit: Michael Weghorn CommitDate: Wed Mar 3 18:46:02 2021 +0100 tdf#138116 Accurate minimal height for wizard opened by extension There is no way to set the minimum height by the UNO API. Therefore the requested size will be reduced. Change-Id: Ie657518a83ffb6873e4fd2a5640580b5198a38d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105566 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit 502da85432ed195213268272dda966fddc269716) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111887 Tested-by: Michael Weghorn Reviewed-by: Michael Weghorn diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx index 6d72a1219a50..addae913aa0f 100644 --- a/svtools/source/uno/wizard/wizardshell.cxx +++ b/svtools/source/uno/wizard/wizardshell.cxx @@ -175,7 +175,7 @@ namespace svt { namespace uno : BuilderPage(pParent, pController, "svt/ui/emptypage.ui", "EmptyPage") { m_xContainer->set_size_request(m_xContainer->get_approximate_digit_width() * 70, - m_xContainer->get_text_height() * 45); + m_xContainer->get_text_height() * 10); } weld::Container* GetContainer() const { return m_xContainer.get(); } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf137655.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|8 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 18 +++--- 3 files changed, 23 insertions(+), 3 deletions(-) New commits: commit 694e11ae11aeac7fba8dc1937f8f6159b7e9d867 Author: László Németh AuthorDate: Mon Jan 25 15:48:46 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 18:42:07 2021 +0100 tdf#137655 DOCX table import: fix zero para top margin when only w:beforeAutospacing=0 was specified, but not PARA_TOP_MARGIN (see default_spacing = -1 in processing of LN_CT_Spacing_beforeAutospacing). Follow-up of commit 61821277ed4974debd05af89cb7284602512088f (tdf#104354 writerfilter: rewrite Autospacing). Change-Id: I5fff7a8b62450ebaf8ef6b552ecbb2b1cfb24381 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109914 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit 9e21215d45b2eea31019711282445580fad0d753) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111913 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sw/qa/extras/ooxmlexport/data/tdf137655.docx b/sw/qa/extras/ooxmlexport/data/tdf137655.docx new file mode 100644 index ..d87d434b324d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf137655.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index c6c2a3461cdd..e28eb2a4952b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -534,6 +534,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeA getProperty(xShape->getStart(), "ParaTopMargin")); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf137655, "tdf137655.docx") +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +// These were 280. +assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:p[1]/w:pPr/w:spacing", "before", "0"); +assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[2]/w:p[1]/w:pPr/w:spacing", "before", "0"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx") { xmlDocUniquePtr pXmlDoc = parseLayoutDump(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 5986266f4de4..7e1ec2415329 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1494,12 +1494,23 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con const bool bAllowAdjustments = !GetSettingsTable()->GetDoNotUseHTMLParagraphAutoSpacing(); sal_Int32 nBeforeAutospacing = -1; bool bIsAutoSet = pParaContext && pParaContext->isSet(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING); +bool bIsZeroAutospacingWithoutTopmargin = false; +const bool bNoTopmargin = pParaContext && !pParaContext->isSet(PROP_PARA_TOP_MARGIN); // apply INHERITED autospacing only if top margin is not set -if ( bIsAutoSet || (pParaContext && !pParaContext->isSet(PROP_PARA_TOP_MARGIN)) ) +if ( bIsAutoSet || bNoTopmargin ) +{ GetAnyProperty(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, pPropertyMap) >>= nBeforeAutospacing; +// tdf#137655 only w:beforeAutospacing=0 was specified, but not PARA_TOP_MARGIN +// (see default_spacing = -1 in processing of LN_CT_Spacing_beforeAutospacing) +if ( bNoTopmargin && nBeforeAutospacing == ConversionHelper::convertTwipToMM100(-1) ) +{ +nBeforeAutospacing = 0; +bIsZeroAutospacingWithoutTopmargin = true; +} +} if ( nBeforeAutospacing > -1 && pParaContext ) { -if ( bAllowAdjustments ) +if ( bAllowAdjustments && !bIsZeroAutospacingWithoutTopmargin ) { if ( GetIsFirstParagraphInShape() || (GetIsFirstParagraphInSection() && GetSectionContext() && GetSectionContext()->IsFirstSection()) || @@ -1511,7 +1522,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con pParaContext->Insert( PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, uno::makeAny( sal_Int32(0) ),true, PARA_GRAB_BAG ); } } -pParaContext->Insert(PROP_PARA_TOP_MARGIN, uno::makeAny(nBeforeAutospacing)); +if ( !bIsZeroAutospacingWithoutTopmargin || (m_nTableDepth > 0 && m_nTableDepth == m_nTableCellDepth) ) +pParaContext->Insert(PROP_PARA_TOP_MARGIN, uno::makeAny(nBeforeAutospacing)); } sal_Int32 nAfterAutospacing = -1; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/gtk3/gtk3gtkinst.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit 279ee055ab85c9e21df46594d0f13c5b6c426c09 Author: Caolán McNamara AuthorDate: Wed Mar 3 11:59:57 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 18:33:33 2021 +0100 layout on resize immediately but continue to layout at idle on queue_resize Change-Id: I1d0f2dd2d2f5631753092cf0450d2002e2ba3484 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111902 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 193f222cf3ed..63ebf1885967 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3740,17 +3740,23 @@ public: maLayoutIdle.Start(); } +void Layout() +{ +if (vcl::Window *pChild = GetWindow(GetWindowType::FirstChild)) +pChild->SetPosSizePixel(Point(0, 0), GetSizePixel()); +} + virtual void Resize() override { +maLayoutIdle.Stop(); +Layout(); WorkWindow::Resize(); -queue_resize(); } }; IMPL_LINK_NOARG(ChildFrame, ImplHandleLayoutTimerHdl, Timer*, void) { -if (vcl::Window *pChild = GetWindow(GetWindowType::FirstChild)) -pChild->SetPosSizePixel(Point(0, 0), GetSizePixel()); +Layout(); } class GtkInstanceContainer : public GtkInstanceWidget, public virtual weld::Container ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa sw/source
sw/qa/extras/ooxmlexport/data/tdf121669_equalColumns.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport15.cxx| 10 ++ sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |2 +- sw/source/filter/ww8/ww8atr.cxx |8 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) New commits: commit c223bbd3ec70aacf7c9dcefdef9c2bc4ae5d1f3e Author: Justin Luth AuthorDate: Thu Jan 21 16:19:35 2021 +0300 Commit: Gabor Kelemen CommitDate: Wed Mar 3 18:26:15 2021 +0100 tdf#121669 ww8 export: use the "we have equal columns" flag If the columns are marked as AutoWidth, then there is no need to go to the remarkably poor layout code to determine if the columns should be exported as equal. In this case, it appears as if the layout engine hadn't really identified the full width, or evaluated the wish values of each column. This fixes DOCX, DOC, and RTF. Change-Id: I1a1193b65d01e654b3bfbfaee7d8c02a683ae2c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109762 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna (cherry picked from commit 9e41002701285dc89a4dc8c91619a51071995172) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109811 Reviewed-by: Xisco Fauli (cherry picked from commit fdb42d82d1240d3ba274f3f25a1072d0044d3c5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111891 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sw/qa/extras/ooxmlexport/data/tdf121669_equalColumns.docx b/sw/qa/extras/ooxmlexport/data/tdf121669_equalColumns.docx new file mode 100644 index ..4f962e1bddf6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121669_equalColumns.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index ff1e2cb45038..8ca940e9de28 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -12,6 +12,7 @@ #include #include #include +#include char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/"; @@ -150,6 +151,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt") } } +DECLARE_OOXMLEXPORT_TEST(testTdf121669_equalColumns, "tdf121669_equalColumns.docx") +{ +uno::Reference xTextSection = getProperty< uno::Reference >(getParagraph(1), "TextSection"); +CPPUNIT_ASSERT(xTextSection.is()); +uno::Reference xTextColumns = getProperty< uno::Reference >(xTextSection, "TextColumns"); +// The property was ignored when deciding at export whether the columns were equal or not. Layout isn't reliable. +CPPUNIT_ASSERT(getProperty(xTextColumns, "IsAutomatic")); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf136441_commentInFootnote, "tdf136441_commentInFootnote.odt") { // failed to load without error if footnote contained a comment. diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 645091e56323..98a1240c9404 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -251,7 +251,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAlphabeticalIndex_MultipleColumns,"alpha assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:sectPr/w:type","val","continuous"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:type","val","continuous"); // check for "w:space" attribute for the columns in Section Properties -assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:cols/w:col[1]","space","720"); +assertXPath(pXmlDoc, "/w:document/w:body/w:p[8]/w:pPr/w:sectPr/w:cols","space","720"); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testPageref, "testPageref.docx") diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index e081b730f037..7a8026c55813 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4702,8 +4702,11 @@ void AttributeOutputBase::FormatColumns( const SwFormatCol& rCol ) } -// look if all columns are equal -bool bEven = true; +// look if all columns are equal +bool bEven = rCol.IsOrtho(); +if (!bEven) +{ +bEven = true; sal_uInt16 n; sal_uInt16 nColWidth = rCol.CalcPrtColWidth( 0, static_cast(nPageSize) ); for ( n = 1; n < nCols; n++ ) @@ -4717,6 +4720,7 @@ void AttributeOutputBase::FormatColumns( const SwFormatCol& rCol ) break; } } +} FormatColumns_Impl( nCols, rCol, bEven, nPageSize ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
0 files changed New commits: commit c4716e8c205724ee7dffd78997f7f933f157ac69 Author: Andrea Gelmini AuthorDate: Mon Mar 1 18:41:48 2021 +0100 Commit: Julien Nabet CommitDate: Wed Mar 3 18:09:32 2021 +0100 Removed executable permission on docx file Change-Id: I91c56e975843abf92c4b1d4cae1381b7486ce751 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111764 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sw/qa/extras/uiwriter/data3/AsCharTxBxTest.docx b/sw/qa/extras/uiwriter/data3/AsCharTxBxTest.docx old mode 100755 new mode 100644 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/tox/tox.cxx |2 +- sw/qa/uitest/writer_tests7/tdf140117.py |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit ece0fb55c723816f367155c9a628b01ca6448994 Author: Andrea Gelmini AuthorDate: Tue Mar 2 12:29:36 2021 +0100 Commit: Julien Nabet CommitDate: Wed Mar 3 18:09:08 2021 +0100 Fix typos Change-Id: Ie7751b61c06dba426b8ebd7e61a0e56b09a34f15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111824 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/sw/qa/core/tox/tox.cxx b/sw/qa/core/tox/tox.cxx index d10a996036a2..127cb4b06e7f 100644 --- a/sw/qa/core/tox/tox.cxx +++ b/sw/qa/core/tox/tox.cxx @@ -154,7 +154,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAuthorityTableURLDeduplication) // Without the accompanying fix in place, this test would have failed with: // - Expected: AT: Author, Title, , http://www.example.com/test2.pdf // - Actual : AT: Author, Title, , http://www.example.com/test.pdf -// i.e. test.pdf was mentionted twice, without deduplication. +// i.e. test.pdf was mentioned twice, without deduplication. CPPUNIT_ASSERT_EQUAL(OUString("AT: Author, Title, , http://www.example.com/test2.pdf";), getParagraph(4)->getString()); } diff --git a/sw/qa/uitest/writer_tests7/tdf140117.py b/sw/qa/uitest/writer_tests7/tdf140117.py index 75b9c6c2ff8a..c86d11091364 100644 --- a/sw/qa/uitest/writer_tests7/tdf140117.py +++ b/sw/qa/uitest/writer_tests7/tdf140117.py @@ -49,7 +49,7 @@ class tdf140117(UITestCase): # Option "same content on left and right pages" is false again. # This was "right" instead of keeping the header content disabled -# temporarily for the second interation of the loop. +# temporarily for the second interaction of the loop. elif i == 2: self.assertEqual("left", xHeaderLeftText) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: Modify Libreoffice UI
Howdy Heiko, Since I've switched almost entirely to use of the tabbed interface I was wondering if there is any time frame for fully updating the tabbed (notebookbar) interface using the customization dialog? I know there is a limited support currently but far short of what is available for the legacy toolbar. Thanks Drew On Wed, Mar 3, 2021 at 11:43 AM Heiko Tietze wrote: > > Hi Mai, > > it is possible to modify/add toolbars (or menus) per Tools > Customization. > See > [1] for the documentation of this feature. And you can also apply it to a > specific document by changing the "Scope". > Good place to ask specific questions is [2] or the user mailing lists [3]. > This > one is intended for developers- and from what you ask I guess you don't plan > to > change the source code. > > Cheers, > Heiko > > [1] > https://help.libreoffice.org/latest/en-US/text/shared/guide/edit_symbolbar.html?DbPAR=SHARED#bm_id3159201 > [2] https://ask.libreoffice.org/ > [3] https://www.libreoffice.org/get-help/mailing-lists/ > > On 03.03.21 16:40, Mai Dinh wrote: > > Hi there, > > > > I was looking into LibreOffice open source and potentially modifying the UI > > to > > add a new toolbar field on the top of files I open, such as document and > > spreadsheet. I was hoping for help in the direction to look at the source > > code. > > > > Any help would be appreciated, thank you! > > Mai > > > > ___ > > LibreOffice mailing list > > LibreOffice@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/libreoffice > > > > -- > Dr. Heiko Tietze, UX-Designer and UX-Mentor > Tel: +49 30 5557992-63 | Mail: heiko.tie...@documentfoundation.org > The Document Foundation, Kurfürstendamm 188, 10707 Berlin, DE > Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts > Legal details: https://www.documentfoundation.org/imprint > > ___ > 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
Build failure in connectivity/evoab2 [loplugin:refcounting]
Hello, On pc Debian x86-64 with master sources updated today, I got: [CXX] connectivity/source/drivers/firebird/Column.cxx /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NDriver.cxx:106:23: error: cppu::OWeakObject subclass 'connectivity::evoab::OEvoabConnection' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] OEvoabConnection* pCon = new OEvoabConnection( *this ); ~~^~~~ [CXX] connectivity/source/drivers/firebird/Columns.cxx [CXX] connectivity/source/drivers/firebird/Connection.cxx 1 error generated. make[1]: *** [/home/julien/lo/libreoffice/solenv/gbuild/LinkTarget.mk:301 : /home/julien/lo/libreoffice/workdir/CxxObject/connectivity/source/drivers/evoab2/NDriver.o] Erreur 1 make[1]: *** Attente des tâches non terminées /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NColumns.cxx:58:26: error: cppu::OWeakObject subclass 'connectivity::sdbcx::OColumn' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] OColumn* pRet = new OColumn( ~^~~ 1 error generated. make[1]: *** [/home/julien/lo/libreoffice/solenv/gbuild/LinkTarget.mk:301 : /home/julien/lo/libreoffice/workdir/CxxObject/connectivity/source/drivers/evoab2/NColumns.o] Erreur 1 /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NTables.cxx:51:26: error: cppu::OWeakObject subclass 'connectivity::evoab::OEvoabTable' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] OEvoabTable* pRet = new OEvoabTable( ~^~~ 1 error generated. make[1]: *** [/home/julien/lo/libreoffice/solenv/gbuild/LinkTarget.mk:301 : /home/julien/lo/libreoffice/workdir/CxxObject/connectivity/source/drivers/evoab2/NTables.o] Erreur 1 /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx:987:49: error: cppu::OWeakObject subclass '::connectivity::ODatabaseMetaDataResultSet' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTableTypes); ^ /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx:1012:33: error: cppu::OWeakObject subclass 'connectivity::ODatabaseMetaDataResultSet' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTypeInfo); ^~ /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx:1059:33: error: cppu::OWeakObject subclass 'connectivity::ODatabaseMetaDataResultSet' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] ODatabaseMetaDataResultSet* pResultSet = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eColumns ); ^~~ /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx:1081:33: error: cppu::OWeakObject subclass 'connectivity::ODatabaseMetaDataResultSet' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTableTypes); ^ 4 errors generated. make[1]: *** [/home/julien/lo/libreoffice/solenv/gbuild/LinkTarget.mk:298 : /home/julien/lo/libreoffice/workdir/CxxObject/connectivity/source/drivers/evoab2/NDatabaseMetaData.o] Erreur 1 /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NConnection.cxx:120:25: error: cppu::OWeakObject subclass 'connectivity::evoab::OEvoabCatalog' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] OEvoabCatalog *pCat = new OEvoabCatalog(this); ~~~^~ /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NConnection.cxx:132:17: error: cppu::OWeakObject subclass 'connectivity::evoab::OStatement' being managed via raw pointer, should be managed via rtl::Reference [loplugin:refcounting] OStatement* pStmt = new OStatement(this); ^~~~ /home/julien/lo/libreoffice/connectivity/source/drivers/evoab2/NConnection.cxx:144:30: error: cppu::OWeakObject subc
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b4c4aba4c96064635755099d106b65a694852393 Author: Olivier Hallot AuthorDate: Wed Mar 3 17:55:46 2021 +0100 Commit: Gerrit Code Review CommitDate: Wed Mar 3 17:55:46 2021 +0100 Update git submodules * Update helpcontent2 from branch 'master' to c34bb965f993bef53fa739de6f3aaa97de2c2ef9 - tdf#140118 Fix Help for BASIC function WaitUntil Change-Id: Iad03fa267e2eac42b02b17ebe31ed851dad3e5c8 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111912 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/helpcontent2 b/helpcontent2 index 46e4473935c7..c34bb965f993 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 46e4473935c7274fecd883b71cfb7a59e3b29cf2 +Subproject commit c34bb965f993bef53fa739de6f3aaa97de2c2ef9 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/sbasic/shared/03130610.xhp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c34bb965f993bef53fa739de6f3aaa97de2c2ef9 Author: Olivier Hallot AuthorDate: Wed Mar 3 16:54:30 2021 +0100 Commit: Olivier Hallot CommitDate: Wed Mar 3 17:55:46 2021 +0100 tdf#140118 Fix Help for BASIC function WaitUntil Change-Id: Iad03fa267e2eac42b02b17ebe31ed851dad3e5c8 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111912 Tested-by: Jenkins Reviewed-by: Olivier Hallot diff --git a/source/text/sbasic/shared/03130610.xhp b/source/text/sbasic/shared/03130610.xhp index 1e68ce7aa..dc0edc5e3 100644 --- a/source/text/sbasic/shared/03130610.xhp +++ b/source/text/sbasic/shared/03130610.xhp @@ -37,7 +37,7 @@ REM Wait until 6:00 PM then call MyMacro. REM If after 6:00 PM, exit. Sub ExampleWaitUntil -Dim vTimeschedule As Long +Dim vTimeschedule As Double vTimeSchedule = Date() + TimeValue("18:00:00") If vTimeSchedule < Now() Then Exit Sub WaitUntil vTimeSchedule ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: Modify Libreoffice UI
Hi Mai, it is possible to modify/add toolbars (or menus) per Tools > Customization. See [1] for the documentation of this feature. And you can also apply it to a specific document by changing the "Scope". Good place to ask specific questions is [2] or the user mailing lists [3]. This one is intended for developers- and from what you ask I guess you don't plan to change the source code. Cheers, Heiko [1] https://help.libreoffice.org/latest/en-US/text/shared/guide/edit_symbolbar.html?DbPAR=SHARED#bm_id3159201 [2] https://ask.libreoffice.org/ [3] https://www.libreoffice.org/get-help/mailing-lists/ On 03.03.21 16:40, Mai Dinh wrote: Hi there, I was looking into LibreOffice open source and potentially modifying the UI to add a new toolbar field on the top of files I open, such as document and spreadsheet. I was hoping for help in the direction to look at the source code. Any help would be appreciated, thank you! Mai ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice -- Dr. Heiko Tietze, UX-Designer and UX-Mentor Tel: +49 30 5557992-63 | Mail: heiko.tie...@documentfoundation.org The Document Foundation, Kurfürstendamm 188, 10707 Berlin, DE Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts Legal details: https://www.documentfoundation.org/imprint OpenPGP_signature Description: OpenPGP digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Modify Libreoffice UI
Hi there, I was looking into LibreOffice open source and potentially modifying the UI to add a new toolbar field on the top of files I open, such as document and spreadsheet. I was hoping for help in the direction to look at the source code. Any help would be appreciated, thank you! Mai ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf138899.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport12.cxx|7 +++ writerfilter/source/dmapper/DomainMapper.cxx |3 ++- writerfilter/source/dmapper/DomainMapper_Impl.cxx |8 4 files changed, 13 insertions(+), 5 deletions(-) New commits: commit 88e874bf063d19d7d1cd1ad37639ac829e74b58f Author: László Németh AuthorDate: Fri Jan 22 10:10:39 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 16:40:02 2021 +0100 tdf#138899 DOCX import: fix removing last para of section Fix regression from commit 39090afac268f9ae985832c2f08863b41e6c06f2 (tdf#120336 DOCX import: fix page break after tracked deletion), limiting the condition only for *empty* section starting paragraphs with tracked deletion. Change-Id: I020c8b0edf5d4a37a9150cccec8c25fce50327d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109779 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit b7ca9576c26ed258537134c0cf2944cfcfc65f2e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109799 Reviewed-by: Xisco Fauli (cherry picked from commit 6de15a8d094b7eca68eab5341d5a55744154114e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111890 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sw/qa/extras/ooxmlexport/data/tdf138899.docx b/sw/qa/extras/ooxmlexport/data/tdf138899.docx new file mode 100644 index ..3e346ac0e4d9 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf138899.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 1ae45cb04183..691c709b8894 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -925,6 +925,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99631, "tdf99631.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "768"); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138899, "tdf138899.docx") +{ +xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); +// This was 6, not removed empty temporary paragraph at the end of the section +assertXPath(pXmlDocument, "/w:document/w:body/w:p", 5); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf122563, "tdf122563.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 7535f2774b9c..909f055da826 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3468,7 +3468,8 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) if (bNewLine) { const bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection(); -const bool bSingleParagraphAfterRedline = m_pImpl->GetIsFirstParagraphInSection(true) && m_pImpl->GetIsLastParagraphInSection(); +const bool bSingleParagraphAfterRedline = m_pImpl->GetIsFirstParagraphInSection(/*bAfterRedline=*/true) && +m_pImpl->GetIsLastParagraphInSection(); PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); if (!m_pImpl->GetFootnoteContext()) { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 48b5bd6fea53..5986266f4de4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2028,20 +2028,20 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con else SetIsPreviousParagraphFramed(false); -m_bParaChanged = false; m_bRemoveThisParagraph = false; if( !IsInHeaderFooter() && !IsInShape() && (!pParaContext || !pParaContext->IsFrameMode()) ) { // If the paragraph is in a frame, shape or header/footer, it's not a paragraph of the section itself. SetIsFirstParagraphInSection(false); -// count first not deleted paragraph as first paragraph in section to avoid of -// its deletion later, resulting loss of the associated page break -if (!m_previousRedline) +// don't count an empty deleted paragraph as first paragraph in section to avoid of +// the deletion of the next empty paragraph later, resulting loss of the associated page break +if (!m_previousRedline || m_bParaChanged) { SetIsFirstParagraphInSectionAfterRedline(false); SetIsLastParagraphInSection(false); } } m_previousRedline.clear(); +m_bParaChanged = false; if (m_bIsFirstParaInShape) m_bIsFirstParaInShape = false; ___ Libreoffice-commits mailing list
[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-6.4-28'
Tag 'cp-6.4-28' created by Andras Timar at 2021-03-03 15:30 + cp-6.4-28 Changes since cp-6.4-27-10: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-6.4-28'
Tag 'cp-6.4-28' created by Andras Timar at 2021-03-03 15:30 + cp-6.4-28 Changes since cp-6.4-23: Andras Timar (1): Translation update --- source/ar/cui/messages.po | 130 source/ar/dictionaries/da_DK.po| 24 source/ar/officecfg/registry/data/org/openoffice/Office/UI.po | 24 source/ar/svtools/messages.po | 44 source/ar/svx/messages.po | 502 - source/ar/sw/messages.po | 405 source/as/cui/messages.po | 106 source/as/dictionaries/da_DK.po| 18 source/as/officecfg/registry/data/org/openoffice/Office/UI.po | 12 source/as/svtools/messages.po | 42 source/as/svx/messages.po | 472 source/as/sw/messages.po | 385 source/ast/cui/messages.po | 108 source/ast/dictionaries/da_DK.po | 18 source/ast/officecfg/registry/data/org/openoffice/Office/UI.po | 18 source/ast/svtools/messages.po | 42 source/ast/svx/messages.po | 485 - source/ast/sw/messages.po | 387 source/bg/cui/messages.po | 106 source/bg/dictionaries/da_DK.po| 24 source/bg/officecfg/registry/data/org/openoffice/Office/UI.po | 20 source/bg/svtools/messages.po | 42 source/bg/svx/messages.po | 465 source/bg/sw/messages.po | 385 source/bn-IN/cui/messages.po | 106 source/bn-IN/dictionaries/da_DK.po | 18 source/bn-IN/officecfg/registry/data/org/openoffice/Office/UI.po | 12 source/bn-IN/svtools/messages.po | 42 source/bn-IN/svx/messages.po | 482 source/bn-IN/sw/messages.po| 386 source/br/cui/messages.po | 106 source/br/dictionaries/da_DK.po| 18 source/br/officecfg/registry/data/org/openoffice/Office/UI.po | 12 source/br/svtools/messages.po | 42 source/br/svx/messages.po | 487 - source/br/sw/messages.po | 385 source/ca-valencia/cui/messages.po | 106 source/ca-valencia/dictionaries/da_DK.po | 18 source/ca-valencia/officecfg/registry/data/org/openoffice/Office/UI.po | 12 source/ca-valencia/svtools/messages.po | 42 source/ca-valencia/svx/messages.po | 471 source/ca-valencia/sw/messages.po | 385 source/ca/cui/messages.po | 106 source/ca/dictionaries/da_DK.po| 24 source/ca/officecfg/registry/data/org/openoffice/Office/UI.po | 20 source/ca/svtools/messages.po | 42 source/ca/svx/messages.po | 471 source/ca/sw/messages.po | 385 source/cs/cui/messages.po | 106 source/cs/dictionaries/da_DK.po| 24 source/cs/officecfg/registry/data/org/openoffice/Office/UI.po | 20 source/cs/svtools/messages.po | 42 source/cs/svx/messages.po | 465 source/cs/sw/messages.po | 385 source/cy/cui/messages.po | 106 source/cy/dictionaries/da_DK.po| 24 source/cy/officecfg/registry/data/org/openoffice/Office/UI.po | 20 source/cy/svtools/messages.po | 42 source/cy/svx/messages.po | 467 source/cy/sw/messages.po | 385 source/da/cui/messages.po
[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-6.4-28'
Tag 'cp-6.4-28' created by Andras Timar at 2021-03-03 15:30 + cp-6.4-28 Changes since cp-6.4-branch-point-11: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-6.4-28'
Tag 'cp-6.4-28' created by Andras Timar at 2021-03-03 15:30 + cp-6.4-28 Changes since co-6.4-20: Andras Timar (1): update Danish dictionary --- da_DK/README_da_DK.txt |4 da_DK/da_DK.aff| 3401 da_DK/da_DK.dic|288016 +++-- da_DK/description.xml |9 4 files changed, 139245 insertions(+), 152185 deletions(-) --- ___ 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' - configure.ac
configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ed31585336d1d849c1dd9f73372881e0275ce35a Author: Andras Timar AuthorDate: Wed Mar 3 16:28:02 2021 +0100 Commit: Andras Timar CommitDate: Wed Mar 3 16:28:02 2021 +0100 Bump version to 6.4-28 Change-Id: I7a31392b4b079fce2815975f789d3238c75a0462 diff --git a/configure.ac b/configure.ac index 344209cbf083..cd5e7ee3e2b0 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[6.4.10.27],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[6.4.10.28],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/cctrl/checklistmenu.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit fad8dd780df8374ceb5c4c60ffc08d793f34651f Author: Szymon Kłos AuthorDate: Wed Jan 6 12:38:40 2021 +0100 Commit: Szymon Kłos CommitDate: Wed Mar 3 16:27:10 2021 +0100 autofilter: show menu only if has items Change-Id: Ie6b7158e74a8bdccdbafaa9b6d9b09b3796088ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108846 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111895 Tested-by: Jenkins diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 19c098a8d96e..9bbfa731f27c 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -131,6 +131,7 @@ void ScCheckListMenuControl::addMenuItem(const OUString& rText, Action* pAction) aItem.mxAction.reset(pAction); maMenuItems.emplace_back(std::move(aItem)); +mxMenu->show(); mxMenu->append_text(rText); if (mbCanHaveSubMenu) mxMenu->set_image(mxMenu->n_children() - 1, css::uno::Reference(), 1); @@ -179,6 +180,7 @@ ScCheckListMenuWindow* ScCheckListMenuControl::addSubMenuItem(const OUString& rT pNotifier)); maMenuItems.emplace_back(std::move(aItem)); +mxMenu->show(); mxMenu->append_text(rText); if (mbCanHaveSubMenu) mxMenu->set_image(mxMenu->n_children() - 1, *mxDropDown, 1); @@ -458,6 +460,7 @@ ScCheckListMenuControl::ScCheckListMenuControl(ScCheckListMenuWindow* pParent, v { mxTreeChecks->set_clicks_to_toggle(1); mxListChecks->set_clicks_to_toggle(1); +mxMenu->hide(); // show only when has items /* tdf#136559 If we have no dates we don't need a tree ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit d06ec2aea2efa0fea9ce52f6a065848a56818ae7 Author: Szymon Kłos AuthorDate: Tue Jan 26 11:48:16 2021 +0100 Commit: Szymon Kłos CommitDate: Wed Mar 3 16:26:55 2021 +0100 lok: send paragraph spacing state Change-Id: Ibb2fcbcb077ad364159ce77ad7d4c6a67443deef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109940 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111839 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6636254bd7b8..d62ceac29c74 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2832,7 +2832,10 @@ static void doc_iniUnoCommands () OUString(".uno:FreezePanesRow"), OUString(".uno:Sidebar"), OUString(".uno:SheetRightToLeft"), -OUString(".uno:RunMacro") +OUString(".uno:RunMacro"), +OUString(".uno:SpacePara1"), +OUString(".uno:SpacePara15"), +OUString(".uno:SpacePara2") }; util::URL aCommandURL; ___ 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' - desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d1418cedc46cb90fea09c7b4bb2f50dd185b2c51 Author: Henry Castro AuthorDate: Mon Mar 1 10:25:09 2021 -0400 Commit: Michael Meeks CommitDate: Wed Mar 3 16:11:42 2021 +0100 lok: disable macro execution Change-Id: I97a1fd7992d6be57e54c186045e62c3402b99375 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111752 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8cd4503ed189..af9c9ed1c41b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2274,7 +2274,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, aFilterOptions[1].Name = "InteractionHandler"; aFilterOptions[1].Value <<= xInteraction; -sal_Int16 nMacroExecMode = document::MacroExecMode::USE_CONFIG; +sal_Int16 nMacroExecMode = document::MacroExecMode::NEVER_EXECUTE; aFilterOptions[2].Name = "MacroExecutionMode"; aFilterOptions[2].Value <<= nMacroExecMode; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - offapi/com sc/qa sc/source
offapi/com/sun/star/sheet/FilterFieldValue.idl |7 +++ sc/qa/uitest/autofilter/autofilter.py | 30 sc/qa/uitest/data/autofilter/tdf116818.xlsx|binary sc/source/filter/inc/autofilterbuffer.hxx |4 +- sc/source/filter/oox/autofilterbuffer.cxx | 45 + sc/source/filter/oox/autofiltercontext.cxx |2 - sc/source/ui/unoobj/datauno.cxx| 21 ++- 7 files changed, 97 insertions(+), 12 deletions(-) New commits: commit 79e0b2d285c9ba4ae765b811d1c23c222c85dbf8 Author: Balazs Varga AuthorDate: Wed Jan 13 16:17:30 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 16:01:28 2021 +0100 tdf#116818 sc,offapi,XLSX import: fix autofiltered date columns by importing dateGroupItem. Add property IsDateValue to com::sun::star::sheet::FilterFieldValue. Note: ODS import/export and XLSX export haven't been supported, yet. To check/show the fix manually, run the test with $ (cd sc && make -srj8 UITest_autofilter UITEST_TEST_NAME="autofilter.AutofilterTest.test_tdf116818" SAL_USE_VCLPLUGIN=gen) Change-Id: I033f1915c710589ff11fe97e9b39e45251976dfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109233 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 0e751d0cb816197f15a2448ec36c57df17387e40) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111889 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/offapi/com/sun/star/sheet/FilterFieldValue.idl b/offapi/com/sun/star/sheet/FilterFieldValue.idl index 5d1b40837476..2e3ba927dc97 100644 --- a/offapi/com/sun/star/sheet/FilterFieldValue.idl +++ b/offapi/com/sun/star/sheet/FilterFieldValue.idl @@ -29,6 +29,13 @@ struct FilterFieldValue /** specifies a string value for the condition. */ string StringValue; + +/** specifies whether the TableFilterFieldValue::StringValue +is a string value or a date value. + +@since LibreOffice 7.2 + */ +boolean IsDateValue; }; }; }; }; }; diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index e1aea9c1e303..bb5260da504e 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -98,4 +98,34 @@ class AutofilterTest(UITestCase): self.ui_test.close_doc() +def test_tdf116818(self): +doc = self.ui_test.load_file(get_url_for_data_file("tdf116818.xlsx")) + +xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + +xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xCheckListMenu = xFloatWindow.getChild("check_list_menu") +xTreeList = xCheckListMenu.getChild("check_tree_box") +self.assertEqual(3, len(xTreeList.getChildren())) +xOkBtn = xFloatWindow.getChild("cancel") +xOkBtn.executeAction("CLICK", tuple()) + +xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xCheckListMenu = xFloatWindow.getChild("check_list_menu") +xTreeList = xCheckListMenu.getChild("check_list_box") +self.assertEqual(5, len(xTreeList.getChildren())) +xOkBtn = xFloatWindow.getChild("cancel") +xOkBtn.executeAction("CLICK", tuple()) + +xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"})) +xFloatWindow = self.xUITest.getFloatWindow() +xCheckListMenu = xFloatWindow.getChild("check_list_menu") +xTreeList = xCheckListMenu.getChild("check_list_box") +self.assertEqual(3, len(xTreeList.getChildren())) +xOkBtn = xFloatWindow.getChild("cancel") +xOkBtn.executeAction("CLICK", tuple()) + +self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/autofilter/tdf116818.xlsx b/sc/qa/uitest/data/autofilter/tdf116818.xlsx new file mode 100644 index ..060615cc0444 Binary files /dev/null and b/sc/qa/uitest/data/autofilter/tdf116818.xlsx differ diff --git a/sc/source/filter/inc/autofilterbuffer.hxx b/sc/source/filter/inc/autofilterbuffer.hxx index 469aacdce399..e0270336a10e 100644 --- a/sc/source/filter/inc/autofilterbuffer.hxx +++ b/sc/source/filter/inc/autofilterbuffer.hxx @@ -48,7 +48,7 @@ struct ApiFilterSettings void appendField( bool bAnd, sal_Int32 nOperator, double fValue ); void appendField( bool bAnd, sal_Int32 nOperator, const OUString& rValue ); -void appendField( bool bAnd, const std::vector& rValues ); +void appendField( bool bAnd, const std::vector>& rValues ); }; /** Base class for specific filter settings for a column in a filtered range. @@ -86,7 +86,7 @@ public: private: -std::
[Libreoffice-commits] core.git: include/vcl
include/vcl/toolkit/button.hxx|1 + include/vcl/toolkit/combobox.hxx |5 + include/vcl/toolkit/controllayout.hxx |5 + include/vcl/toolkit/dialog.hxx|5 + include/vcl/toolkit/fixed.hxx |1 + include/vcl/toolkit/fixedhyper.hxx|5 + include/vcl/toolkit/imgctrl.hxx |5 + include/vcl/toolkit/lstbox.hxx|5 + include/vcl/toolkit/prgsbar.hxx |5 + include/vcl/toolkit/roadmap.hxx |6 ++ include/vcl/toolkit/spin.hxx |5 + include/vcl/toolkit/svtabbx.hxx |1 + include/vcl/toolkit/tabdlg.hxx|5 + include/vcl/toolkit/throbber.hxx |5 + include/vcl/toolkit/unowrap.hxx |5 + 15 files changed, 16 insertions(+), 48 deletions(-) New commits: commit 38fc438a3d43eb3cc34f7f1e97b6f6d5806ec97e Author: Caolán McNamara AuthorDate: Tue Mar 2 09:57:59 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 15:55:35 2021 +0100 make all these headers pragma once Change-Id: Ic7968abf807c080636ef37a690990a962f702d35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111815 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/vcl/toolkit/button.hxx b/include/vcl/toolkit/button.hxx index 5ce55286e395..a470ea28d7c1 100644 --- a/include/vcl/toolkit/button.hxx +++ b/include/vcl/toolkit/button.hxx @@ -16,6 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx index f31d0a83152e..97e5ef18dad7 100644 --- a/include/vcl/toolkit/combobox.hxx +++ b/include/vcl/toolkit/combobox.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_COMBOBOX_HXX -#define INCLUDED_VCL_COMBOBOX_HXX +#pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) #error "don't use this in new code" @@ -191,6 +190,4 @@ public: virtual void DumpAsPropertyTree(tools::JsonWriter&) override; }; -#endif // _COMBOBOX_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/toolkit/controllayout.hxx b/include/vcl/toolkit/controllayout.hxx index 00a39f25c5a0..d47514460fe9 100644 --- a/include/vcl/toolkit/controllayout.hxx +++ b/include/vcl/toolkit/controllayout.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_CONTROLLAYOUT_HXX -#define INCLUDED_VCL_CONTROLLAYOUT_HXX +#pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) #error "don't use this in new code" @@ -76,6 +75,4 @@ struct VCL_DLLPUBLIC ControlLayoutData } // namespace vcl -#endif // INCLUDED_VCL_CONTROLLAYOUT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx index 6d72044f4c2f..e249487b1b50 100644 --- a/include/vcl/toolkit/dialog.hxx +++ b/include/vcl/toolkit/dialog.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_DIALOG_HXX -#define INCLUDED_VCL_DIALOG_HXX +#pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) #error "don't use this in new code" @@ -163,6 +162,4 @@ public: voidDumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override; }; -#endif // INCLUDED_VCL_DIALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx index 6fbf0c640ec1..8d82039f1f56 100644 --- a/include/vcl/toolkit/fixed.hxx +++ b/include/vcl/toolkit/fixed.hxx @@ -16,6 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) diff --git a/include/vcl/toolkit/fixedhyper.hxx b/include/vcl/toolkit/fixedhyper.hxx index 1a7ec8fada7d..084a508a427b 100644 --- a/include/vcl/toolkit/fixedhyper.hxx +++ b/include/vcl/toolkit/fixedhyper.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_FIXEDHYPER_HXX -#define INCLUDED_VCL_FIXEDHYPER_HXX +#pragma once #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS) #error "don't use this in new code" @@ -116,6 +115,4 @@ public: virtual voidSetText(const OUString& rNewDescription) override; }; -#endif - /* vim:set s
[Libreoffice-commits] core.git: compilerplugins/clang include/vcl solenv/clang-format toolkit/source vcl/inc vcl/Library_vclplug_gen.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl
compilerplugins/clang/constantparam.numbers.results |2 +- compilerplugins/clang/unusedenumconstants.writeonly.results |2 +- include/vcl/toolkit/floatwin.hxx|9 + solenv/clang-format/excludelist |2 +- toolkit/source/awt/vclxtoolkit.cxx |2 +- toolkit/source/awt/vclxwindow.cxx |2 +- vcl/Library_vclplug_gen.mk |1 + vcl/Library_vclplug_gtk3.mk |1 + vcl/Library_vclplug_gtk3_kde5.mk|1 + vcl/Library_vclplug_osx.mk |1 + vcl/Library_vclplug_qt5.mk |1 + vcl/Library_vclplug_win.mk |1 + vcl/inc/NotebookbarPopup.hxx|2 +- vcl/inc/bubblewindow.hxx|2 +- vcl/inc/helpwin.hxx |2 +- vcl/inc/listbox.hxx |2 +- vcl/inc/pch/precompiled_vcl.hxx |4 ++-- vcl/inc/scrwnd.hxx |2 +- vcl/osx/salmenu.cxx |2 +- vcl/qt5/Qt5Menu.cxx |2 +- vcl/source/app/svapp.cxx|2 +- vcl/source/app/weldutils.cxx|2 +- vcl/source/control/menubtn.cxx |2 +- vcl/source/uitest/uiobject.cxx |2 +- vcl/source/uitest/uitest.cxx|2 +- vcl/source/window/brdwin.cxx|2 +- vcl/source/window/dialog.cxx|2 +- vcl/source/window/dockmgr.cxx |2 +- vcl/source/window/dockwin.cxx |2 +- vcl/source/window/floatwin.cxx |2 +- vcl/source/window/menu.cxx |2 +- vcl/source/window/menufloatingwindow.hxx|2 +- vcl/source/window/taskpanelist.cxx |2 +- vcl/source/window/toolbox.cxx |2 +- vcl/source/window/toolbox2.cxx |2 +- vcl/source/window/winproc.cxx |2 +- vcl/unx/generic/window/salframe.cxx |2 +- vcl/unx/gtk3/gtk3gtkframe.cxx |2 +- vcl/unx/gtk3/gtk3gtkinst.cxx|2 +- vcl/unx/gtk3/gtk3gtksalmenu.cxx |2 +- vcl/workben/vcldemo.cxx |2 +- 41 files changed, 46 insertions(+), 39 deletions(-) New commits: commit f645d4c35eebb5674a7e698c1db425afcf0784a5 Author: Caolán McNamara AuthorDate: Tue Mar 2 09:41:26 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 15:54:56 2021 +0100 vcl/floatwin.hxx can be toolkit only now Change-Id: Ifd8f58771ea6f9212a0dca7d4550c86ebecd9333 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111814 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/compilerplugins/clang/constantparam.numbers.results b/compilerplugins/clang/constantparam.numbers.results index 7d441a9fa015..7759f40f512d 100644 --- a/compilerplugins/clang/constantparam.numbers.results +++ b/compilerplugins/clang/constantparam.numbers.results @@ -1466,7 +1466,7 @@ include/vcl/filter/PDFiumLibrary.hxx:224 _Bool vcl::pdf::PDFiumDocument::saveWithVersion(class SvMemoryStream &,int) int nFileVersion 16 -include/vcl/floatwin.hxx:159 +include/vcl/toolkit/floatwin.hxx:159 class Point FloatingWindow::CalcFloatingPosition(class vcl::Window *,const class tools::Rectangle &,enum FloatWinPopupFlags,unsigned short &) enum FloatWinPopupFlags nFlags 16 diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results b/compilerplugins/clang/unusedenumconstants.writeonly.results index 225d6c793cd6..ec47c390423e 100644 --- a/compilerplugins/clang/unusedenumconstants.writeonly.results +++ b/compilerplugins/clang/unusedenumconstants.writeonly.results @@ -2850,7 +2850,7 @@ include/vcl/filter/pdfdocument.hxx:294 enum vcl::filter::TokenizeMode END_OF_STREAM include/vcl/filter/pdfdocument.hxx:300 enum vcl::filter::TokenizeMode STORED_OBJECT -include/vcl/floatwin.hxx:68 +include/vcl/toolkit/floatwin.hxx:68 enum FloatWinTitleType Unknown include/vcl/fntstyle.hxx:31 enum FontKerning FontSpecific diff --git a/include/vcl/floatwin.hxx b/include/vcl/toolkit/floatwin.hxx similarity index 97% rename from include/vcl/floatwin.hxx rename to include/vcl/toolkit/floatwin.hxx index ad87e036b0c4..bbfddabcce
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/uiwriter/uiwriter.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 93a8247598bae20a2d9b3eb9abc2578fd2e4a712 Author: Xisco Fauli AuthorDate: Wed Mar 3 12:00:57 2021 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 3 15:54:04 2021 +0100 sw_uiwriter: Add test for cursor position when moving up Found in https://gerrit.libreoffice.org/c/core/+/109571 Change-Id: I31217d1e0189973d4cdb4721939687ef4355c6d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111894 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 7495b9ab74ff..cfb22cd86ca2 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -216,6 +216,7 @@ public: void testCreatePortions(); void testBookmarkUndo(); void testFdo85876(); +void testCaretPositionMovingUp(); void testTdf81226(); void testTdf79717(); void testTdf137532(); @@ -449,6 +450,7 @@ public: CPPUNIT_TEST(testCreatePortions); CPPUNIT_TEST(testBookmarkUndo); CPPUNIT_TEST(testFdo85876); +CPPUNIT_TEST(testCaretPositionMovingUp); CPPUNIT_TEST(testTdf81226); CPPUNIT_TEST(testTdf79717); CPPUNIT_TEST(testTdf137532); @@ -2029,6 +2031,18 @@ void SwUiWriterTest::testFdo85876() } } +void SwUiWriterTest::testCaretPositionMovingUp() +{ +SwDoc* const pDoc = createDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); +pWrtShell->Insert("after"); +pWrtShell->InsertLineBreak(); +pWrtShell->Up(false); +pWrtShell->Insert("before"); + +CPPUNIT_ASSERT_EQUAL(OUString(u"beforeAfter" + OUStringChar(CH_TXTATR_NEWLINE)), getParagraph(1)->getString()); +} + void SwUiWriterTest::testTdf81226() { SwDoc* const pDoc = createDoc(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/subsequent_export-test.cxx | 21 + sc/source/filter/xcl97/xcl97rec.cxx | 11 +++ 2 files changed, 24 insertions(+), 8 deletions(-) New commits: commit 33dbe50194dbfaf2748691e6259eefdc63d35e67 Author: Szabolcs Toth AuthorDate: Thu Dec 31 10:31:30 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 15:08:49 2021 +0100 tdf#139258 XLSX export: fix position of rotated images Follow-up of commit a4eec60c388cc65ae0b4c8ea0fd7235f520a749d (tdf#123613 XLSX export: fix position of rotated shapes) and commit 368c56144aab5794c39d5bc2082d9b3d6d7cebdb (refactor for xlsx shape export). Change-Id: If5a79685efa1a80ea82eac19aed12bb426d10987 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108533 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit fddad2ed797f1773ed5be979a0b05d3f976b744e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109517 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit aa23da6b9e935fbfcb0b432d43c72f7a6db50657) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111885 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 760b194ed371..8df43f1e4922 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -276,6 +276,7 @@ public: void testTdf138824_linkToParentDirectory(); void testTdf129969(); void testTdf84874(); +void testTdf139258_rotated_image(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -446,6 +447,7 @@ public: CPPUNIT_TEST(testTdf138824_linkToParentDirectory); CPPUNIT_TEST(testTdf129969); CPPUNIT_TEST(testTdf84874); +CPPUNIT_TEST(testTdf139258_rotated_image); CPPUNIT_TEST_SUITE_END(); @@ -5694,6 +5696,25 @@ void ScExportTest::testTdf84874() xDocSh->DoClose(); } +void ScExportTest::testTdf139258_rotated_image() +{ +// Check that the topleft position of the image is correct. +ScDocShellRef xShell = loadDoc(u"tdf139258_rotated_image.", FORMAT_ODS); +CPPUNIT_ASSERT(xShell.is()); + +std::shared_ptr pXPathFile += ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); + +xmlDocUniquePtr pDrawing += XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/drawing1.xml"); +CPPUNIT_ASSERT(pDrawing); + +assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:col", "1"); +assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:from/xdr:row", "12"); +assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:col", "6"); +assertXPathContent(pDrawing, "/xdr:wsDr/xdr:twoCellAnchor/xdr:to/xdr:row", "25"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 38ad870c4970..b8676ca00e4e 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1103,14 +1103,9 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& { sal_Int16 nHalfWidth = aSize.Width / 2; sal_Int16 nHalfHeight = aSize.Height / 2; -// aTopLeft needs correction for rotated customshapes -if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE) -{ -const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape -aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - nHalfWidth; -aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - nHalfHeight; -} - +const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape +aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - nHalfWidth; +aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - nHalfHeight; // MSO changes the anchor positions at these angles and that does an extra 90 degrees // rotation on our shapes, so we output it in such position that MSO // can draw this shape correctly. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: helpcontent2
helpcontent2 |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 998dda1d674151a3b5f81483941fc8719f8298fe Author: Seth Chaiklin AuthorDate: Wed Mar 3 15:01:05 2021 +0100 Commit: Gerrit Code Review CommitDate: Wed Mar 3 15:01:05 2021 +0100 Update git submodules * Update helpcontent2 from branch 'master' to 46e4473935c7274fecd883b71cfb7a59e3b29cf2 - tdf#98153 add mention and link to document filters + add variable to a paragraph that gives link to document filters + use variable to embed paragraph in the --in-filter parameter Change-Id: If93918b17b681fd5e87e4495c5bd3a122b770a5b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111888 Reviewed-by: Seth Chaiklin Tested-by: Jenkins diff --git a/helpcontent2 b/helpcontent2 index 85f10dd2ed84..46e4473935c7 16 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 85f10dd2ed8485af159bf2e15e7e3e024b04bcf6 +Subproject commit 46e4473935c7274fecd883b71cfb7a59e3b29cf2 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] help.git: source/text
source/text/shared/guide/start_parameters.xhp |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 46e4473935c7274fecd883b71cfb7a59e3b29cf2 Author: Seth Chaiklin AuthorDate: Wed Mar 3 14:47:07 2021 +0100 Commit: Seth Chaiklin CommitDate: Wed Mar 3 15:01:05 2021 +0100 tdf#98153 add mention and link to document filters + add variable to a paragraph that gives link to document filters + use variable to embed paragraph in the --in-filter parameter Change-Id: If93918b17b681fd5e87e4495c5bd3a122b770a5b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/111888 Reviewed-by: Seth Chaiklin Tested-by: Jenkins diff --git a/source/text/shared/guide/start_parameters.xhp b/source/text/shared/guide/start_parameters.xhp index b87cc0c47..248aa8e51 100644 --- a/source/text/shared/guide/start_parameters.xhp +++ b/source/text/shared/guide/start_parameters.xhp @@ -195,6 +195,7 @@ Forces an input filter type, if possible. For example: --infilter="Calc Office Open XML" --infilter="Text (encoded):UTF8,LF,Liberation Mono,en-US". + @@ -532,7 +533,7 @@ --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc --convert-to "html:XHTML Writer File:UTF8" *.doc --convert-to "txt:Text (encoded):UTF8" *.doc -See the list of document filters for file conversion. +See the list of document filters for file conversion. ___ 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/source
include/vcl/dockwin.hxx | 16 svx/source/tbxctrls/tbcontrl.cxx | 19 +++ vcl/source/window/dockmgr.cxx|8 vcl/source/window/dockwin.cxx|1 + 4 files changed, 44 insertions(+) New commits: commit f1525c89ccf2b80f284bea68bd7a62dfaaff56a4 Author: Pranam Lashkari AuthorDate: Tue Mar 2 06:04:40 2021 +0530 Commit: Pranam Lashkari CommitDate: Wed Mar 3 14:44:04 2021 +0100 LOK: added missing PixelInvalidate method for currency list when docking window is displayed in popup mode, there are two windows created docking window and floating window, to make the this window work correctly with LOK, we have to invalidate the floating window to update floating window, as well as docking window. Change-Id: Ia1b4220646664aa0666a24e34fc14bf41421f9e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111762 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index d60ed99123ff..85167ebbf318 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -216,6 +216,16 @@ class VCL_DLLPUBLIC DockingWindow class ImplData; private: VclPtr mpFloatWin; + +// in the case when docking window is displayed in popup mode +// there are 2 window instance docking window and floating window +// and to make things work correctly both needs to be invalidated together +// but unfortunatly from any docking window we don't have access to floating window notifier +// so we can use this mnPopUpWinId to store the floating win id when we can to use later +// this was primarily introduced to fix the currency popup window in calc LOK +// if there is any better approach +// FIXME +vcl::LOKWindowId mnLOKPopUpWinId; VclPtrmpOldBorderWin; std::unique_ptr mpImplData; Point maFloatPos; @@ -315,6 +325,12 @@ public: boolIsFloatingMode() const; FloatingWindow* GetFloatingWindow() const { return mpFloatWin; } +// These two methods are used when docking window is displayed in popup mode +// By setting this popup window id we can access floating window notifier in docking window +// one of the example can be found in SvxCurrencyList_Impl::PixelInvalidate +void SetPopUpWindowLOKId(vcl::LOKWindowId nLOKPopUpWinId) { mnLOKPopUpWinId = nLOKPopUpWinId; } +vcl::LOKWindowId GetPopUpWindowLOKId() const { return mnLOKPopUpWinId; } + voidSetFloatingPos( const Point& rNewPos ); Point GetFloatingPos() const; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 50e3f6760867..57cca78867f4 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -645,6 +645,8 @@ public: LanguageType& eSelectLanguage ); virtual ~SvxCurrencyList_Impl() override { disposeOnce(); } virtual void dispose() override; + +void PixelInvalidate(const tools::Rectangle* pRectangle) override; }; class SvxStyleToolBoxControl; @@ -2685,15 +2687,32 @@ SvxCurrencyList_Impl::SvxCurrencyList_Impl( if ( nSelectedPos >= 0 ) m_pCurrencyLb->SelectEntryPos( nSelectedPos ); m_pCurrencyLb->Show(); + +auto parentNotifier = GetParentWithLOKNotifier(); +if (parentNotifier) +SetLOKNotifier(parentNotifier->GetLOKNotifier()); } void SvxCurrencyList_Impl::dispose() { +ReleaseLOKNotifier(); m_xControl.clear(); m_pCurrencyLb.disposeAndClear(); ToolbarPopup::dispose(); } +void SvxCurrencyList_Impl::PixelInvalidate(const tools::Rectangle* pRectangle) +{ +const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier(); +if (pNotifier && pRectangle && GetPopUpWindowLOKId() != 0) +{ +std::vector aPayload; +aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString())); +pNotifier->notifyWindow(GetPopUpWindowLOKId(), "invalidate", aPayload); +} +svtools::ToolbarPopup::PixelInvalidate(pRectangle); +} + SvxLineWindow_Impl::SvxLineWindow_Impl( svt::ToolboxController& rController, vcl::Window* pParentWindow ) : ToolbarPopup( rController.getFrameInterface(), pParentWindow, WB_STDPOPUP | WB_MOVEABLE | WB_CLOSEABLE ), m_aLineStyleLb( VclPtr::Create(this) ), diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index a0825e616467..3d70272ae04a 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -817,6 +817,10 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin mpFloatWin->StartPopupMode( pParentToolBox, nFlags ); GetWindow()->Show(); +DockingWindow* pDockWin = dynamic_cast< DockingWindow* >(mpDockingWindow.get()); +if (pDockWin) +pDockWin->SetPopUpWindowLOKId(mpFloatWin->GetLOKWindowId()); + if( pParentToolBox
[Libreoffice-commits] core.git: sw/source
sw/source/core/layout/paintfrm.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit ecb3f0a4919414a736a14b27b7d44c95cec607b1 Author: Miklos Vajna AuthorDate: Wed Mar 3 11:22:12 2021 +0100 Commit: Miklos Vajna CommitDate: Wed Mar 3 14:39:32 2021 +0100 sw: document the abbreviations from DR's magic aLFromB and friends are mentioned at 3 places in sw, but nothing was explaining what it means. Change-Id: I877395da7b5384431288fea8f454646edfe8c05f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111869 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index b3c940b87cea..c549b5ffeb46 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2632,6 +2632,8 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, svx::frame::Style* pStyles, bool bHori ) const { +// For example, aLFromB means: this vertical line intersects my horizontal line at its left end, +// from bottom. // pStyles[ 1 ] = bHori ? aLFromT : TFromL // pStyles[ 2 ] = bHori ? aLFromL : TFromT, // pStyles[ 3 ] = bHori ? aLFromB : TFromR, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: external/libnumbertext sax/source
external/libnumbertext/Afl++ICE.patch1 | 30 external/libnumbertext/UnpackedTarball_libnumbertext.mk |1 sax/source/tools/converter.cxx | 10 + 3 files changed, 3 insertions(+), 38 deletions(-) New commits: commit bc820a345058f1cb41a49f8961c0aef26065dc53 Author: Stephan Bergmann AuthorDate: Tue Mar 2 10:13:50 2021 +0100 Commit: Stephan Bergmann CommitDate: Wed Mar 3 14:32:08 2021 +0100 Remove workaround now its fixed in AFL++ and oss-fuzz updated remove workaround for problem fixed by: https://github.com/AFLplusplus/AFLplusplus/commit/333509bb0a56be9bd2e236f0e2f37d4af2dd7d59> +# "better unicode support" for now: oss-fuzz updated: https://github.com/google/oss-fuzz/pull/5273 Change-Id: Id3f1790ef452ed7732032801fc4ec028e57443eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111806 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/external/libnumbertext/Afl++ICE.patch1 b/external/libnumbertext/Afl++ICE.patch1 deleted file mode 100644 index 62104200632d.. --- a/external/libnumbertext/Afl++ICE.patch1 +++ /dev/null @@ -1,30 +0,0 @@ /src/Soros.cxx 2021-02-24 15:31:59.003956770 + -+++ /src/Soros.cxx 2021-02-24 15:32:29.156601577 + -@@ -45,6 +45,9 @@ - begins(0), - ends(0) - { -+const std::wstring_view numbertext = L"__numbertext__"; -+const std::wstring_view semicolon = L";"; -+ - program = translate(program, m, c, L"\\"); // \\, \", \;, \# -> \uE000..\uE003 - // switch off all country-dependent lines, and switch on the requested ones - program = regex_replace(program, wregex(L"(^|[\n;])([^\n;#]*#[^\n]*\\[:[^\n:\\]]*:\\][^\n]*)"), L"$1#$2"); -@@ -52,7 +55,7 @@ - program = regex_replace(program, wregex(L"(^|[\n;])#([^\n;#]*#[^\n]*\\[:" + filtered_lang + L":\\][^\n]*)"), L"$1$2"); - program = regex_replace(program, wregex(L"(#[^\n]*)?(\n|$)"), L";"); // remove comments - // __numbertext__ sets the place of left zero deletion rule --if (program.find(L"__numbertext__") == std::wstring::npos) -+if (program.find(numbertext) == std::wstring::npos) - program.insert(0, L"__numbertext__;"); - program = regex_replace(program, wregex(L"__numbertext__"), - // default left zero deletion -@@ -69,7 +72,7 @@ - wregex quoteStart(L"^\""); - wregex quoteEnd(L"\"$"); - std::wstring smacro; --while ((pos = program.find(L";", pos)) != std::wstring::npos) { -+while ((pos = program.find(semicolon, pos)) != std::wstring::npos) { - wsmatch sp; - std::wstring linOrig = program.substr(old_pos, pos - old_pos); - // pattern extension after == macro ==: diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk index 1238290049d1..48cd2a9a273d 100644 --- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk +++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk @@ -18,7 +18,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libnumbertext,1)) $(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \ external/libnumbertext/MSVCNonBMPBug.patch1 \ external/libnumbertext/WinUnicodePath.patch1 \ -external/libnumbertext/Afl++ICE.patch1 \ )) # vim: set noet sw=4 ts=4: diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 4b476be934ee..f4f6dccb8ddc 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -728,10 +728,6 @@ void Converter::convertAngle(OUStringBuffer& rBuffer, sal_Int16 const nAngle, bool Converter::convertAngle(sal_Int16& rAngle, std::u16string_view rString, bool const isWrongOOo10thDegAngle) { -const std::u16string_view deg = u"deg"; -const std::u16string_view grad = u"grad"; -const std::u16string_view rad = u"rad"; - // ODF 1.1 leaves it undefined what the number means, but ODF 1.2 says it's // degrees, while OOo has historically used 10th of degrees :( // So import degrees when we see the "deg" suffix but continue with 10th of @@ -741,15 +737,15 @@ bool Converter::convertAngle(sal_Int16& rAngle, std::u16string_view rString, sal_Int32 nValue(0); double fValue(0.0); bool bRet = ::sax::Converter::convertDouble(fValue, rString); -if (std::u16string_view::npos != rString.find(deg)) +if (std::u16string_view::npos != rString.find(u"deg")) { nValue = fValue * 10.0; } -else if (std::u16string_view::npos != rString.find(grad)) +else if (std::u16string_view::npos != rString.find(u"grad")) { nValue = (fValue * 9.0 / 10.0) * 10.0; } -else if (std::u16string_view::npos != rString.find(rad)) +else if (std::u16string_view::npos != rString.find(u"rad")) { nValue = basegfx::rad2deg(fValue) * 10.0; } __
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/source
sc/source/filter/xcl97/xcl97rec.cxx | 47 ++-- 1 file changed, 24 insertions(+), 23 deletions(-) New commits: commit 7508e997dfdbd636870bbe71cccd1dfbdfbf3421 Author: Szabolcs Toth AuthorDate: Sat Dec 12 10:33:20 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 13:58:46 2021 +0100 refactor for xlsx shape export Just a refactor, fewer lines, less computing capacity. Change-Id: I3c3446c2917e9b5d2f205dd5c0110821ecf11f56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107613 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 368c56144aab5794c39d5bc2082d9b3d6d7cebdb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111886 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 3bb0d2af4608..38ad870c4970 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1094,32 +1094,33 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& awt::Point aTopLeft= rShape->getPosition(); awt::Size aSize = rShape->getSize(); -// size is correct, but aTopLeft needs correction for rotated shapes +// There are a few cases where we must adjust these values SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rShape.get()); -sal_Int32 nRotation = pObj->GetRotateAngle(); -if ( pObj && nRotation != 0 && pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE ) +if (pObj) { -const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape -aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - (aSize.Width / 2); -aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - (aSize.Height / 2); -} - -uno::Reference< beans::XPropertySet > xShapeProperties(rShape, uno::UNO_QUERY_THROW); -uno::Any nRotProp = xShapeProperties->getPropertyValue("RotateAngle"); -sal_Int32 nRot = nRotProp.get(); - -if ((nRot >= 45 * 100 && nRot < 135 * 100) || (nRot >= 225 * 100 && nRot < 315 * 100)) -{ -// MSO changes the anchor positions at these angles and that does an extra 90 degrees -// rotation on our shapes, so we output it in such position that MSO -// can draw this shape correctly. - -sal_Int16 nHalfWidth = aSize.Width / 2; -sal_Int16 nHalfHeight = aSize.Height / 2; -aTopLeft.X = aTopLeft.X - nHalfHeight + nHalfWidth; -aTopLeft.Y = aTopLeft.Y - nHalfWidth + nHalfHeight; +sal_Int32 nRotation = pObj->GetRotateAngle(); +if (nRotation != 0) +{ +sal_Int16 nHalfWidth = aSize.Width / 2; +sal_Int16 nHalfHeight = aSize.Height / 2; +// aTopLeft needs correction for rotated customshapes +if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE) +{ +const tools::Rectangle& aSnapRect(pObj->GetSnapRect()); // bounding box of the rotated shape +aTopLeft.X = aSnapRect.getX() + (aSnapRect.GetWidth() / 2) - nHalfWidth; +aTopLeft.Y = aSnapRect.getY() + (aSnapRect.GetHeight() / 2) - nHalfHeight; +} -std::swap(aSize.Width, aSize.Height); +// MSO changes the anchor positions at these angles and that does an extra 90 degrees +// rotation on our shapes, so we output it in such position that MSO +// can draw this shape correctly. +if ((nRotation >= 45 * 100 && nRotation < 135 * 100) || (nRotation >= 225 * 100 && nRotation < 315 * 100)) +{ +aTopLeft.X = aTopLeft.X - nHalfHeight + nHalfWidth; +aTopLeft.Y = aTopLeft.Y - nHalfWidth + nHalfHeight; +std::swap(aSize.Width, aSize.Height); +} +} } tools::Rectangle aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height ); ___ 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
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 505965dd5d05e4711bf5b433b8af06e88e030962 Author: mert AuthorDate: Wed Mar 3 06:13:21 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 3 13:58:48 2021 +0100 Draw: Fix crash on multiple page selection on slidesorter Change-Id: Id7461b811d3445df895cf751153bd0dd81f09efc Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111864 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 82d3e50371eb..3edf068e9adb 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -215,6 +215,7 @@ SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase FrameworkHelper::msCenterPaneURL, FrameworkHelper::msFullScreenPaneURL, FrameworkHelper::msLeftImpressPaneURL, +FrameworkHelper::msLeftDrawPaneURL, OUString()}; try ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport14.cxx| 54 ++ sw/source/filter/ww8/ww8atr.cxx |5 3 files changed, 58 insertions(+), 1 deletion(-) New commits: commit 01a640ce6f2072e72bcea86695a7ab7cc96a13b6 Author: Justin Luth AuthorDate: Mon Feb 22 09:17:37 2021 +0200 Commit: Miklos Vajna CommitDate: Wed Mar 3 13:38:44 2021 +0100 tdf#114799 Char highlight: skip convert if highlight exists Don't create two w:highlight entries. This can easily occur on the endParagraph properties when the user has replaced the background color. A "none" highlight is added, the charShadingMarker is removed, and a new background color is added. So the new background tries to export as a highlight, even though the none-highlight overrides it. This depends on this bug's earlier commit, which added the context so that HasItem can even find the highlight. Change-Id: Ibfd6a3b9b94bdeb1fd9ec46fbb71ec825b09a680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111297 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx new file mode 100644 index ..697db308e3d1 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135774_numberingCRProps.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 01fc4eb37ac6..77fcb3fd1091 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include using namespace com::sun::star; @@ -857,6 +859,58 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testUserField) assertXPath(pXmlDoc, "//w:docVars/w:docVar", "val", "bar"); } +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testHighlightEdit_numbering) +{ +// Create the doc model. +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf135774_numberingCRProps.docx"; +loadURL(aURL, nullptr); + +// This only affects when saving as w:highlight - which is not the default since 7.0. +SvtFilterOptions& rOpt = SvtFilterOptions::Get(); +bool bWasExportToShade = rOpt.IsCharBackground2Shading(); +rOpt.SetCharBackground2Highlighting(); + +//Simulate a user editing the char background color of the paragraph 2 marker (CR) +uno::Reference properties(getParagraph(2), uno::UNO_QUERY); +uno::Sequence aListAutoFormat; +CPPUNIT_ASSERT(properties->getPropertyValue("ListAutoFormat") >>= aListAutoFormat); +comphelper::SequenceAsHashMap aMap(properties->getPropertyValue("ListAutoFormat")); +// change the background color to RES_CHRATR_BACKGROUND. +aMap["CharBackColor"] <<= static_cast(0xff00ff); +// Two attributes can affect character background. Highlight has priority, and is only there for MS compatibility, +// so clear any potential highlight set earlier, or override any coming via a style. +aMap["CharHighlight"] <<= static_cast(COL_TRANSPARENT); + +uno::Sequence aGrabBag; +aMap["CharInteropGrabBag"] >>= aGrabBag; +for (beans::PropertyValue& rProp : aGrabBag) +{ +// The shading is no longer defined from import, so clear that flag. +// BackColor 0xff00ff will now attempt to export as highlight, since we set that in SvtFilterOptions. +if (rProp.Name == "CharShadingMarker") +rProp.Value <<= false; +} +aMap["CharInteropGrabBag"] <<= aGrabBag; + +aMap >> aListAutoFormat; +properties->setPropertyValue("ListAutoFormat", uno::makeAny(aListAutoFormat)); + +// Export to docx. +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +utl::MediaDescriptor aMediaDescriptor; +aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); +xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); +mbExported = true; + +// Paragraph 2 should have only one w:highlight written per w:rPr. Without the fix, there were two. +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:rPr/w:highlight", "val", "none"); +// Visually, the "none" highlight means the bullet point should not have a character background. + +if (bWasExportToShade) +rOpt.SetCharBackground2Shading(); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132766, "tdf132766.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/numbering.xml"); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index f8c0ee826c60..5d3f4b8ae0d2 100644 --- a/sw/source/filter/ww8/ww8a
[Libreoffice-commits] core.git: oox/source
oox/source/drawingml/fillproperties.cxx | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) New commits: commit b90a67838e189f3aee6a50724c78c0a50d416970 Author: Gülşah Köse AuthorDate: Wed Feb 24 15:05:01 2021 +0300 Commit: Gülşah Köse CommitDate: Wed Mar 3 13:19:08 2021 +0100 Reset ShapeProperty priority and handle only crop case. With 2c96bd26ec488d865370fe9d394e7c4e228e05ab we changed the ShapeProperty priority uncessarily. Reset the priority as use FillBitmapName if supported. BlipFillProperties::moFillRect negative GraphicCrop values means stretched. BlipFillProperties::moClipRect positive GraphicCrop values means stretched. We add a control to handle only stretched cases. Change-Id: I2eb1233d0477acf093ada36b4cc29ff34f767037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111479 Tested-by: Jenkins Reviewed-by: Gülşah Köse diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 4d9fc2d8688b..754aa54ee2b8 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -111,6 +111,8 @@ void lclCalculateCropPercentage(uno::Reference const & xGraph aFillRect.Y2 = -nBottomPercentage; } +// Crops a piece of the bitmap. Takes negative aFillRect values. Negative values means "crop", +// positive values means "grow" bitmap with empty spaces. lclCropGraphic doesn't handle growing. Reference< XGraphic > lclCropGraphic(uno::Reference const & xGraphic, geometry::IntegerRectangle2D aFillRect) { ::Graphic aGraphic(xGraphic); @@ -777,11 +779,17 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 10 ); rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop); -if(bIsCustomShape && - ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0)) +bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0; +// Negative GraphicCrop values means "crop" here. +bool bNeedCrop = aGraphCrop.Left <= 0 && aGraphCrop.Right <= 0 && aGraphCrop.Top <= 0 && aGraphCrop.Bottom <= 0; + +if(bIsCustomShape && bHasCropValues && bNeedCrop) { xGraphic = lclCropGraphic(xGraphic, aFillRect); - rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic); +if (rPropMap.supportsProperty(ShapeProperty::FillBitmapName)) + rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic); +else + rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic); } } } @@ -885,14 +893,15 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe aGraphCrop.Bottom = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 10 ); rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop); -if(mbIsCustomShape && - ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0)) +bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0; +// Positive GraphicCrop values means "crop" here. +bool bNeedCrop = aGraphCrop.Left >= 0 && aGraphCrop.Right >= 0 && aGraphCrop.Top >= 0 && aGraphCrop.Bottom >= 0; + +if(mbIsCustomShape && bHasCropValues && bNeedCrop) { geometry::IntegerRectangle2D aCropRect = oClipRect; lclCalculateCropPercentage(xGraphic, aCropRect); xGraphic = lclCropGraphic(xGraphic, aCropRect); - -rPropMap.setProperty(PROP_FillBitmap, xGraphic); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/component/documentdigitalsignatures.cxx | 12 1 file changed, 8 insertions(+), 4 deletions(-) New commits: commit ca98e505cd69bf95d8ddb9387cf3f8e03ae4577d Author: Michael Stahl AuthorDate: Fri Feb 26 19:51:39 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:47:50 2021 +0100 xmlsecurity: fix crash in DocumentDigitalSignatures::isAuthorTrusted() If the argument is null. This function also should use EqualDistinguishedNames(). Change-Id: I4068aa94f9d9c422c96b394c82d3e28303774b0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111667 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index f3b74de8f752..6dfb9799190d 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -655,15 +655,19 @@ void DocumentDigitalSignatures::showCertificate( } sal_Bool DocumentDigitalSignatures::isAuthorTrusted( -const Reference< css::security::XCertificate >& Author ) +const Reference& xAuthor) { -OUString sSerialNum = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() ); +if (!xAuthor.is()) +{ +return false; +} +OUString sSerialNum = xmlsecurity::bigIntegerToNumericString(xAuthor->getSerialNumber()); std::vector< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors(); return std::any_of(aTrustedAuthors.begin(), aTrustedAuthors.end(), -[&Author, &sSerialNum](const SvtSecurityOptions::Certificate& rAuthor) { -return ( rAuthor.SubjectName == Author->getIssuerName() ) +[&xAuthor, &sSerialNum](const SvtSecurityOptions::Certificate& rAuthor) { +return xmlsecurity::EqualDistinguishedNames(rAuthor.SubjectName, xAuthor->getIssuerName()) && ( rAuthor.SerialNumber == sSerialNum ); }); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 90b725675c2964f4a151d802d9afedd8bc2ae1a7 Author: Michael Stahl AuthorDate: Fri Feb 26 19:25:18 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:47:30 2021 +0100 xmlsecurity: avoid exception in DigitalSignaturesDialog::getCertificate() Fallback to PGP if there's no X509 signing certificate because CheckX509Data() failed prevents the dialog from popping up. To avoid confusing the user in this situation, the dialog should show no certificate, which is already the case. Change-Id: I7f382165657f50723ac65a60309567e5b6c5ae1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111664 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 044676688389..e6ca398e3c80 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -723,7 +723,7 @@ uno::Reference DigitalSignaturesDialog::getCertificate(c xCert = xSecEnv->getCertificate(rInfo.GetSigningCertificate()->X509IssuerName, xmlsecurity::numericStringToBigInteger(rInfo.GetSigningCertificate()->X509SerialNumber)); } -if (!xCert.is() && xGpgSecEnv.is()) +if (!xCert.is() && xGpgSecEnv.is() && !rInfo.ouGpgKeyID.isEmpty()) xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger(u"") ); SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Certificate not found and can't be created!" ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svl svl/source sw/source xmlsecurity/inc xmlsecurity/source
include/svl/sigstruct.hxx | 13 +- svl/source/crypto/cryptosign.cxx | 10 - sw/source/core/edit/edfcol.cxx |4 xmlsecurity/inc/xsecctl.hxx|4 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 12 - xmlsecurity/source/helper/documentsignaturehelper.cxx | 25 ++-- xmlsecurity/source/helper/ooxmlsecexporter.cxx | 16 +- xmlsecurity/source/helper/ooxmlsecparser.cxx | 16 +- xmlsecurity/source/helper/pdfsignaturehelper.cxx |7 - xmlsecurity/source/helper/xmlsignaturehelper.cxx | 29 +++- xmlsecurity/source/helper/xsecctl.cxx | 59 + xmlsecurity/source/helper/xsecparser.cxx | 15 +- xmlsecurity/source/helper/xsecsign.cxx | 18 +- xmlsecurity/source/helper/xsecverify.cxx | 104 - 14 files changed, 220 insertions(+), 112 deletions(-) New commits: commit 5af5ea893bcb8a8eb472ac11133da10e5a604e66 Author: Michael Stahl AuthorDate: Wed Feb 24 19:18:51 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:47:04 2021 +0100 xmlsecurity: improve handling of multiple certificates per X509Data It turns out that an X509Data element can contain an arbitrary number of each of its child elements. How exactly certificates of an issuer chain may or should be distributed across multiple X509Data elements isn't terribly obvious. One thing that is clear is that any element that refers to or contains one particular certificate has to be a child of the same X509Data element, although in no particular order, so try to match the 2 such elements that the parser supports in XSecController::setX509Data(). Presumably the only way it makes sense to have multiple signing certificates is if they all contain the same key but are signed by different CAs. This case isn't handled currently; CheckX509Data() will complain there's not a single chain and validation of the certificates will fail. Change-Id: I9633a980b0c18d58dfce24fc59396a833498a77d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111500 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 4544fd182d90..77be7c48cae9 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -87,7 +87,7 @@ struct SignatureInformation sal_Int32 nSecurityId; css::xml::crypto::SecurityOperationStatus nStatus; SignatureReferenceInformations vSignatureReferenceInfors; -struct X509Data +struct X509CertInfo { OUString X509IssuerName; OUString X509SerialNumber; @@ -97,10 +97,21 @@ struct SignatureInformation /// The certificate owner (aka subject). OUString X509Subject; }; +typedef std::vector X509Data; // note: at parse time, it's unkown which one is the signing certificate; // ImplVerifySignatures() figures it out and puts it at the back std::vector X509Datas; +X509CertInfo const* GetSigningCertificate() const +{ +if (X509Datas.empty()) +{ +return nullptr; +} +assert(!X509Datas.back().empty()); +return & X509Datas.back().back(); +} + OUString ouGpgKeyID; OUString ouGpgCertificate; OUString ouGpgOwner; diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index f57b3e6639d8..8aa47ee36cba 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -2023,8 +2023,9 @@ bool Signing::Verify(const std::vector& aData, OUStringBuffer aBuffer; comphelper::Base64::encode(aBuffer, aDerCert); SignatureInformation::X509Data temp; -temp.X509Certificate = aBuffer.makeStringAndClear(); -temp.X509Subject = OUString(pCertificate->subjectName, PL_strlen(pCertificate->subjectName), RTL_TEXTENCODING_UTF8); +temp.emplace_back(); +temp.back().X509Certificate = aBuffer.makeStringAndClear(); +temp.back().X509Subject = OUString(pCertificate->subjectName, PL_strlen(pCertificate->subjectName), RTL_TEXTENCODING_UTF8); rInformation.X509Datas.clear(); rInformation.X509Datas.emplace_back(temp); } @@ -2206,8 +2207,9 @@ bool Signing::Verify(const std::vector& aData, OUStringBuffer aBuffer; comphelper::Base64::encode(aBuffer, aDerCert); SignatureInformation::X509Data temp; -temp.X509Certificate = aBuffer.makeStringAndClear(); -temp.X509Subject = GetSubjectName(pSignerCertContext); +temp.emplace_back(); +temp.back().X509Certificate = aBuffer.makeStringAndClear(); +temp.back().X509Subject = GetSubjectName(pSignerCertContext); rInformation.X509Datas.clear(); rInformation.X509Datas.emplace_back(temp);
[Libreoffice-commits] core.git: include/svl svl/source sw/source xmlsecurity/inc xmlsecurity/source
include/svl/sigstruct.hxx | 21 - svl/source/crypto/cryptosign.cxx | 14 sw/source/core/edit/edfcol.cxx |3 xmlsecurity/inc/xmlsignaturehelper.hxx | 12 xmlsecurity/inc/xsecctl.hxx| 12 xmlsecurity/source/component/documentdigitalsignatures.cxx | 42 +- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 13 xmlsecurity/source/helper/documentsignaturehelper.cxx | 58 ++- xmlsecurity/source/helper/documentsignaturemanager.cxx | 12 xmlsecurity/source/helper/ooxmlsecexporter.cxx | 18 - xmlsecurity/source/helper/ooxmlsecparser.cxx | 16 - xmlsecurity/source/helper/pdfsignaturehelper.cxx |7 xmlsecurity/source/helper/xmlsignaturehelper.cxx | 146 ++ xmlsecurity/source/helper/xsecctl.cxx | 69 ++-- xmlsecurity/source/helper/xsecparser.cxx | 137 - xmlsecurity/source/helper/xsecsign.cxx | 28 + xmlsecurity/source/helper/xsecverify.cxx | 80 +++-- xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx |2 xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx |3 19 files changed, 485 insertions(+), 208 deletions(-) New commits: commit 9e82509b09f5fe2eb77bcdb8fd193c71923abb67 Author: Michael Stahl AuthorDate: Fri Feb 19 22:04:33 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:46:43 2021 +0100 xmlsecurity: improve handling of multiple X509Data elements Combine everything related to a certificate in a new struct X509Data. The CertDigest is not actually written in the X509Data element but in xades:Cert, so try to find the matching entry in XSecController::setX509CertDigest(). There was a confusing interaction with PGP signatures, where ouGpgKeyID was used for import, but export wrote the value from ouCertDigest instead - this needed fixing. The main point of this is enforcing a constraint from xmldsig-core 4.5.4: All certificates appearing in an X509Data element MUST relate to the validation key by either containing it or being part of a certification chain that terminates in a certificate containing the validation key. Change-Id: I5254aa393f8e7172da59709923e4bbcd625ec713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111254 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index cc0324fdfcca..4544fd182d90 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -87,9 +87,19 @@ struct SignatureInformation sal_Int32 nSecurityId; css::xml::crypto::SecurityOperationStatus nStatus; SignatureReferenceInformations vSignatureReferenceInfors; -OUString ouX509IssuerName; -OUString ouX509SerialNumber; -OUString ouX509Certificate; +struct X509Data +{ +OUString X509IssuerName; +OUString X509SerialNumber; +OUString X509Certificate; +/// OOXML certificate SHA-256 digest, empty for ODF except when doing XAdES signature. +OUString CertDigest; +/// The certificate owner (aka subject). +OUString X509Subject; +}; +// note: at parse time, it's unkown which one is the signing certificate; +// ImplVerifySignatures() figures it out and puts it at the back +std::vector X509Datas; OUString ouGpgKeyID; OUString ouGpgCertificate; @@ -122,8 +132,6 @@ struct SignatureInformation OUString ouDescription; /// The Id attribute of the element that contains the . OUString ouDescriptionPropertyId; -/// OOXML certificate SHA-256 digest, empty for ODF except when doing XAdES signature. -OUString ouCertDigest; /// Valid and invalid signature line images css::uno::Reference aValidSignatureImage; css::uno::Reference aInvalidSignatureImage; @@ -138,9 +146,6 @@ struct SignatureInformation /// For PDF: the byte range doesn't cover the whole document. bool bPartialDocumentSignature; -/// The certificate owner (aka subject). -OUString ouSubject; - svl::crypto::SignatureMethodAlgorithm eAlgorithmID; SignatureInformation( sal_Int32 nId ) diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index ac2f6a0ee24b..f57b3e6639d8 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -2022,8 +2022,11 @@ bool Signing::Verify(const std::vector& aData, aDerCert[i] = pCertificate->derCert.data[i]; OUStringBuffer aBuffer; comphelper::Base64::encode(aBuffer, aDerCert); -rInformation.ouX509Certificate = aBuffer.makeStringAndClear(); -rInformation.
[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source
xmlsecurity/inc/biginteger.hxx|3 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 47 ++ xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx | 25 + 3 files changed, 75 insertions(+) New commits: commit 1d3da3486d827dd5e7a3bf1c7a533f5aa9860e42 Author: Michael Stahl AuthorDate: Thu Feb 25 14:17:48 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:46:23 2021 +0100 xmlsecurity: add EqualDistinguishedNames() Change-Id: I1222658522e25b916010817f847685c20b1cf5c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111545 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/inc/biginteger.hxx b/xmlsecurity/inc/biginteger.hxx index ac411c2e53b7..c15b54de6229 100644 --- a/xmlsecurity/inc/biginteger.hxx +++ b/xmlsecurity/inc/biginteger.hxx @@ -34,6 +34,9 @@ namespace xmlsecurity XSECXMLSEC_DLLPUBLIC OUString bigIntegerToNumericString(const css::uno::Sequence& serial); XSECXMLSEC_DLLPUBLIC css::uno::Sequence numericStringToBigInteger(std::u16string_view serialNumber); + +XSECXMLSEC_DLLPUBLIC bool EqualDistinguishedNames(std::u16string_view rName1, + std::u16string_view rName2); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 1672a21c7868..d9d45f5e7062 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -26,6 +26,7 @@ #include #include "x509certificate_mscryptimpl.hxx" #include +#include #include "sanextension_mscryptimpl.hxx" #include "oid.hxx" @@ -651,4 +652,50 @@ Sequence SAL_CALL X509Certificate_MSCryptImpl::getSupportedServiceName return { OUString() }; } +namespace xmlsecurity { + +static bool EncodeDistinguishedName(std::u16string_view const rName, CERT_NAME_BLOB & rBlob) +{ +LPCWSTR pszError; +if (!CertStrToNameW(X509_ASN_ENCODING, +reinterpret_cast(rName.data()), CERT_X500_NAME_STR, +nullptr, nullptr, &rBlob.cbData, &pszError)) +{ +SAL_INFO("xmlsecurity.xmlsec", "CertStrToNameW failed: " << WindowsErrorString(GetLastError()) << "; " << reinterpret_cast(pszError)); +return false; +} +rBlob.pbData = new BYTE[rBlob.cbData]; +if (!CertStrToNameW(X509_ASN_ENCODING, +reinterpret_cast(rName.data()), CERT_X500_NAME_STR, +nullptr, rBlob.pbData, &rBlob.cbData, &pszError)) +{ +SAL_INFO("xmlsecurity.xmlsec", "CertStrToNameW failed: " << WindowsErrorString(GetLastError()) << "; " << reinterpret_cast(pszError)); +return false; +} +return true; +} + +bool EqualDistinguishedNames( +std::u16string_view const rName1, std::u16string_view const rName2) +{ +CERT_NAME_BLOB blob1; +if (!EncodeDistinguishedName(rName1, blob1)) +{ +return false; +} +CERT_NAME_BLOB blob2; +if (!EncodeDistinguishedName(rName2, blob2)) +{ +delete[] blob1.pbData; +return false; +} +bool const ret(CertCompareCertificateName(X509_ASN_ENCODING, +&blob1, &blob2) == TRUE); +delete[] blob2.pbData; +delete[] blob1.pbData; +return ret; +} + +} // namespace xmlsecurity + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 15ec8a346895..940656193e94 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -31,6 +31,7 @@ #include #include "x509certificate_nssimpl.hxx" +#include #include #include "sanextension_nssimpl.hxx" @@ -533,4 +534,28 @@ sal_Bool SAL_CALL X509Certificate_NssImpl::supportsService(const OUString& servi /* XServiceInfo */ Sequence SAL_CALL X509Certificate_NssImpl::getSupportedServiceNames() { return { OUString() }; } +namespace xmlsecurity { + +bool EqualDistinguishedNames( +std::u16string_view const rName1, std::u16string_view const rName2) +{ +CERTName *const pName1(CERT_AsciiToName(OUStringToOString(rName1, RTL_TEXTENCODING_UTF8).getStr())); +if (pName1 == nullptr) +{ +return false; +} +CERTName *const pName2(CERT_AsciiToName(OUStringToOString(rName2, RTL_TEXTENCODING_UTF8).getStr())); +if (pName2 == nullptr) +{ +CERT_DestroyName(pName1); +return false; +} +bool const ret(CERT_CompareName(pName1, pName2) == SECEqual); +CERT_DestroyName(pName2); +CERT_DestroyName(pName1); +return ret; +} + +} // namespace xmlsecurity + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits
[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source
xmlsecurity/inc/xsecctl.hxx |1 xmlsecurity/source/helper/xsecparser.cxx | 290 +-- xmlsecurity/source/helper/xsecparser.hxx |1 xmlsecurity/source/helper/xsecverify.cxx | 19 ++ 4 files changed, 221 insertions(+), 90 deletions(-) New commits: commit 2bfa00e6bf4b2a310a8b8f5060acec85b5f7a3ce Author: Michael Stahl AuthorDate: Fri Feb 19 17:56:21 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:46:01 2021 +0100 xmlsecurity: ignore elements in ds:Object that aren't signed Change-Id: I2e4411f0907b89e7ad6e0185cee8f12b600515e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111253 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx index a9f65c3e1a63..4576af6ee635 100644 --- a/xmlsecurity/inc/xsecctl.hxx +++ b/xmlsecurity/inc/xsecctl.hxx @@ -251,6 +251,7 @@ private: /// Sets algorithm from . void setSignatureMethod(svl::crypto::SignatureMethodAlgorithm eAlgorithmID); void switchGpgSignature(); +bool haveReferenceForId(std::u16string_view rId) const; void addReference( const OUString& ouUri, sal_Int32 nDigestID, diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index abad9a473d1a..fe138c916448 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -95,6 +95,42 @@ auto XSecParser::Context::CreateChildContext( return std::make_unique(m_rParser, std::move(pOldNamespaceMap)); } +/** +note: anything in ds:Object should be trusted *only* if there is a ds:Reference + to it so it is signed (exception: the xades:EncapsulatedX509Certificate). + ds:SignedInfo precedes all ds:Object. + + There may be multiple ds:Signature for purpose of counter-signatures + but the way XAdES describes these, only the ds:SignatureValue element + would be referenced, so requiring a ds:Reference for anything in + ds:Object shouldn't cause issues. + */ +class XSecParser::ReferencedContextImpl +: public XSecParser::Context +{ +protected: +bool m_isReferenced; + +public: +ReferencedContextImpl(XSecParser & rParser, +std::unique_ptr pOldNamespaceMap, +bool const isReferenced) +: XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +, m_isReferenced(isReferenced) +{ +} + +OUString CheckIdAttrReferenced(css::uno::Reference const& xAttrs) +{ +OUString const id(m_rParser.HandleIdAttr(xAttrs)); +if (!id.isEmpty() && m_rParser.m_pXSecController->haveReferenceForId(id)) +{ +m_isReferenced = true; +} +return id; +} +}; + class XSecParser::LoPGPOwnerContext : public XSecParser::Context { @@ -228,21 +264,29 @@ class XSecParser::DsX509CertificateContext }; class XSecParser::DsX509SerialNumberContext -: public XSecParser::Context +: public XSecParser::ReferencedContextImpl { private: OUString m_Value; public: DsX509SerialNumberContext(XSecParser & rParser, -std::unique_ptr pOldNamespaceMap) -: XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +std::unique_ptr pOldNamespaceMap, +bool const isReferenced) +: ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced) { } virtual void EndElement() override { -m_rParser.m_pXSecController->setX509SerialNumber(m_Value); +if (m_isReferenced) +{ +m_rParser.m_pXSecController->setX509SerialNumber(m_Value); +} +else +{ +SAL_INFO("xmlsecurity.helper", "ignoring unsigned X509SerialNumber"); +} } virtual void Characters(OUString const& rChars) override @@ -252,21 +296,29 @@ class XSecParser::DsX509SerialNumberContext }; class XSecParser::DsX509IssuerNameContext -: public XSecParser::Context +: public XSecParser::ReferencedContextImpl { private: OUString m_Value; public: DsX509IssuerNameContext(XSecParser & rParser, -std::unique_ptr pOldNamespaceMap) -: XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +std::unique_ptr pOldNamespaceMap, +bool const isReferenced) +: ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced) { } virtual void EndElement() override { -m_rParser.m_pXSecController->setX509IssuerName(m_Value); +if (m_isReferenced) +{ +m_rParser.m_pXSecController->setX509IssuerName(m_Value); +} +else +
[Libreoffice-commits] core.git: include/svl xmlsecurity/inc xmlsecurity/source
include/svl/sigstruct.hxx|5 +- xmlsecurity/inc/xsecctl.hxx |5 -- xmlsecurity/source/helper/ooxmlsecparser.cxx |4 - xmlsecurity/source/helper/xsecctl.cxx|2 xmlsecurity/source/helper/xsecparser.cxx | 58 --- xmlsecurity/source/helper/xsecsign.cxx |4 - xmlsecurity/source/helper/xsecverify.cxx | 33 --- 7 files changed, 56 insertions(+), 55 deletions(-) New commits: commit d2a345e1163616fe3201ef1d6c758e2e819214e0 Author: Michael Stahl AuthorDate: Fri Feb 19 13:59:31 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:45:39 2021 +0100 xmlsecurity: remove XSecController::setPropertyId() Change-Id: Iab5a59af73048765ead718fe941d6dec933a7060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111252 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 26e26a42022c..cc0324fdfcca 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -101,6 +101,7 @@ struct SignatureInformation // XAdES EncapsulatedX509Certificate values std::set maEncapsulatedX509Certificates; +OUString ouSignatureId; // signature may contain multiple time stamps - check they're consistent bool hasInconsistentSigningTime = false; //We also keep the date and time as string. This is done when this @@ -115,8 +116,8 @@ struct SignatureInformation //and the converted time is written back, then the string looks different //and the signature is broken. OUString ouDateTime; -OUString ouSignatureId; -OUString ouPropertyId; +/// The Id attribute of the element that contains the . +OUString ouDateTimePropertyId; /// Characters of the element inside the signature. OUString ouDescription; /// The Id attribute of the element that contains the . diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx index a3551d4218b3..a9f65c3e1a63 100644 --- a/xmlsecurity/inc/xsecctl.hxx +++ b/xmlsecurity/inc/xsecctl.hxx @@ -270,8 +270,8 @@ private: void setGpgCertificate( OUString const & ouGpgCert ); void setGpgOwner( OUString const & ouGpgOwner ); -void setDate( OUString const & ouDate ); -void setDescription(const OUString& rDescription); +void setDate(OUString const& rId, OUString const& ouDate); +void setDescription(OUString const& rId, OUString const& rDescription); void setCertDigest(const OUString& rCertDigest); void setValidSignatureImage(const OUString& rValidSigImg); void setInvalidSignatureImage(const OUString& rInvalidSigImg); @@ -282,7 +282,6 @@ public: private: void setId( OUString const & ouId ); -void setPropertyId( OUString const & ouPropertyId ); css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToRead( sal_Int32 nSecurityId ); diff --git a/xmlsecurity/source/helper/ooxmlsecparser.cxx b/xmlsecurity/source/helper/ooxmlsecparser.cxx index c22e8c2261bf..a200de60c07a 100644 --- a/xmlsecurity/source/helper/ooxmlsecparser.cxx +++ b/xmlsecurity/source/helper/ooxmlsecparser.cxx @@ -192,12 +192,12 @@ void SAL_CALL OOXMLSecParser::endElement(const OUString& rName) } else if (rName == "mdssi:Value") { -m_pXSecController->setDate(m_aMdssiValue); +m_pXSecController->setDate("", m_aMdssiValue); m_bInMdssiValue = false; } else if (rName == "SignatureComments") { -m_pXSecController->setDescription(m_aSignatureComments); +m_pXSecController->setDescription("", m_aSignatureComments); m_bInSignatureComments = false; } else if (rName == "X509IssuerName") diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 697d84a8e2a0..43b74e2c9250 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -815,7 +815,7 @@ void XSecController::exportSignature( pAttributeList = new SvXMLAttributeList(); pAttributeList->AddAttribute( "Id", -signatureInfo.ouPropertyId); +signatureInfo.ouDateTimePropertyId); pAttributeList->AddAttribute( "Target", "#" + signatureInfo.ouSignatureId); diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index 24f5f33bff58..abad9a473d1a 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -986,7 +986,7 @@ class XSecParser::XadesSigningTimeContext virtual void EndElement() override { -m_rParser.m_pXSecController->setDate(m_Value); +m_rParser.m_pXSecController->setDate("", m_Value); } virtual void Characters(OUString const& rChars) ov
[Libreoffice-commits] core.git: include/svl xmlsecurity/source
include/svl/sigstruct.hxx|2 ++ xmlsecurity/source/helper/xsecparser.cxx | 31 --- xmlsecurity/source/helper/xsecparser.hxx |6 -- xmlsecurity/source/helper/xsecverify.cxx |6 ++ 4 files changed, 16 insertions(+), 29 deletions(-) New commits: commit 4ab8d9c09a5873ca0aea56dafa1ab34758d52ef7 Author: Michael Stahl AuthorDate: Thu Feb 18 19:22:31 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:45:15 2021 +0100 xmlsecurity: XSecParser confused about multiple timestamps LO writes timestamp both to dc:date and xades:SigningTime elements. The parser tries to avoid reading multiple dc:date, preferring the first one, but doesn't care about multiple xades:SigningTime, for undocumented reasons. Ideally something should check all read values for consistency. Change-Id: Ic018ee89797a1c8a4f870ae102af48006de930ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/60 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 04cb45cbe18f..26e26a42022c 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -101,6 +101,8 @@ struct SignatureInformation // XAdES EncapsulatedX509Certificate values std::set maEncapsulatedX509Certificates; +// signature may contain multiple time stamps - check they're consistent +bool hasInconsistentSigningTime = false; //We also keep the date and time as string. This is done when this //structure is created as a result of a XML signature being read. //When then a signature is added or another removed, then the original diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index 5166464f6f1d..24f5f33bff58 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -974,6 +974,9 @@ class XSecParser::XadesSigningCertificateContext class XSecParser::XadesSigningTimeContext : public XSecParser::Context { +private: +OUString m_Value; + public: XadesSigningTimeContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -981,20 +984,14 @@ class XSecParser::XadesSigningTimeContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rParser.m_ouDate.clear(); -} - virtual void EndElement() override { -m_rParser.m_pXSecController->setDate( m_rParser.m_ouDate ); +m_rParser.m_pXSecController->setDate(m_Value); } virtual void Characters(OUString const& rChars) override { -m_rParser.m_ouDate += rChars; +m_Value += rChars; } }; @@ -1100,7 +1097,7 @@ class XSecParser::DcDateContext : public XSecParser::Context { private: -bool m_isIgnore = false; +OUString m_Value; public: DcDateContext(XSecParser & rParser, @@ -1109,26 +1106,14 @@ class XSecParser::DcDateContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_isIgnore = !m_rParser.m_ouDate.isEmpty(); -} - virtual void EndElement() override { -if (!m_isIgnore) -{ -m_rParser.m_pXSecController->setDate( m_rParser.m_ouDate ); -} +m_rParser.m_pXSecController->setDate(m_Value); } virtual void Characters(OUString const& rChars) override { -if (!m_isIgnore) -{ -m_rParser.m_ouDate += rChars; -} +m_Value += rChars; } }; diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx index b99a170b87c3..e146340612da 100644 --- a/xmlsecurity/source/helper/xsecparser.hxx +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -97,12 +97,6 @@ private: class DsSignatureContext; class DsigSignaturesContext; -/* - * the following members are used to reserve the signature information, - * including X509IssuerName, X509SerialNumber, and X509Certificate,etc. - */ -OUString m_ouDate; - std::stack> m_ContextStack; std::unique_ptr m_pNamespaceMap; diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx index ec8d4f34f6b3..9a50207e733c 100644 --- a/xmlsecurity/source/helper/xsecverify.cxx +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -325,6 +325,12 @@ void XSecController::setDate( OUString const & ouDate ) return; } InternalSignatureInformation &isi = m_vInternalSignatureInformations.back(); +// there may be multiple timestamps in a signature - check them for consistency +if (!isi.signatureInfor
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/helper/xsecparser.cxx | 109 +-- xmlsecurity/source/helper/xsecparser.hxx | 14 --- 2 files changed, 63 insertions(+), 60 deletions(-) New commits: commit cfeb89a758b5f0ec406f0d72444e52ed2f47b85e Author: Michael Stahl AuthorDate: Thu Feb 18 19:03:56 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:44:42 2021 +0100 xmlsecurity: move XSecParser Reference state into contexts Change-Id: Ia2da9bf1329a856629f60ab64b74d5ee79077076 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/59 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index b8c5581bad5c..5166464f6f1d 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -425,10 +425,15 @@ class XSecParser::DsDigestValueContext class XSecParser::DsDigestMethodContext : public XSecParser::Context { +private: +sal_Int32 & m_rReferenceDigestID; + public: DsDigestMethodContext(XSecParser & rParser, -std::unique_ptr pOldNamespaceMap) +std::unique_ptr pOldNamespaceMap, +sal_Int32 & rReferenceDigestID) : XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +, m_rReferenceDigestID(rReferenceDigestID) { } @@ -445,13 +450,13 @@ class XSecParser::DsDigestMethodContext && ouAlgorithm != ALGO_XMLDSIGSHA512, "xmlsecurity.helper", "Algorithm neither SHA1, SHA256 nor SHA512"); if (ouAlgorithm == ALGO_XMLDSIGSHA1) -m_rParser.m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1; +m_rReferenceDigestID = css::xml::crypto::DigestID::SHA1; else if (ouAlgorithm == ALGO_XMLDSIGSHA256) -m_rParser.m_nReferenceDigestID = css::xml::crypto::DigestID::SHA256; +m_rReferenceDigestID = css::xml::crypto::DigestID::SHA256; else if (ouAlgorithm == ALGO_XMLDSIGSHA512) -m_rParser.m_nReferenceDigestID = css::xml::crypto::DigestID::SHA512; +m_rReferenceDigestID = css::xml::crypto::DigestID::SHA512; else -m_rParser.m_nReferenceDigestID = 0; +m_rReferenceDigestID = 0; } } }; @@ -459,28 +464,29 @@ class XSecParser::DsDigestMethodContext class XSecParser::DsTransformContext : public XSecParser::Context { +private: +bool & m_rIsC14N; + public: DsTransformContext(XSecParser & rParser, -std::unique_ptr pOldNamespaceMap) +std::unique_ptr pOldNamespaceMap, +bool & rIsC14N) : XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +, m_rIsC14N(rIsC14N) { } virtual void StartElement( css::uno::Reference const& xAttrs) override { -if (m_rParser.m_bReferenceUnresolved) -{ -OUString ouAlgorithm = xAttrs->getValueByName("Algorithm"); +OUString ouAlgorithm = xAttrs->getValueByName("Algorithm"); -if (ouAlgorithm == ALGO_C14N) -/* - * a xml stream - */ -{ -m_rParser.m_pXSecController->addStreamReference( m_rParser.m_currentReferenceURI, false, m_rParser.m_nReferenceDigestID ); -m_rParser.m_bReferenceUnresolved = false; -} +if (ouAlgorithm == ALGO_C14N) +/* + * a xml stream + */ +{ +m_rIsC14N = true; } } }; @@ -488,10 +494,15 @@ class XSecParser::DsTransformContext class XSecParser::DsTransformsContext : public XSecParser::Context { +private: +bool & m_rIsC14N; + public: DsTransformsContext(XSecParser & rParser, -std::unique_ptr pOldNamespaceMap) +std::unique_ptr pOldNamespaceMap, +bool & rIsC14N) : XSecParser::Context(rParser, std::move(pOldNamespaceMap)) +, m_rIsC14N(rIsC14N) { } @@ -501,7 +512,7 @@ class XSecParser::DsTransformsContext { if (nNamespace == XML_NAMESPACE_DS && rName == "Transform") { -return std::make_unique(m_rParser, std::move(pOldNamespaceMap)); +return std::make_unique(m_rParser, std::move(pOldNamespaceMap), m_rIsC14N); } return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName); } @@ -510,6 +521,15 @@ class XSecParser::DsTransformsContext class XSecParser::DsReferenceContext : publi
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/helper/xsecparser.cxx | 153 +-- xmlsecurity/source/helper/xsecparser.hxx | 14 -- 2 files changed, 65 insertions(+), 102 deletions(-) New commits: commit 59df9e70ce1a7ec797b836bda7f9642912febc53 Author: Michael Stahl AuthorDate: Thu Feb 18 18:23:42 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:44:15 2021 +0100 xmlsecurity: move XSecParser state into contexts Change-Id: Ic73b647798a91bd253d93970e2a9a3e11b208a1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/58 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index 1f2045c5d0e3..b8c5581bad5c 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -98,6 +98,9 @@ auto XSecParser::Context::CreateChildContext( class XSecParser::LoPGPOwnerContext : public XSecParser::Context { +private: +OUString m_Value; + public: LoPGPOwnerContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -105,26 +108,23 @@ class XSecParser::LoPGPOwnerContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rParser.m_ouGpgOwner.clear(); -} - virtual void EndElement() override { -m_rParser.m_pXSecController->setGpgOwner( m_rParser.m_ouGpgOwner ); +m_rParser.m_pXSecController->setGpgOwner(m_Value); } virtual void Characters(OUString const& rChars) override { -m_rParser.m_ouGpgOwner += rChars; +m_Value += rChars; } }; class XSecParser::DsPGPKeyPacketContext : public XSecParser::Context { +private: +OUString m_Value; + public: DsPGPKeyPacketContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -132,26 +132,23 @@ class XSecParser::DsPGPKeyPacketContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rParser.m_ouGpgCertificate.clear(); -} - virtual void EndElement() override { -m_rParser.m_pXSecController->setGpgCertificate( m_rParser.m_ouGpgCertificate ); +m_rParser.m_pXSecController->setGpgCertificate(m_Value); } virtual void Characters(OUString const& rChars) override { -m_rParser.m_ouGpgCertificate += rChars; +m_Value += rChars; } }; class XSecParser::DsPGPKeyIDContext : public XSecParser::Context { +private: +OUString m_Value; + public: DsPGPKeyIDContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -159,20 +156,14 @@ class XSecParser::DsPGPKeyIDContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rParser.m_ouGpgKeyID.clear(); -} - virtual void EndElement() override { -m_rParser.m_pXSecController->setGpgKeyID( m_rParser.m_ouGpgKeyID ); +m_rParser.m_pXSecController->setGpgKeyID(m_Value); } virtual void Characters(OUString const& rChars) override { -m_rParser.m_ouGpgKeyID += rChars; +m_Value += rChars; } }; @@ -215,6 +206,9 @@ class XSecParser::DsPGPDataContext class XSecParser::DsX509CertificateContext : public XSecParser::Context { +private: +OUString m_Value; + public: DsX509CertificateContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -222,26 +216,23 @@ class XSecParser::DsX509CertificateContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rParser.m_ouX509Certificate.clear(); -} - virtual void EndElement() override { -m_rParser.m_pXSecController->setX509Certificate( m_rParser.m_ouX509Certificate ); +m_rParser.m_pXSecController->setX509Certificate(m_Value); } virtual void Characters(OUString const& rChars) override { -m_rParser.m_ouX509Certificate += rChars; +m_Value += rChars; } }; class XSecParser::DsX509SerialNumberContext : public XSecParser::Context { +private: +OUString m_Value; + public: DsX509SerialNumberContext(XSecParser & rParser, std::unique_ptr pOldNamespaceMap) @@ -249,26 +240,23 @@ class XSecParser::DsX509SerialNumberContext { } -virtual void StartElement( -css::uno::Reference const& /*xAttrs*/) override -{ -m_rPars
[Libreoffice-commits] core.git: include/xmloff xmloff/source xmlsecurity/source
include/xmloff/xmlimp.hxx|6 include/xmloff/xmlnamespace.hxx |7 include/xmloff/xmltoken.hxx | 13 xmloff/source/core/xmlimp.cxx| 23 xmloff/source/core/xmltoken.cxx | 13 xmloff/source/token/tokens.txt | 10 xmlsecurity/source/helper/xsecparser.cxx | 1630 --- xmlsecurity/source/helper/xsecparser.hxx | 71 - 8 files changed, 1426 insertions(+), 347 deletions(-) New commits: commit 12b15be8f4f930a04d8056b9219ac969b42a9784 Author: Michael Stahl AuthorDate: Fri Feb 12 16:42:51 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 12:43:36 2021 +0100 xmlsecurity: replace XSecParser implementation Implement Namespaces in XML and follow xmldsig-core and XAdES schemas. Change-Id: I03537b51bb757ecbfa63a826b38de543c70ba032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110833 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 2d5013e2fe4f..12a81a32888f 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -239,8 +239,12 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< static void initializeNamespaceMaps(); void registerNamespaces(); -std::unique_ptr processNSAttributes( +public: +static std::unique_ptr processNSAttributes( +std::unique_ptr & rpNamespaceMap, +SvXMLImport *const pImport, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); +private: css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator; diff --git a/include/xmloff/xmlnamespace.hxx b/include/xmloff/xmlnamespace.hxx index d45832f02d81..cabdcc7578e2 100644 --- a/include/xmloff/xmlnamespace.hxx +++ b/include/xmloff/xmlnamespace.hxx @@ -69,6 +69,13 @@ constexpr sal_uInt16 XML_NAMESPACE_TCD = 34; // text conversion di constexpr sal_uInt16 XML_NAMESPACE_DLG = 35; constexpr sal_uInt16 XML_NAMESPACE_REPORT = 36; constexpr sal_uInt16 XML_NAMESPACE_VERSIONS_LIST = 37; +// OOo extension digital signatures, used in ODF 1.1 +constexpr sal_uInt16 XML_NAMESPACE_DSIG_OOO =38; +// ODF 1.2 digital signature namespaces +constexpr sal_uInt16 XML_NAMESPACE_DSIG =39; +constexpr sal_uInt16 XML_NAMESPACE_DS = 40; +constexpr sal_uInt16 XML_NAMESPACE_XADES132 =41; +constexpr sal_uInt16 XML_NAMESPACE_XADES141 =42; // namespaces for ODF extended formats constexpr sal_uInt16 XML_NAMESPACE_EXT_BASE = 50; diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index bc18f6230293..12a0632a5af7 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -135,6 +135,19 @@ namespace xmloff::token { XML_NP_GRDDL, XML_N_GRDDL, +// OOo extension digital signatures, used in ODF 1.1 +XML_NP_DSIG_OOO, +XML_N_DSIG_OOO, +// ODF 1.2 digital signatures +XML_NP_DSIG, +XML_N_DSIG, +XML_NP_DS, +XML_N_DS, +XML_NP_XADES132, +XML_N_XADES132, +XML_NP_XADES141, +XML_N_XADES141, + // ODF Enhanced namespaces XML_NP_OFFICE_EXT, XML_N_OFFICE_EXT, diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 8c4b02f50754..6d7b0805ddfb 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -671,6 +671,8 @@ void SAL_CALL SvXMLImport::endDocument() } std::unique_ptr SvXMLImport::processNSAttributes( +std::unique_ptr & rpNamespaceMap, +SvXMLImport *const pImport, // TODO??? const uno::Reference< xml::sax::XAttributeList >& xAttrList) { std::unique_ptr pRewindMap; @@ -678,12 +680,13 @@ std::unique_ptr SvXMLImport::processNSAttributes( for( sal_Int16 i=0; i < nAttrCount; i++ ) { const OUString& rAttrName = xAttrList->getNameByIndex( i ); -if ( rAttrName == "office:version" && !mpImpl->mxODFVersion ) +if (pImport && rAttrName == "office:version" && !pImport->mpImpl->mxODFVersion) { -mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); +pImport->mpImpl->mxODFVersion = xAttrList->getValueByIndex( i ); // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2 -if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( *mpImpl->mxODFVersion ) ) +if (pImport->mpImpl->mStreamName == "content.xml" +&& !pImport->IsODFVersionConsistent(*pImport->mpImpl->mxODFVersion)) { throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!", uno::Reference< uno::XInterface >(), @@ -697,8 +700,8 @@ std::unique_ptr SvXMLImport::processNSAttributes( {
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/inc vcl/jsdialog
vcl/inc/jsdialog/jsdialogbuilder.hxx |2 ++ vcl/jsdialog/jsdialogbuilder.cxx |6 ++ 2 files changed, 8 insertions(+) New commits: commit 7fd50e241a73a612a368873a0002a1ba8d6bcd49 Author: Szymon Kłos AuthorDate: Mon Mar 1 10:01:42 2021 +0100 Commit: Henry Castro CommitDate: Wed Mar 3 12:35:24 2021 +0100 jsdialog: update on treeview clear Change-Id: I4152e7581ae9172e77474c7f62bd42351636793e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111733 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 9bfdb11c2332..cb4a46ada304 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -491,6 +491,8 @@ public: virtual void remove(int pos) override; virtual void remove(const weld::TreeIter& rIter) override; +virtual void clear() override; + void drag_start(); void drag_end(); }; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 6bcf259423be..518a1ca25cf3 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1131,6 +1131,12 @@ void JSTreeView::remove(const weld::TreeIter& rIter) sendUpdate(); } +void JSTreeView::clear() +{ +SalInstanceTreeView::clear(); +sendUpdate(); +} + void JSTreeView::expand_row(const weld::TreeIter& rIter) { SalInstanceTreeView::expand_row(rIter); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/inc vcl/jsdialog
vcl/inc/jsdialog/jsdialogbuilder.hxx |1 + vcl/jsdialog/jsdialogbuilder.cxx |6 ++ 2 files changed, 7 insertions(+) New commits: commit 8a5b110ec48629bbfe58f6e76803f27fe2f69882 Author: Szymon Kłos AuthorDate: Mon Jan 25 15:04:17 2021 +0100 Commit: Szymon Kłos CommitDate: Wed Mar 3 12:29:44 2021 +0100 jsdialog: missing method for treeview Change-Id: Ice358bb9d79cc0e257e03fba4ef9df1397284158 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109971 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111840 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 71ad8aea29c7..462b1cfeb1ef 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -447,6 +447,7 @@ public: using SalInstanceTreeView::set_toggle; /// pos is used differently here, it defines how many steps of iterator we need to perform to take entry virtual void set_toggle(int pos, TriState eState, int col = -1) override; +virtual void set_toggle(const weld::TreeIter& rIter, TriState bOn, int col = -1) override; using SalInstanceTreeView::select; /// pos is used differently here, it defines how many steps of iterator we need to perform to take entry diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 8c14e93e4a72..da0537893a35 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -995,6 +995,12 @@ void JSTreeView::set_toggle(int pos, TriState eState, int col) } } +void JSTreeView::set_toggle(const weld::TreeIter& rIter, TriState bOn, int col) +{ +SalInstanceTreeView::set_toggle(rIter, bOn, col); +sendUpdate(); +} + void JSTreeView::select(int pos) { assert(m_xTreeView->IsUpdateMode() && "don't select when frozen"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/data/ods/tdf87973_externalLinkSkipUnuseds.ods |binary sc/qa/unit/subsequent_export-test.cxx| 12 sc/source/core/tool/compiler.cxx |2 +- 3 files changed, 13 insertions(+), 1 deletion(-) New commits: commit a808742d5528648c1f4378997def426d244216f4 Author: Attila Szűcs AuthorDate: Mon Jan 11 12:13:48 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 12:26:00 2021 +0100 tdf#138832 XLSX export: fix lost file names in modified links Also for single-reference links, use the temporary indexes calculated in commit f85d860ccbebd99bc128218148e2992c9415f221 (tdf#87973 XLSX export: fix lost file names in modified links), Note: only a new test case has been added to the modified unit test document. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I4337a4e68008956ea42b626d210f07b1cbfe59ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109088 Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109536 Tested-by: Jenkins (cherry picked from commit 3b481336018d274384b7ade7c2c5e858f24f0e8c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111883 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/data/ods/tdf87973_externalLinkSkipUnuseds.ods b/sc/qa/unit/data/ods/tdf87973_externalLinkSkipUnuseds.ods index cdaf9d4e7007..d25a18b19cac 100644 Binary files a/sc/qa/unit/data/ods/tdf87973_externalLinkSkipUnuseds.ods and b/sc/qa/unit/data/ods/tdf87973_externalLinkSkipUnuseds.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index f988256a8b28..760b194ed371 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -5551,6 +5551,15 @@ void ScExportTest::testTdf87973_externalLinkSkipUnuseds() aFormula = aFormula.replaceAt(nIdxOfFile, nIdxOfFilename - nIdxOfFile, aTempFilename); rDoc.SetFormula(ScAddress(3, 1, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI); +// tdf#138832: test the same thing with singleref link +rDoc.GetFormula(3, 2, 0, aFormula); +nIdxOfFilename = aFormula.indexOf("tdf132105_external.ods"); +aFormula = aFormula.replaceAt(nIdxOfFilename, 22, "87973_externalSource.ods"); +nIdxOfFile = aFormula.indexOf("file"); + +aFormula = aFormula.replaceAt(nIdxOfFile, nIdxOfFilename - nIdxOfFile, aTempFilename); +rDoc.SetFormula(ScAddress(3, 2, 0), aFormula, formula::FormulaGrammar::GRAM_NATIVE_UI); + // save and load back ScDocShellRef pDocSh = saveAndReload(&(*pShell), FORMAT_XLSX); CPPUNIT_ASSERT(pDocSh.is()); @@ -5560,6 +5569,9 @@ void ScExportTest::testTdf87973_externalLinkSkipUnuseds() rDoc2.GetFormula(3, 1, 0, aFormula2); CPPUNIT_ASSERT(aFormula2.indexOf("tdf132105_external.ods") < 0); CPPUNIT_ASSERT(aFormula2.indexOf("87973_externalSource.ods") >= 0); +rDoc2.GetFormula(3, 2, 0, aFormula2); +CPPUNIT_ASSERT(aFormula2.indexOf("tdf132105_external.ods") < 0); +CPPUNIT_ASSERT(aFormula2.indexOf("87973_externalSource.ods") >= 0); pDocSh->DoClose(); } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index d6d83c18e841..3ce2d9f13663 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -5099,7 +5099,7 @@ void ScCompiler::CreateStringFromExternal( OUStringBuffer& rBuffer, const Formul break; case svExternalSingleRef: pConv->makeExternalRefStr(pDoc->GetSheetLimits(), - rBuffer, GetPos(), nFileId, *pFileName, t->GetString().getString(), + rBuffer, GetPos(), nUsedFileId, *pFileName, t->GetString().getString(), *t->GetSingleRef()); break; case svExternalDoubleRef: ___ 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
sw/qa/extras/rtfexport/rtfexport3.cxx | 47 sw/source/filter/ww8/rtfattributeoutput.cxx | 12 +-- sw/source/filter/ww8/rtfattributeoutput.hxx |2 - 3 files changed, 57 insertions(+), 4 deletions(-) New commits: commit a4bdd833a252ed4d942e4478fc820f9f2ee725fe Author: Miklos Vajna AuthorDate: Mon Mar 1 20:57:38 2021 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 3 12:16:24 2021 +0100 tdf#140552 RTF export: fix hyperlink, in footnote, in hyperlink Regression from commit 7d42346ba77c9c4df241ea40eaf550993ca18783 (tdf#90421 RTF export: ignore hyperlinks without an URL, 2015-04-21), URLs can be nested in the footnote case, which requires a stack. Otherwise the inner URL clears "the" URL and we don't close the outer field as we believe it's empty, so it was not started. Change-Id: I9f87ddbb7e597c413bf836eb9b58beb76722361f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111794 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 5a74baa4f033f84c4bbcec869a68eef149f77161) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111778 Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111823 Reviewed-by: Michael Stahl diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 7bb20cbb410e..45f84f5c5089 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -13,6 +13,7 @@ #include #include #include +#include class Test : public SwModelTestBase { @@ -236,6 +237,52 @@ DECLARE_RTFEXPORT_TEST(testTdf112520, "tdf112520.docx") getProperty(getShape(3), "AnchorType")); } +CPPUNIT_TEST_FIXTURE(Test, testNestedHyperlink) +{ +// Given a hyperlink contains a footnote which contains a hyperlink: +{ +createSwDoc(); +uno::Reference xFactory(mxComponent, uno::UNO_QUERY); +uno::Reference xFootnote( +xFactory->createInstance("com.sun.star.text.Footnote"), uno::UNO_QUERY); +uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +uno::Reference xText = xTextDocument->getText(); +uno::Reference xCursor = xText->createTextCursor(); +xText->insertString(xCursor, "a", /*bAbsorb=*/false); +xText->insertTextContent(xCursor, xFootnote, /*bAbsorb=*/false); +xText->insertString(xCursor, "b", /*bAbsorb=*/false); +xCursor->gotoStart(/*bExpand=*/false); +xCursor->gotoEnd(/*bExpand=*/true); +uno::Reference xCursorProps(xCursor, uno::UNO_QUERY); +xCursorProps->setPropertyValue("HyperLinkURL", uno::makeAny(OUString("http://body.com/";))); +uno::Reference xFootnoteText(xFootnote, uno::UNO_QUERY); +xCursor = xFootnoteText->createTextCursor(); +xFootnoteText->insertString(xCursor, "x", /*bAbsorb=*/false); +xCursor->gotoStart(/*bExpand=*/false); +xCursor->gotoEnd(/*bExpand=*/true); +xCursorProps.set(xCursor, uno::UNO_QUERY); +xCursorProps->setPropertyValue("HyperLinkURL", + uno::makeAny(OUString("http://footnote.com/";))); +} + +// When exporting to RTF: +// Without the accompanying fix in place, this test would have failed with: +// assertion failed +// - Expression: xComponent.is() +// i.e. the RTF output was not well-formed, loading failed. +reload(mpFilter, "nested-hyperlink.rtf"); + +// Then make sure both hyperlinks are have the correct URLs. +uno::Reference xParagraph = getParagraph(1); +uno::Reference xPortion = getRun(xParagraph, 1); +CPPUNIT_ASSERT_EQUAL(OUString("http://body.com/";), + getProperty(xPortion, "HyperLinkURL")); +auto xFootnote = getProperty>(getRun(xParagraph, 2), "Footnote"); +uno::Reference xFootnotePortion = getRun(getParagraphOfText(1, xFootnote), 1); +CPPUNIT_ASSERT_EQUAL(OUString("http://footnote.com/";), + getProperty(xFootnotePortion, "HyperLinkURL")); +} + DECLARE_RTFEXPORT_TEST(testTdf121623, "tdf121623.rtf") { // This was 2, multicolumn section was ignored at the table. diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 10d38a569e92..fe7f24e474be 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -530,7 +530,7 @@ void RtfAttributeOutput::EndRuby(const SwTextNode& rNode, sal_Int32 nPos) bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget) { -m_sURL = rUrl; +m_aURLs.push(rUrl); // Ignore hyperlink without a URL. if (!rUrl.isEmpty()) { @@ -560,7 +560,13 @@ bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget) bool RtfAttributeOutput::EndURL(bool const isAtEn
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/subsequent_export-test.cxx |8 +++- sc/source/filter/excel/xestream.cxx |5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) New commits: commit 0f0162aefdc7d64fdcae215ead7d6c813e676120 Author: Attila Szűcs AuthorDate: Mon Dec 21 23:54:43 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 12:12:47 2021 +0100 tdf#121472 XLSX export: fix external Linux path Removed the extra 4th '/' after 'file:///' from aData.maBasePath at exportDocument(). In Linux, the root path could start with '/'.. like /home/... in that case 'file:///'+'/home/..' resulted 'file:home/ that is invalid. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ia37a11def80df2747578807ee021fafe38d48ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108131 Tested-by: Jenkins Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109535 (cherry picked from commit 95b1411e26c1a82e110a8ccf970b8b3590427cb9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111882 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index b094eb7d1ce3..f988256a8b28 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -5608,11 +5608,9 @@ void ScExportTest::testTdf138824_linkToParentDirectory() pXPathFile, m_xSFactory, "xl/externalLinks/_rels/externalLink1.xml.rels"); CPPUNIT_ASSERT(pDoc); -// it should be "../tdf138824_externalSource.ods" but because of an other bug, -// on linux some other directory names may added into the middle -OUString aValue = getXPath(pDoc, "/r:Relationships/r:Relationship", "Target"); -CPPUNIT_ASSERT_EQUAL(0, static_cast(aValue.indexOf("../"))); -CPPUNIT_ASSERT(aValue.indexOf("/tdf138824_externalSource.ods") > 0); +// test also the Linux specific bug tdf#121472 +assertXPath(pDoc, "/r:Relationships/r:Relationship", "Target", +"../tdf138824_externalSource.ods"); xDocSh->DoClose(); } diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 4776bd24b4a9..da880cf6d925 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1036,8 +1036,9 @@ bool XclExpXmlStream::exportDocument() aData.mpCompileFormulaCxt = std::make_shared(&rDoc); // set target path to get correct relative links to target document, not source INetURLObject aPath(getFileUrl()); -aData.maBasePath = aPath.GetPath() + "\\"; -aData.maBasePath = "file:///" + aData.maBasePath.replace('\\', '/'); +aData.maBasePath = OUString("file:///" + aPath.GetPath() + "\\").replace('\\', '/') +// fix for Linux +.replaceFirst("file:", "file:///"); XclExpRoot aRoot( aData ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/data/xls/tdf72470.xls |binary sc/qa/unit/subsequent_filters-test.cxx | 17 + 2 files changed, 17 insertions(+) New commits: commit 6f343f133800fe09d64be0a3d8ba295eeb877045 Author: Xisco Fauli AuthorDate: Tue Mar 2 22:43:27 2021 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 3 11:59:46 2021 +0100 tdf#72470: sc_subsequent_filters: Add unittest Change-Id: Ia43626e11c37f06eb3534182187d4255a9336fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111850 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/data/xls/tdf72470.xls b/sc/qa/unit/data/xls/tdf72470.xls new file mode 100644 index ..99d0c1f0fd00 Binary files /dev/null and b/sc/qa/unit/data/xls/tdf72470.xls differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index c85f8d2dbdc5..fa969a78c4d0 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -295,6 +295,7 @@ public: void testTdf137091(); void testTdf62268(); void testTdf137453(); +void testTdf72470(); void testTdf35636(); void testVBAMacroFunctionODS(); void testAutoheight2Rows(); @@ -487,6 +488,7 @@ public: CPPUNIT_TEST(testTdf137091); CPPUNIT_TEST(testTdf62268); CPPUNIT_TEST(testTdf137453); +CPPUNIT_TEST(testTdf72470); CPPUNIT_TEST(testTdf35636); CPPUNIT_TEST(testVBAMacroFunctionODS); CPPUNIT_TEST(testAutoheight2Rows); @@ -5191,6 +5193,21 @@ void ScFiltersTest::testTdf137453() xDocSh->DoClose(); } +void ScFiltersTest::testTdf72470() +{ +// Without the fix in place, this test would have hung + +ScDocShellRef xDocSh = loadDoc(u"tdf72470.", FORMAT_XLS); +CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is()); + +ScDocument& rDoc = xDocSh->GetDocument(); + +CPPUNIT_ASSERT_EQUAL(OUString("name"), rDoc.GetString(ScAddress(0,0,0))); +CPPUNIT_ASSERT_EQUAL(OUString(u"أسمي walid"), rDoc.GetString(ScAddress(0,1,0))); + +xDocSh->DoClose(); +} + void ScFiltersTest::testTdf35636() { ScDocShellRef xDocSh = loadDoc(u"tdf35636.", FORMAT_ODS); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/data/ods/childDir/tdf138824_linkToParentDirectory.ods |binary sc/qa/unit/data/ods/tdf138824_externalSource.ods |binary sc/qa/unit/subsequent_export-test.cxx| 52 +- sc/source/filter/excel/xelink.cxx| 11 +- 4 files changed, 56 insertions(+), 7 deletions(-) New commits: commit 4f603665230151a73c5d633436102b980102ef09 Author: Attila Szűcs AuthorDate: Fri Dec 11 18:51:10 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 11:58:13 2021 +0100 tdf#138824 tdf#137937 XLSX export: fix parent directory path Parent directory paths (../) removed by XclExpHyperlink::BuildFileName() resulted broken external reference. Note: on Linux, now this fix creates a working, but still fragile path relative to the root directory. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I9401d75d1fba0194d4ff509d9b7305969b8804e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107603 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 107a20ee079ae852b3b33412f234aab2dc35168f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108006 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit ad3b51b5b383dc9c7302b6d1d2e7f6daad5d4d5b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111881 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/data/ods/childDir/tdf138824_linkToParentDirectory.ods b/sc/qa/unit/data/ods/childDir/tdf138824_linkToParentDirectory.ods new file mode 100644 index ..2f0c6d2f93cb Binary files /dev/null and b/sc/qa/unit/data/ods/childDir/tdf138824_linkToParentDirectory.ods differ diff --git a/sc/qa/unit/data/ods/tdf138824_externalSource.ods b/sc/qa/unit/data/ods/tdf138824_externalSource.ods new file mode 100644 index ..59228e390e4d Binary files /dev/null and b/sc/qa/unit/data/ods/tdf138824_externalSource.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index f81437aa6693..b094eb7d1ce3 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -273,6 +273,7 @@ public: void testTdf126305_DataValidatyErrorAlert(); void testTdf87973_externalLinkSkipUnuseds(); void testTdf138741_externalLinkSkipUnusedsCrash(); +void testTdf138824_linkToParentDirectory(); void testTdf129969(); void testTdf84874(); @@ -442,6 +443,7 @@ public: CPPUNIT_TEST(testTdf126305_DataValidatyErrorAlert); CPPUNIT_TEST(testTdf87973_externalLinkSkipUnuseds); CPPUNIT_TEST(testTdf138741_externalLinkSkipUnusedsCrash); +CPPUNIT_TEST(testTdf138824_linkToParentDirectory); CPPUNIT_TEST(testTdf129969); CPPUNIT_TEST(testTdf84874); @@ -5533,7 +5535,7 @@ void ScExportTest::testTdf87973_externalLinkSkipUnuseds() ScDocument& rDoc = pShell->GetDocument(); // change external link to: 87973_externalSource.ods -OUString aFormula, bFormula; +OUString aFormula, aFormula2; rDoc.GetFormula(3, 1, 0, aFormula); auto nIdxOfFilename = aFormula.indexOf("tdf132105_external.ods"); aFormula = aFormula.replaceAt(nIdxOfFilename, 22, "87973_externalSource.ods"); @@ -,9 +5557,9 @@ void ScExportTest::testTdf87973_externalLinkSkipUnuseds() // check if the the new filename is present in the link (and not replaced by '[2]') ScDocument& rDoc2 = pDocSh->GetDocument(); -rDoc2.GetFormula(3, 1, 0, bFormula); -CPPUNIT_ASSERT(bFormula.indexOf("tdf132105_external.ods") < 0); -CPPUNIT_ASSERT(bFormula.indexOf("87973_externalSource.ods") > 0); +rDoc2.GetFormula(3, 1, 0, aFormula2); +CPPUNIT_ASSERT(aFormula2.indexOf("tdf132105_external.ods") < 0); +CPPUNIT_ASSERT(aFormula2.indexOf("87973_externalSource.ods") >= 0); pDocSh->DoClose(); } @@ -5573,6 +5575,48 @@ void ScExportTest::testTdf138741_externalLinkSkipUnusedsCrash() xShell->DoClose(); } +void ScExportTest::testTdf138824_linkToParentDirectory() +{ +ScDocShellRef xShell = loadDoc("childDir/tdf138824_linkToParentDirectory.", FORMAT_ODS); +CPPUNIT_ASSERT(xShell.is()); + +ScDocument& rDoc = xShell->GetDocument(); + +// saveAndReload save the file to a temporary directory +// the link must be changed to point to that parent directory +utl::TempFile aTempFile; +auto aTempFilename = aTempFile.GetURL(); +auto nIdxOfTmpFile = aTempFilename.lastIndexOf('/'); +nIdxOfTmpFile = aTempFilename.lastIndexOf('/', nIdxOfTmpFile); +aTempFilename = aTempFilename.copy(0, nIdxOfTmpFile + 1); + +// change external link to tmp directory +OUString aFormula; +rDoc.GetFormula(3, 1, 0, aFormula); +auto nIdxOfFilename = aFormula.indexOf("tdf138824_externalSource.ods"); +auto nIdxOfFile = aFormula.indexOf("file"); + +aFormula = aFormula.replaceAt(nIdxOfFile, nIdxOfF
[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0' - dtrans/source include/systools sal/CppunitTest_sal_retry_if_failed.mk sal/Module_sal.mk sal/qa
dtrans/source/win32/clipb/MtaOleClipb.cxx |9 ++- include/systools/win32/retry_if_failed.hxx | 40 sal/CppunitTest_sal_retry_if_failed.mk | 16 ++ sal/Module_sal.mk |1 sal/qa/systools/test_retry_if_failed.cxx | 72 + 5 files changed, 135 insertions(+), 3 deletions(-) New commits: commit 31ba05c3650ebf7009005dcdb0f7adea45e778b7 Author: Mike Kaganski AuthorDate: Tue Mar 2 15:00:56 2021 +0300 Commit: Mike Kaganski CommitDate: Wed Mar 3 11:46:47 2021 +0100 tdf#116983 tdf#136175: retry if failed Debugging the test case from the latter bug report shows that indeed the call to OleGetClipboard may fail first time, as jasonkres had suspected in the former bug. So follow the suggestion in tdf#116983, and retry the failing calls several times in case of failure. Many thanks to Telesto for preparing a clear bug report with reliable test case. Co-authored-by: jasonkres Change-Id: Ib3c497da830bc5faac586bcfe1eededa54bfa117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111825 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit cf1c835e8016f8f1eefea6d625a913c0ac343a63) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111880 Tested-by: Mike Kaganski diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx index 70fce3bc64ad..4dddf8831c6c 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx @@ -40,6 +40,7 @@ #include #include +#include // namespace directives @@ -460,7 +461,8 @@ bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncCli HRESULT CMtaOleClipboard::onSetClipboard( IDataObject* pIDataObject ) { -return OleSetClipboard( pIDataObject ); +return sal::systools::RetryIfFailed(10, 100, +[pIDataObject] { return OleSetClipboard(pIDataObject); }); } HRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) @@ -470,7 +472,8 @@ HRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) IDataObjectPtr pIDataObject; // forward the request to the OleClipboard -HRESULT hr = OleGetClipboard( &pIDataObject ); +HRESULT hr += sal::systools::RetryIfFailed(10, 100, [p = &pIDataObject] { return OleGetClipboard(p); }); if ( SUCCEEDED( hr ) ) { hr = MarshalIDataObjectInStream(pIDataObject.get(), ppStream); @@ -483,7 +486,7 @@ HRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) HRESULT CMtaOleClipboard::onFlushClipboard( ) { -return OleFlushClipboard(); +return sal::systools::RetryIfFailed(10, 100, [] { return OleFlushClipboard(); }); } // handle clipboard update event diff --git a/include/systools/win32/retry_if_failed.hxx b/include/systools/win32/retry_if_failed.hxx new file mode 100644 index ..11a7e5372037 --- /dev/null +++ b/include/systools/win32/retry_if_failed.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 + +#pragma comment(lib, "Kernel32.lib") // for Sleep + +namespace sal::systools +{ +// Some system calls (e.g., clipboard access functions) may fail first time, because the resource +// may only be accessed by one process at a time. This function allows to retry failed call up to +// specified number of times with a specified timeout (in ms), until the call succeeds or the limit +// of attempts is exceeded. +// Usage: +// HRESULT hr = sal::systools::RetryIfFailed(10, 100, []{ return OleFlushClipboard(); }); +template HRESULT RetryIfFailed(unsigned times, unsigned msTimeout, Func func) +{ +HRESULT hr = E_FAIL; +for (unsigned i = 0; i < times; ++i) +{ +hr = func(); +if (SUCCEEDED(hr)) +break; +if (i < times - 1) +Sleep(msTimeout); +} +return hr; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sal/CppunitTest_sal_retry_if_failed.mk b/sal/CppunitTest_sal_retry_if_failed.mk new file mode 100644 index ..6e131afb50dc --- /dev/null +++ b/sal/CppunitTest_sal_retry_if_failed.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# 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:/
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa sw/source
sw/qa/extras/uiwriter/data2/tdf39721.fodt | 42 ++ sw/qa/extras/uiwriter/uiwriter2.cxx | 57 ++ sw/source/core/doc/docnum.cxx |3 + 3 files changed, 101 insertions(+), 1 deletion(-) New commits: commit 4c3850cffc951fa82acfded47760a7d1d85cfdd8 Author: László Németh AuthorDate: Wed Jan 6 18:10:39 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 11:32:27 2021 +0100 tdf#39721 sw change tracking: fix move down When moving list items by Move Down (see Bullets and Numbering toolbar) to a non-content node (e.g. tables, images or end of the document), tracked deletions of the inserted paragraphs reappeared as non-deleted text. Note: disable unit test on Windows because of a not reproducable problem of the Jenkins build (moreover, reverting the patch, and modifying the unit test according to the revert has still resulted the same problem on the Windows test machine). Change-Id: I3fb49061a81f832e1070da0f78cf7c5b3bd7d2c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/10 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit b5ab4836c03e9428aff6a48843f2a054ceff0f85) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111879 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sw/qa/extras/uiwriter/data2/tdf39721.fodt b/sw/qa/extras/uiwriter/data2/tdf39721.fodt new file mode 100644 index ..1acf06c5e2a5 --- /dev/null +++ b/sw/qa/extras/uiwriter/data2/tdf39721.fodt @@ -0,0 +1,42 @@ + +http://openoffice.org/2009/office"; office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text" xmlns:dc="http://purl.org/dc/elements/1.1/";> + + + + + + + + + + + + + Unknown Author + 2021-01-06T16:18:57 + + + + + + + Unknown Author + 2021-01-06T16:20:17 + + + + + + + Lorem ipsum + + + dolor sit + + + amet. + + + + + diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index f7735698e6a9..d85ef713454b 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -592,6 +592,63 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131912) CPPUNIT_ASSERT_EQUAL(OUString("foo"), pWrtShell->GetCursor()->GetText()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf39721) +{ +// FIXME: disabled on Windows because of a not reproducable problem (not related to the patch) +#if !defined(_WIN32) +// check move down with redlining +load(DATA_DIRECTORY, "tdf39721.fodt"); + +SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pTextDoc); + +//turn on red-lining and show changes +SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); +pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | RedlineFlags::ShowDelete + | RedlineFlags::ShowInsert); +CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); +CPPUNIT_ASSERT_MESSAGE( +"redlines should be visible", + IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); + +// store original text of the document for checking Undo +OUString sOrigText(pTextDoc->getText()->getString()); + +// first paragraph is "Lorem ipsum" with deleted "m ips" +CPPUNIT_ASSERT_EQUAL(OUString("Lorem ipsum"), getParagraph(1)->getString()); + +// move down first paragraph with change tracking +dispatchCommand(mxComponent, ".uno:MoveDown", {}); + +// deletion isn't rejected +CPPUNIT_ASSERT_EQUAL(OUString("Loremm"), getParagraph(3)->getString()); + +// Undo and repeat it with the second paragraph +dispatchCommand(mxComponent, ".uno:Undo", {}); + +CPPUNIT_ASSERT_EQUAL(sOrigText, pTextDoc->getText()->getString()); + +// second paragraph is "dolor sit" with deleted "lor " +CPPUNIT_ASSERT_EQUAL(OUString("dolor sit"), getParagraph(2)->getString()); + +// move down second paragraph with change tracking +SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + +pWrtShell->Up(/*bSelect=*/false); +pWrtShell->Down(/*bSelect=*/false); + +dispatchCommand(mxComponent, ".uno:MoveDown", {}); + +// This was "dolor sit" (rejecting tracked deletion) +CPPUNIT_ASSERT_EQUAL(OUString("dolsit"), getParagraph(4)->getString()); + +dispatchCommand(mxComponent, ".uno:Undo", {}); + +CPPUNIT_ASSERT_EQUAL(sOrigText, pTextDoc->getText()->getString()); +#endif +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf54819) { load(DATA_DIRECTORY, "tdf54819.fodt"); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index c16ffcdd0911..c15
[Libreoffice-commits] core.git: include/systools sal/CppunitTest_sal_retry_if_failed.mk sal/Module_sal.mk sal/qa vcl/win
include/systools/win32/retry_if_failed.hxx | 42 sal/CppunitTest_sal_retry_if_failed.mk | 16 ++ sal/Module_sal.mk |1 sal/qa/systools/test_retry_if_failed.cxx | 72 + vcl/win/dtrans/MtaOleClipb.cxx |9 ++- 5 files changed, 137 insertions(+), 3 deletions(-) New commits: commit cf1c835e8016f8f1eefea6d625a913c0ac343a63 Author: Mike Kaganski AuthorDate: Tue Mar 2 15:00:56 2021 +0300 Commit: Mike Kaganski CommitDate: Wed Mar 3 11:29:45 2021 +0100 tdf#116983 tdf#136175: retry if failed Debugging the test case from the latter bug report shows that indeed the call to OleGetClipboard may fail first time, as jasonkres had suspected in the former bug. So follow the suggestion in tdf#116983, and retry the failing calls several times in case of failure. Many thanks to Telesto for preparing a clear bug report with reliable test case. Co-authored-by: jasonkres Change-Id: Ib3c497da830bc5faac586bcfe1eededa54bfa117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111825 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/systools/win32/retry_if_failed.hxx b/include/systools/win32/retry_if_failed.hxx new file mode 100644 index ..59608f542f1e --- /dev/null +++ b/include/systools/win32/retry_if_failed.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 + +#pragma comment(lib, "Kernel32.lib") // for Sleep + +namespace sal::systools +{ +// Some system calls (e.g., clipboard access functions) may fail first time, because the resource +// may only be accessed by one process at a time. This function allows to retry failed call up to +// specified number of times with a specified timeout (in ms), until the call succeeds or the limit +// of attempts is exceeded. +// Usage: +// HRESULT hr = sal::systools::RetryIfFailed(10, 100, []{ return OleFlushClipboard(); }); +template +std::enable_if_t, HRESULT>, HRESULT> +RetryIfFailed(unsigned times, unsigned msTimeout, Func func) +{ +HRESULT hr = E_FAIL; +for (unsigned i = 0; i < times; ++i) +{ +hr = func(); +if (SUCCEEDED(hr)) +break; +if (i < times - 1) +Sleep(msTimeout); +} +return hr; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sal/CppunitTest_sal_retry_if_failed.mk b/sal/CppunitTest_sal_retry_if_failed.mk new file mode 100644 index ..6e131afb50dc --- /dev/null +++ b/sal/CppunitTest_sal_retry_if_failed.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,sal_retry_if_failed)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sal_retry_if_failed,\ +sal/qa/systools/test_retry_if_failed \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk index 7611bc950f07..1a190037f05b 100644 --- a/sal/Module_sal.mk +++ b/sal/Module_sal.mk @@ -26,6 +26,7 @@ $(eval $(call gb_Module_add_targets,sal,\ $(eval $(call gb_Module_add_check_targets,sal,\ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),,CppunitTest_Module_DLL) \ $(if $(filter WNT,$(OS)),CppunitTest_sal_comtools) \ + $(if $(filter WNT,$(OS)),CppunitTest_sal_retry_if_failed) \ CppunitTest_sal_osl_security \ CppunitTest_sal_osl \ CppunitTest_sal_rtl \ diff --git a/sal/qa/systools/test_retry_if_failed.cxx b/sal/qa/systools/test_retry_if_failed.cxx new file mode 100644 index ..845cba83092d --- /dev/null +++ b/sal/qa/systools/test_retry_if_failed.cxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#include +#include +#include + +namespace test_systools +{ +class test_retry_if_failed : public CppUnit::TestFixture +{ +public: +void test_success() +{ +const DWORD nTicksBefore = GetTickCount(); +HRESULT hr = sal
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf113013.xlsx|binary sc/qa/unit/subsequent_filters-test.cxx | 26 ++ sc/source/filter/oox/extlstcontext.cxx | 13 + 3 files changed, 35 insertions(+), 4 deletions(-) New commits: commit bfa3d8af13b18ca01a4c373e42b0ce02c772fa9b Author: Tibor Nagy AuthorDate: Wed Jan 6 12:23:32 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 11:14:30 2021 +0100 tdf#113013 XLSX import: fix "Formula is" type conditional formatting rule when the formula contains a reference to another worksheet. Change-Id: I873fad97a88df64e885fef20d4259ef6bfeaa06b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108850 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit fcd96df8f648439ea191d8c2070e8b21ff0b1001) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111878 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/data/xlsx/tdf113013.xlsx b/sc/qa/unit/data/xlsx/tdf113013.xlsx new file mode 100644 index ..25e6276e7fbb Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf113013.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 5f7dcf412d9e..ce093603ddb6 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -106,6 +106,7 @@ public: virtual void tearDown() override; //ods, xls, xlsx filter tests +void testCondFormatFormulaIsXLSX(); void testCondFormatBeginsAndEndsWithXLSX(); void testExtCondFormatXLSX(); void testUpdateCircleInMergedCellODS(); @@ -277,6 +278,7 @@ public: void testDeleteCirclesInRowAndCol(); CPPUNIT_TEST_SUITE(ScFiltersTest); +CPPUNIT_TEST(testCondFormatFormulaIsXLSX); CPPUNIT_TEST(testCondFormatBeginsAndEndsWithXLSX); CPPUNIT_TEST(testExtCondFormatXLSX); CPPUNIT_TEST(testUpdateCircleInMergedCellODS); @@ -492,6 +494,30 @@ void testRangeNameImpl(const ScDocument& rDoc) } +void ScFiltersTest::testCondFormatFormulaIsXLSX() +{ +ScDocShellRef xDocSh = loadDoc(u"tdf113013.", FORMAT_XLSX); +CPPUNIT_ASSERT_MESSAGE("Failed to load tdf113013.xlsx", xDocSh.is()); + +ScDocument& rDoc = xDocSh->GetDocument(); + +// "Formula is" condition +ScConditionalFormat* pFormatB1 = rDoc.GetCondFormat(1, 0, 0); +CPPUNIT_ASSERT(pFormatB1); +ScConditionalFormat* pFormatA2 = rDoc.GetCondFormat(0, 1, 0); +CPPUNIT_ASSERT(pFormatA2); + +ScRefCellValue aCellB1(rDoc, ScAddress(1, 0, 0)); +OUString aCellStyleB1 = pFormatB1->GetCellStyle(aCellB1, ScAddress(1, 0, 0)); +CPPUNIT_ASSERT(!aCellStyleB1.isEmpty()); + +ScRefCellValue aCellA2(rDoc, ScAddress(0, 1, 0)); +OUString aCellStyleA2 = pFormatA2->GetCellStyle(aCellA2, ScAddress(0, 1, 0)); +CPPUNIT_ASSERT(!aCellStyleA2.isEmpty()); + +xDocSh->DoClose(); +} + void ScFiltersTest::testCondFormatBeginsAndEndsWithXLSX() { ScDocShellRef xDocSh = loadDoc("tdf120749.", FORMAT_XLSX); diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 2f0c6c475c9a..f06d2e55241f 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -153,26 +153,31 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl eOperator = CondFormatBuffer::convertToInternalOperator(aToken); return this; } -else if(aType == "containsText") +else if (aType == "containsText") { eOperator = ScConditionMode::ContainsText; return this; } -else if(aType == "notContainsText") +else if (aType == "notContainsText") { eOperator = ScConditionMode::NotContainsText; return this; } -else if(aType == "beginsWith") +else if (aType == "beginsWith") { eOperator = ScConditionMode::BeginsWith; return this; } -else if(aType == "endsWith") +else if (aType == "endsWith") { eOperator = ScConditionMode::EndsWith; return this; } +else if (aType == "expression") +{ +eOperator = ScConditionMode::Direct; +return this; +} else { SAL_WARN("sc", "unhandled XLS14_TOKEN(cfRule) with type: " << aType); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/inc vcl/qt5 vcl/unx
vcl/inc/qt5/Qt5Instance.hxx|2 +- vcl/qt5/Qt5Instance.cxx|4 ++-- vcl/unx/kf5/KF5SalInstance.cxx |4 ++-- vcl/unx/kf5/KF5SalInstance.hxx |5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) New commits: commit 9b56b718f6921b1160733e56f5cfc0d12c4146ab Author: Noel AuthorDate: Mon Mar 1 20:36:56 2021 +0200 Commit: Noel Grandin CommitDate: Wed Mar 3 11:09:15 2021 +0100 loplugin:refcounting in vcl Change-Id: I92e9db7abdfe5912335fd94e42422e8556d71091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111769 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx index cd9c51826a90..8cfa9ac960f1 100644 --- a/vcl/inc/qt5/Qt5Instance.hxx +++ b/vcl/inc/qt5/Qt5Instance.hxx @@ -80,7 +80,7 @@ Q_SIGNALS: void deleteObjectLaterSignal(QObject* pObject); protected: -virtual Qt5FilePicker* +virtual rtl::Reference createPicker(css::uno::Reference const& context, QFileDialog::FileMode); diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 97eff04fe77a..5afbd8722418 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -437,14 +437,14 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) aEvent.m_pFrame->CallCallback(aEvent.m_nEvent, aEvent.m_pData); } -Qt5FilePicker* +rtl::Reference Qt5Instance::createPicker(css::uno::Reference const& context, QFileDialog::FileMode eMode) { if (!IsMainThread()) { SolarMutexGuard g; -Qt5FilePicker* pPicker; +rtl::Reference pPicker; RunInMainThread([&, this]() { pPicker = createPicker(context, eMode); }); assert(pPicker); return pPicker; diff --git a/vcl/unx/kf5/KF5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx index 5b95ff8df572..4c1a87730e51 100644 --- a/vcl/unx/kf5/KF5SalInstance.cxx +++ b/vcl/unx/kf5/KF5SalInstance.cxx @@ -57,14 +57,14 @@ bool KF5SalInstance::hasNativeFileSelection() const return Qt5Instance::hasNativeFileSelection(); } -Qt5FilePicker* +rtl::Reference KF5SalInstance::createPicker(css::uno::Reference const& context, QFileDialog::FileMode eMode) { if (!IsMainThread()) { SolarMutexGuard g; -Qt5FilePicker* pPicker; +rtl::Reference pPicker; RunInMainThread([&, this]() { pPicker = createPicker(context, eMode); }); assert(pPicker); return pPicker; diff --git a/vcl/unx/kf5/KF5SalInstance.hxx b/vcl/unx/kf5/KF5SalInstance.hxx index 5dd306da5231..b462e147003d 100644 --- a/vcl/unx/kf5/KF5SalInstance.hxx +++ b/vcl/unx/kf5/KF5SalInstance.hxx @@ -24,8 +24,9 @@ class KF5SalInstance final : public Qt5Instance { bool hasNativeFileSelection() const override; -Qt5FilePicker* createPicker(css::uno::Reference const& context, -QFileDialog::FileMode) override; +rtl::Reference +createPicker(css::uno::Reference const& context, + QFileDialog::FileMode) override; SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/skia
vcl/skia/SkiaHelper.cxx |8 ++--- vcl/skia/gdiimpl.cxx | 75 +++ vcl/skia/salbmp.cxx | 44 --- vcl/skia/win/gdiimpl.cxx | 16 +- vcl/skia/x11/gdiimpl.cxx | 19 ++- vcl/skia/zone.cxx|6 +-- 6 files changed, 83 insertions(+), 85 deletions(-) New commits: commit 715fe00a5052b35310b2d1289ab6137d77767ddd Author: Luboš Luňák AuthorDate: Mon Mar 1 20:18:12 2021 +0100 Commit: Luboš Luňák CommitDate: Wed Mar 3 11:08:02 2021 +0100 'using namespace SkiaHelper' in skia vcl sources Change-Id: I9a9f687242c788ca5e4594d7cb20d66403e0421a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111793 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index 0616c5060af0..b9b5b4fb2f20 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -389,9 +389,9 @@ sk_sp createSkSurface(int width, int height, SkColorType type, SkAlph SkiaZone zone; assert(type == kN32_SkColorType || type == kAlpha_8_SkColorType); sk_sp surface; -switch (SkiaHelper::renderMethodToUse()) +switch (renderMethodToUse()) { -case SkiaHelper::RenderVulkan: +case RenderVulkan: { if (GrDirectContext* grDirectContext = getSharedGrDirectContext()) { @@ -432,9 +432,9 @@ sk_sp createSkImage(const SkBitmap& bitmap) { SkiaZone zone; assert(bitmap.colorType() == kN32_SkColorType || bitmap.colorType() == kAlpha_8_SkColorType); -switch (SkiaHelper::renderMethodToUse()) +switch (renderMethodToUse()) { -case SkiaHelper::RenderVulkan: +case RenderVulkan: { if (GrDirectContext* grDirectContext = getSharedGrDirectContext()) { diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 36e10068afb6..1a707f7d9476 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -319,20 +319,20 @@ void SkiaSalGraphicsImpl::createWindowSurface(bool forceRaster) mSurface = mWindowContext->getBackbufferSurface(); if (!mSurface) { -switch (SkiaHelper::renderMethodToUse()) +switch (renderMethodToUse()) { -case SkiaHelper::RenderVulkan: +case RenderVulkan: SAL_WARN("vcl.skia", "cannot create Vulkan GPU window surface, falling back to Raster"); destroySurface(); // destroys also WindowContext return createWindowSurface(true); // try again -case SkiaHelper::RenderRaster: +case RenderRaster: abort(); // This should not really happen, do not even try to cope with it. } } mIsGPU = mSurface->getCanvas()->recordingContext() != nullptr; #ifdef DBG_UTIL -SkiaHelper::prefillSurface(mSurface); +prefillSurface(mSurface); #endif } @@ -356,13 +356,13 @@ void SkiaSalGraphicsImpl::createOffscreenSurface() // HACK: See isOffscreen(). int width = std::max(1, GetWidth()); int height = std::max(1, GetHeight()); -switch (SkiaHelper::renderMethodToUse()) +switch (renderMethodToUse()) { -case SkiaHelper::RenderVulkan: +case RenderVulkan: { -if (SkiaHelper::getSharedGrDirectContext()) +if (getSharedGrDirectContext()) { -mSurface = SkiaHelper::createSkSurface(width, height); +mSurface = createSkSurface(width, height); if (mSurface) { mIsGPU = mSurface->getCanvas()->recordingContext() != nullptr; @@ -375,7 +375,7 @@ void SkiaSalGraphicsImpl::createOffscreenSurface() break; } // Create raster surface as a fallback. -mSurface = SkiaHelper::createSkSurface(width, height); +mSurface = createSkSurface(width, height); assert(mSurface); assert(!mSurface->getCanvas()->recordingContext()); // is not GPU-backed mIsGPU = false; @@ -485,7 +485,7 @@ void SkiaSalGraphicsImpl::checkSurface() if (!isOffscreen()) { flushDrawing(); -snapshot = SkiaHelper::makeCheckedImageSnapshot(mSurface); +snapshot = makeCheckedImageSnapshot(mSurface); } destroySurface(); @@ -654,8 +654,8 @@ void SkiaSalGraphicsImpl::applyXor() paint.setBlendMode(SkBlendMode::kSrc); // copy as is SkCanvas canvas(surfaceBitmap); SkRect area = SkRect::Make(mXorRegion.getBounds()); -canvas.drawImageRect(SkiaHelper::makeCheckedImageSnapshot(mSurface), area, area, - SkSamplingOptions(), &paint, SkCanvas::kFast_SrcRectConstraint); +canvas.drawImageRect(makeCheckedImageSnapshot(mSurface), area, area, SkSamplingOptions(), + &paint, SkCanvas::kFast_SrcRectConstraint); // xor to
[Libreoffice-commits] core.git: bin/update_pch download.lst external/skia vcl/inc vcl/skia
bin/update_pch|1 download.lst |4 external/skia/Library_skia.mk | 58 + external/skia/UnpackedTarball_skia.mk |2 external/skia/constexpr-debug-std-max.patch.1 | 47 +-- external/skia/fix-pch.patch.1 | 20 ++-- external/skia/fix-warnings.patch.1| 28 ++ external/skia/fontconfig-get-typeface.patch.0 | 50 ++-- external/skia/inc/pch/precompiled_skia.hxx| 88 ++--- external/skia/lerp.patch | 12 -- vcl/inc/skia/salbmp.hxx |8 + vcl/inc/skia/utils.hxx| 25 ++ vcl/skia/SkiaHelper.cxx |6 - vcl/skia/gdiimpl.cxx | 108 ++ vcl/skia/salbmp.cxx | 87 +--- vcl/skia/win/gdiimpl.cxx |2 vcl/skia/zone.cxx |2 17 files changed, 295 insertions(+), 253 deletions(-) New commits: commit ad8bff9d2625524999871ace65cfe0382f991f24 Author: Luboš Luňák AuthorDate: Mon Jan 18 19:38:03 2021 +0100 Commit: Luboš Luňák CommitDate: Wed Mar 3 11:07:37 2021 +0100 update Skia to chrome/m90 Including chrome/m89, which wasn't included before because of tdf#140023. Change-Id: I64f1de8e10eab2d92a9383ce8104be5afca40101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111792 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/bin/update_pch b/bin/update_pch index dca39eac8bea..d72509007e28 100755 --- a/bin/update_pch +++ b/bin/update_pch @@ -474,6 +474,7 @@ def filter_ignore(line, module): 'src/sksl/SkSLCPP.h', 'src/gpu/vk/GrVkAMDMemoryAllocator.h', 'src/gpu/GrUtil.h', +'src/sksl/dsl/', ] for i in ignore_list: diff --git a/download.lst b/download.lst index cdc3bb3a2e99..46013d7f6d2d 100644 --- a/download.lst +++ b/download.lst @@ -241,8 +241,8 @@ export RHINO_SHA256SUM := 1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131 export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip export SERF_SHA256SUM := 6988d394b62c3494635b6f0760bc3079f9a0cd380baf0f6b075af1eb9fa5e700 export SERF_TARBALL := serf-1.2.1.tar.bz2 -export SKIA_SHA256SUM := f293656a15342a53bb407b932fc907c6894178a162f09728bd383e24d84b1301 -export SKIA_TARBALL := skia-m88-59bafeeaa7de9eb753e3778c414e01dcf013dcd8.tar.xz +export SKIA_SHA256SUM := abe0b94d54edb717c58d74263f4ed3d27824d2ce9e9f2ce85a21ab38d993f94d +export SKIA_TARBALL := skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz export STAROFFICE_SHA256SUM := f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db export STAROFFICE_VERSION_MICRO := 7 export STAROFFICE_TARBALL := libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk index 87ae0c64552f..ab12388cadfe 100644 --- a/external/skia/Library_skia.mk +++ b/external/skia/Library_skia.mk @@ -137,7 +137,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkBBHFactory \ UnpackedTarball/skia/src/core/SkBigPicture \ UnpackedTarball/skia/src/core/SkBitmapCache \ -UnpackedTarball/skia/src/core/SkBitmapController \ UnpackedTarball/skia/src/core/SkBitmap \ UnpackedTarball/skia/src/core/SkBitmapDevice \ UnpackedTarball/skia/src/core/SkBitmapProcState \ @@ -230,8 +229,10 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkMD5 \ UnpackedTarball/skia/src/core/SkMiniRecorder \ UnpackedTarball/skia/src/core/SkMipmap \ +UnpackedTarball/skia/src/core/SkMipmapAccessor \ UnpackedTarball/skia/src/core/SkModeColorFilter \ UnpackedTarball/skia/src/core/SkOpts \ +UnpackedTarball/skia/src/core/SkOpts_erms \ UnpackedTarball/skia/src/core/SkOverdrawCanvas \ UnpackedTarball/skia/src/core/SkPaint \ UnpackedTarball/skia/src/core/SkPaintPriv \ @@ -273,7 +274,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkRRect \ UnpackedTarball/skia/src/core/SkRTree \ UnpackedTarball/skia/src/core/SkRuntimeEffect \ -UnpackedTarball/skia/src/core/SkRWBuffer \ UnpackedTarball/skia/src/core/SkScalar \ UnpackedTarball/skia/src/core/SkScalerCache \ UnpackedTarball/skia/src/core/SkScalerContext \ @@ -323,32 +323,31 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\ UnpackedTarball/skia/src/core/SkXfermodeInterpretation \ UnpackedTarball/skia/src/core/SkYUVAInfo \ UnpackedTarball/skia/src/core/SkYUVAPixmaps \ -UnpackedTarball/skia/src/core/SkYUVASizeInfo \ UnpackedTarball/skia/src/core/SkYUVMath \ UnpackedTarball/skia/src/core/SkYUV
[Libreoffice-commits] core.git: vcl/inc vcl/qa vcl/skia
vcl/inc/skia/utils.hxx |9 - vcl/qa/cppunit/skia/skia.cxx | 20 vcl/skia/gdiimpl.cxx | 31 +-- 3 files changed, 57 insertions(+), 3 deletions(-) New commits: commit d4159496056741302718ac1e85f450985fd11580 Author: Luboš Luňák AuthorDate: Mon Mar 1 19:38:42 2021 +0100 Commit: Luboš Luňák CommitDate: Wed Mar 3 11:07:16 2021 +0100 do not smoothscale if not changing pixel size Flipping or rotating are simple operations in this regard. This saves some CPU time in raster mode, and for the upcoming chrome/m90 release this also prevents a failure in BackendTest::testDrawTransformedBitmapExAlpha() when rotating. Change-Id: I51890ac19b0bd5312fcf9c7bb8fe519dc10dc007 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111771 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index 7da858ab1fff..b5412e9f9479 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -26,6 +26,7 @@ #include #include +#include #include namespace SkiaHelper @@ -94,7 +95,13 @@ inline DriverBlocklist::DeviceVendor getVendor() return DriverBlocklist::GetVendorFromId(vendorId); } -} // namespace +} // namespace SkiaHelper + +// For unittests. +namespace SkiaTests +{ +VCL_DLLPUBLIC bool matrixNeedsHighQuality(const SkMatrix& matrix); +} template inline std::basic_ostream& operator<<(std::basic_ostream& stream, diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx index a84cb7d19907..6b18967f0590 100644 --- a/vcl/qa/cppunit/skia/skia.cxx +++ b/vcl/qa/cppunit/skia/skia.cxx @@ -17,6 +17,7 @@ #include #include +#include #include // This tests backends that use Skia (i.e. intentionally not the svp one, which is the default.) @@ -37,6 +38,7 @@ public: void testInterpretAs8Bit(); void testAlphaBlendWith(); void testBitmapCopyOnWrite(); +void testMatrixQuality(); void testTdf137329(); CPPUNIT_TEST_SUITE(SkiaTest); @@ -45,6 +47,7 @@ public: CPPUNIT_TEST(testInterpretAs8Bit); CPPUNIT_TEST(testAlphaBlendWith); CPPUNIT_TEST(testBitmapCopyOnWrite); +CPPUNIT_TEST(testMatrixQuality); CPPUNIT_TEST(testTdf137329); CPPUNIT_TEST_SUITE_END(); @@ -307,8 +310,25 @@ void SkiaTest::testBitmapCopyOnWrite() CPPUNIT_ASSERT(bitmap.unittestGetAlphaImage() != oldAlphaImage); } +void SkiaTest::testMatrixQuality() +{ +if (!SkiaHelper::isVCLSkiaEnabled()) +return; +// Not changing the size (but possibly rotated/flipped) does not need high quality transformations. +CPPUNIT_ASSERT(!SkiaTests::matrixNeedsHighQuality(SkMatrix())); + CPPUNIT_ASSERT(!SkiaTests::matrixNeedsHighQuality(SkMatrix::RotateDeg(90))); + CPPUNIT_ASSERT(!SkiaTests::matrixNeedsHighQuality(SkMatrix::RotateDeg(180))); + CPPUNIT_ASSERT(!SkiaTests::matrixNeedsHighQuality(SkMatrix::RotateDeg(270))); +CPPUNIT_ASSERT(!SkiaTests::matrixNeedsHighQuality(SkMatrix::Scale(1, -1))); +CPPUNIT_ASSERT(SkiaTests::matrixNeedsHighQuality(SkMatrix::Scale(0, -1))); +CPPUNIT_ASSERT(SkiaTests::matrixNeedsHighQuality(SkMatrix::Scale(2, 1))); +CPPUNIT_ASSERT(SkiaTests::matrixNeedsHighQuality(SkMatrix::RotateDeg(89))); +} + void SkiaTest::testTdf137329() { +if (!SkiaHelper::isVCLSkiaEnabled()) +return; // Draw a filled polygon in the entire device, with AA enabled. // All pixels in the device should be black, even those at edges (i.e. not affected by AA). ScopedVclPtr device = VclPtr::Create(DeviceFormat::DEFAULT); diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index d8ddf48536c0..c511b2ef2f45 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -1766,6 +1766,33 @@ bool SkiaSalGraphicsImpl::hasFastDrawTransformedBitmap() const return true; } +// Whether applying matrix needs image smoothing for the transformation. +static bool matrixNeedsHighQuality(const SkMatrix& matrix) +{ +if (matrix.isIdentity()) +return false; +if (matrix.isScaleTranslate()) +{ +if (abs(matrix.getScaleX()) == 1 && abs(matrix.getScaleY()) == 1) +return false; // Only at most flipping and keeping the size. +return true; +} +assert(!matrix.hasPerspective()); // we do not use this +if (matrix.getScaleX() == 0 && matrix.getScaleY() == 0) +{ +// Rotating 90 or 270 degrees while keeping the size. +if ((matrix.getSkewX() == 1 && matrix.getSkewY() == -1) +|| (matrix.getSkewX() == -1 && matrix.getSkewY() == 1)) +return false; +} +return true; +} + +namespace SkiaTests +{ +bool matrixNeedsHighQuality(const SkMatrix& matrix) { return ::matrixNeedsHighQuality(matrix); } +} + bool SkiaSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint& rNull, const basegfx::B2DPoint& rX,
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/uitest/validity/tdf138134.py | 63 + sc/source/ui/view/output.cxx | 11 ++ 2 files changed, 74 insertions(+) New commits: commit f55be8c2ed37e4428f28050f2b8b0a54fe896f03 Author: Tibor Nagy AuthorDate: Tue Nov 24 13:46:45 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 11:06:40 2021 +0100 tdf#138134 sc: remove red circle of updated formula Recalculation of formulas didn't remove the red validation circle around the formula cells despite their new valid value. Note: to check/show the fix manually, run the test with $ (cd sc && make -srj8 UITest_validity UITEST_TEST_NAME="tdf138134.DetectiveCircle.test_delete_circle_at_formula" SAL_USE_VCLPLUGIN=gen) (if needed, by adding import time time.sleep(5) to the called function of sc/qa/uitest/validity/tdf138134.py) Co-authored-by: Attila Szűcs (NISZ) Change-Id: Ieda4449b1ef07a3cb536881e99130d967c1bb175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106502 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 0478bdb68e8945cc76dc04c6f7040526656329a8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111877 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/uitest/validity/tdf138134.py b/sc/qa/uitest/validity/tdf138134.py new file mode 100644 index ..6d660019d15e --- /dev/null +++ b/sc/qa/uitest/validity/tdf138134.py @@ -0,0 +1,63 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +class DetectiveCircle(UITestCase): + +def test_delete_circle_at_formula(self): +calc_doc = self.ui_test.create_doc_in_start_center("calc") +xCalcDoc = self.xUITest.getTopFocusWindow() +gridwin = xCalcDoc.getChild("grid_window") +document = self.ui_test.get_component() +enter_text_to_cell(gridwin, "A1", "1") +enter_text_to_cell(gridwin, "A2", "3") +enter_text_to_cell(gridwin, "A3", "=SUM(A1:A2)") + +#Select the cells to be validated +gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) +#Apply Data > Validity ... > Whole Numbers +self.ui_test.execute_dialog_through_command(".uno:Validation") +xDialog = self.xUITest.getTopFocusWindow() +xTabs = xDialog.getChild("tabcontrol") +select_pos(xTabs, "0") +xallow = xDialog.getChild("allow") +xallowempty = xDialog.getChild("allowempty") +xdata = xDialog.getChild("data") +xmin = xDialog.getChild("min") +xmax = xDialog.getChild("max") + +props = {"TEXT": "Whole Numbers"} +actionProps = mkPropertyValues(props) +xallow.executeAction("SELECT", actionProps) +xallowempty.executeAction("CLICK", tuple()) +propsA = {"TEXT": "equal"} +actionPropsA = mkPropertyValues(propsA) +xdata.executeAction("SELECT", actionPropsA) +xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"5"})) +xOKBtn = xDialog.getChild("ok") +self.ui_test.close_dialog_through_button(xOKBtn) + +self.xUITest.executeCommand(".uno:ShowInvalid") + +detectiveCircle1 = document.Sheets.getByName("Sheet1").DrawPage.getCount() +#There should be 1 detective circle object! +self.assertEqual(detectiveCircle1, 1) + +enter_text_to_cell(gridwin, "A1", "2") + +detectiveCircle2 = document.Sheets.getByName("Sheet1").DrawPage.getCount() +#There should not be a detective circle object! +self.assertEqual(detectiveCircle2, 0) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 8683ecdadf77..8ced4bd0ba0a 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -56,6 +56,8 @@ #include #include #include +#include +#include #include @@ -1830,6 +1832,15 @@ void ScOutputData::FindChanged() nCol2 = std::max(rPos.Col(), nCol2); nRow1 = std::min(rPos.Row(), nRow1); nRow2 = std::max(rPos.Row(), nRow2); + +const SfxUInt32Item* pItem = mpDoc->GetAttr(rPos, ATTR_VALIDDATA); +const ScValidationData* pData = mpDoc->GetValidationEntry(pItem->GetValue()); +if (pData) +
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/layout/layout.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit f5c7ec8c99bd7f831fa5e1b00bd5ac01b1a03a8b Author: Mike Kaganski AuthorDate: Wed Mar 3 09:44:46 2021 +0100 Commit: Mike Kaganski CommitDate: Wed Mar 3 11:02:41 2021 +0100 Disable this test also on Windows for now It fails on CI (https://ci.libreoffice.org/job/gerrit_windows/90110/console), and also for me locally. The unexpected value is not because of DPI, since I tested with standard scaling locally. Change-Id: If473598df89e49c22c7338398f827f504189de5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111876 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx index 7cd052725639..59af4962263f 100644 --- a/sw/qa/core/layout/layout.cxx +++ b/sw/qa/core/layout/layout.cxx @@ -360,7 +360,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMirrorMargin) CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMarginPageBorder) { // FIXME this is 3369 on macOS -- calculate this number dynamically? -#if !defined(MACOSX) +// FIXME this is random on Windows at the moment (in two subsequent tests without any scaling, +// the actual values were 6346, 10066) - something broke metafile generation on Windows? +#if !defined(MACOSX) && !defined(_WIN32) // Given a document with a non-0 gutter margin. SwDoc* pDoc = createSwDoc(); uno::Reference xStandard(getStyles("PageStyles")->getByName("Standard"), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa sw/source
sw/qa/extras/uiwriter/uiwriter.cxx | 14 ++ sw/source/core/edit/acorrect.cxx | 17 ++--- 2 files changed, 16 insertions(+), 15 deletions(-) New commits: commit 84c7773c0f95ff356e669dd171f66598b78e346d Author: László Németh AuthorDate: Mon Jan 4 14:05:46 2021 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 10:49:18 2021 +0100 tdf#106380 sw AutoCorrect: track deletion at capitalization Deletion of the original lowercase character wasn't tracked during sentence capitalization, resulting broken change tracking data. Note: for similar potential problems, see FIXME at the end of DocumentContentOperationsManager::Overwrite(). Change-Id: If6ddbb77675d87eb126f7d3bf554b529892b88d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108670 Tested-by: Jenkins Reviewed-by: László Németh (cherry picked from commit aecb7364713871ce068effdb59a5da68ab4b2e53) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108857 Reviewed-by: Xisco Fauli (cherry picked from commit 2c25f59fae2201ef57237bf67625dcdcf238d5ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111875 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d3f3461a3637..7517dc825a10 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -7492,12 +7492,15 @@ void SwUiWriterTest::testRedlineAutoCorrect() SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); -// show tracked deletion +// show tracked deletion with enabled change tracking RedlineFlags const nMode(pWrtShell->GetRedlineFlags() | RedlineFlags::On); CPPUNIT_ASSERT(nMode & (RedlineFlags::ShowDelete | RedlineFlags::ShowInsert)); pWrtShell->SetRedlineFlags(nMode); CPPUNIT_ASSERT(nMode & RedlineFlags::ShowDelete); +CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); + SwAutoCorrect corr(*SvxAutoCorrCfg::Get().GetAutoCorrect()); pWrtShell->AutoCorrect(corr, ' '); sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); @@ -7524,7 +7527,8 @@ void SwUiWriterTest::testRedlineAutoCorrect() nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); // This still keep the tracked deletion, capitalize only the visible text "s" -sReplaced = "tS "; +// with tracked deletion of the original character +sReplaced = "tsS "; CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast(pDoc->GetNodes()[nIndex])->GetText()); // repeat it with visible redlining and word auto replacement of "tset" @@ -7534,7 +7538,8 @@ void SwUiWriterTest::testRedlineAutoCorrect() pWrtShell->Insert("et"); pWrtShell->AutoCorrect(corr, ' '); // This was "Ttest" removing the tracked deletion silently. -sReplaced = "ttest "; +// FIXME The second patch from bug #83419 is missing from backport +sReplaced = "tstest "; nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast(pDoc->GetNodes()[nIndex])->GetText()); @@ -7542,7 +7547,8 @@ void SwUiWriterTest::testRedlineAutoCorrect() dispatchCommand(mxComponent, ".uno:GoToStartOfDoc", {}); pWrtShell->Insert("a"); pWrtShell->AutoCorrect(corr, ' '); -sReplaced = "A ttest "; +// FIXME The second patch from bug #83419 is missing from backport +sReplaced = "A tstest "; nIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(sReplaced, static_cast(pDoc->GetNodes()[nIndex])->GetText()); } diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index fdbad84c6db3..d48adc51557f 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -281,17 +281,12 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const } else { -if( nSourceLength != rText.getLength() ) -{ -pPam->SetMark(); -pPam->GetPoint()->nContent = std::min( -pos.first->GetText().getLength(), pos.second + nSourceLength); -pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); -pPam->Exchange(); -pPam->DeleteMark(); -} -else -pDoc->getIDocumentContentOperations().Overwrite( *pPam, rText ); +pPam->SetMark(); +pPam->GetPoint()->nContent = std::min( +pos.first->GetText().getLength(), pos.second + nSourceLength); +pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); +pPam->Exchange(); +pPam->DeleteMark(); } if( m_bUndoIdInitialized ) ___ Libreoffice
[Libreoffice-commits] core.git: chart2/source
chart2/source/tools/InternalData.cxx | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit e0c00f30fcc970e838672f58a4027155a2de74dc Author: Ouyang Leyan AuthorDate: Sat Jan 30 23:52:22 2021 +0100 Commit: Michael Stahl CommitDate: Wed Mar 3 10:45:32 2021 +0100 Chart debug dump: Support for several lines of headers Currently, the dump() function used to debug charts only displays the first line of headers, but actually headers can span several lines, so some data is hidden. Change-Id: Icbffa1d4dbaf8bb393504d2497f605a4e8f6b51d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110190 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index 9808b237f4b7..c5f9490f01f7 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -518,15 +518,15 @@ void InternalData::dump() const // Header if (!m_aColumnLabels.empty()) { -svl::GridPrinter aPrinter(1, m_aColumnLabels.size(), true); +svl::GridPrinter aPrinter(m_aColumnLabels[0].size(), m_aColumnLabels.size(), true); for (size_t nCol = 0; nCol < m_aColumnLabels.size(); ++nCol) { -if (m_aColumnLabels[nCol].empty()) -continue; - -OUString aStr; -if (m_aColumnLabels[nCol][0] >>= aStr) -aPrinter.set(0, nCol, aStr); +for (size_t nRow = 0; nRow < m_aColumnLabels[nCol].size(); ++nRow) +{ +OUString aStr; +if (m_aColumnLabels[nCol].at(nRow) >>= aStr) +aPrinter.set(nRow, nCol, aStr); +} } aPrinter.print("Header"); } ___ 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/CppunitTest_svx_unit.mk svx/qa svx/source
svx/CppunitTest_svx_unit.mk |1 svx/qa/unit/svdraw.cxx | 55 +++ svx/source/svdraw/svdobj.cxx | 20 +++ 3 files changed, 76 insertions(+) New commits: commit 4ddde32ea6807eaa686ad25aa18ea24a8b834df8 Author: Miklos Vajna AuthorDate: Thu Feb 25 18:04:19 2021 +0100 Commit: Xisco Fauli CommitDate: Wed Mar 3 10:32:47 2021 +0100 tdf#132368 svx: empty the interop grab-bag on ending text edit Regression from commit aafaf1f55fa413ad49d4556cf7c0a713dd206ae4 (PPTX export: save SmartArt as diagram instead of group of shapes, 2019-03-13), the idea of interop grab-bag was to carry additional information around as long as the object is not changed. However, actual clearing of the grab-bag was never implemented, do this when editing shape text. An alternative would be to do this in SdrObject::SetChanged(), but Writer sets the layer of SdrObjects during layout (when the import filter is already finished and undo is enabled), so that would mean loss of the smartart metadata for DOCX. Change-Id: I9ab205b4ef84169f4b5a16b86fe9a152e3370a6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111560 Reviewed-by: Miklos Vajna Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111595 (cherry picked from commit 4bf14305dfa22a3e4084b630b6924a718d7da3ce) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111702 diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk index ac9f3e4531ad..892490265261 100644 --- a/svx/CppunitTest_svx_unit.mk +++ b/svx/CppunitTest_svx_unit.mk @@ -36,6 +36,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \ $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \ basegfx \ drawinglayer \ + editeng \ sal \ sfx \ svxcore \ diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index 5a0f46bba995..5e30c36f6a05 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -25,6 +25,12 @@ #include #include #include +#include +#include +#include +#include +#include + #include using namespace ::com::sun::star; @@ -105,6 +111,55 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText) CPPUNIT_ASSERT_EQUAL(nTransparence, static_cast(basegfx::fround(fTransparence * 100))); } + +CPPUNIT_TEST_FIXTURE(SvdrawTest, testTextEditEmptyGrabBag) +{ +// Given a document with a groupshape, which has 2 children. +getComponent() = loadFromDesktop("private:factory/sdraw"); +uno::Reference xFactory(getComponent(), uno::UNO_QUERY); +uno::Reference xRect1( +xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY); +xRect1->setPosition(awt::Point(1000, 1000)); +xRect1->setSize(awt::Size(1, 1)); +uno::Reference xRect2( +xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY); +xRect2->setPosition(awt::Point(1000, 1000)); +xRect2->setSize(awt::Size(1, 1)); +uno::Reference xGroup( +xFactory->createInstance("com.sun.star.drawing.GroupShape"), uno::UNO_QUERY); +uno::Reference xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); +uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); +uno::Reference xGroupShape(xGroup, uno::UNO_QUERY); +xDrawPage->add(xGroupShape); +xGroup->add(xRect1); +xGroup->add(xRect2); +uno::Reference xRect2Text(xRect2, uno::UNO_QUERY); +xRect2Text->setString("x"); +uno::Sequence aGrabBag = { +comphelper::makePropertyValue("OOXLayout", true), +}; +uno::Reference xGroupProps(xGroup, uno::UNO_QUERY); +xGroupProps->setPropertyValue("InteropGrabBag", uno::makeAny(aGrabBag)); + +// When editing the shape text of the 2nd rectangle (insert a char at the start). +SfxViewShell* pViewShell = SfxViewShell::Current(); +SdrView* pSdrView = pViewShell->GetDrawView(); +SdrObject* pObject = GetSdrObjectFromXShape(xRect2); +pSdrView->SdrBeginTextEdit(pObject); +EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView(); +rEditView.InsertText("y"); +pSdrView->SdrEndTextEdit(); + +// Then make sure that grab-bag is empty to avoid loosing the new text. +xGroupProps->getPropertyValue("InteropGrabBag") >>= aGrabBag; +// Without the accompanying fix in place, this test would have failed with: +// assertion failed +// - Expression: !aGrabBag.hasElements() +// i.e. the grab-bag was still around after modifying the shape, and that grab-bag contained the +// old text. +CPPUNIT_ASSERT(!aGrabBag.hasElements()); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdra
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt |binary sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 21 ++ sw/source/filter/ww8/wrtw8sty.cxx |6 +- 4 files changed, 24 insertions(+), 3 deletions(-) New commits: commit e305289f87ea058cc92ecd83379b848697aa5a80 Author: Vasily Melenchuk AuthorDate: Fri Apr 12 09:31:28 2019 +0200 Commit: Thorsten Behrens CommitDate: Wed Mar 3 10:25:42 2021 +0100 tdf#124678 DOCX export: always write title page in section props Even if page description is not set we should try to mark title page because chaining of two page styles can not work for continuous sections. Unittests were implemented previously and were taken from abandoned patch https://gerrit.libreoffice.org/c/core/+/70646 Change-Id: I0b953d72d762f868735dc658f023d96944c9d308 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111757 Tested-by: Jenkins Tested-by: Thorsten Behrens Reviewed-by: Thorsten Behrens diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt new file mode 100644 index ..a694ff613633 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf124678_no_leading_paragraph.odt differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt new file mode 100644 index ..cb14c8ea4df3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf124678_with_leading_paragraph.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index a74bc0eed6a0..943938f67307 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1403,6 +1403,27 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf101122_noFillForCustomShape, "tdf1011 "a:graphicData/wps:wsp/wps:spPr/a:custGeom/a:pathLst/a:path", "fill"); } +// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same, +// except: +// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph +// before the first section +// +DECLARE_OOXMLEXPORT_TEST(testTdf124678_case1, "tdf124678_no_leading_paragraph.odt") +{ +CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt")); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt")); +} + +// The (tdf124678_no_leading_paragraph.odt, tdf124678_with_leading_paragraph.odt) documents are the same, +// except: +// - tdf124678_no_leading_paragraph.odt doesn't contain leading empty paragraph +// before the first section +// +DECLARE_OOXMLEXPORT_TEST(testTdf124678_case2, "tdf124678_with_leading_paragraph.odt") +{ +CPPUNIT_ASSERT_EQUAL_MESSAGE("First page header text", OUString(""), parseDump("/root/page[1]/header/txt")); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt")); +} CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index caae58fbb163..282bd90efab9 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1745,9 +1745,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt } } -if( titlePage ) -AttrOutput().SectionTitlePage(); - const SfxItemSet* pOldI = m_pISet; const SfxPoolItem* pItem; @@ -1813,6 +1810,9 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt } } +if (titlePage) +AttrOutput().SectionTitlePage(); + AttrOutput().SectionType( nBreakCode ); if( rSepInfo.pPageDesc ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl solenv/clang-format vcl/source
include/vcl/dockwin.hxx | 105 solenv/clang-format/excludelist |1 vcl/source/window/dockmgr.cxx|2 vcl/source/window/dockwin.cxx|2 vcl/source/window/event.cxx |2 vcl/source/window/impldockingwrapper.hxx | 131 +++ vcl/source/window/menu.cxx |6 - vcl/source/window/toolbox.cxx|1 vcl/source/window/toolbox2.cxx |2 vcl/source/window/window.cxx |1 10 files changed, 146 insertions(+), 107 deletions(-) New commits: commit 81565c31829fe1141e64acb900d891e9f9705971 Author: Caolán McNamara AuthorDate: Tue Mar 2 10:27:53 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 10:20:54 2021 +0100 move ImplDockingWindowWrapper out of public header and down to where it is needed Change-Id: Ieded4a1b5d10ab7f9a57c2694a4684bdecc77fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111827 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index d8f69ccd1fb5..8dbe5ead00a4 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -62,110 +62,7 @@ struct EndPopupModeData {}; }; -/** ImplDockingWindowWrapper - * - * ImplDockingWindowWrapper obsoletes the DockingWindow class. - * It is better because it can make a "normal window" dockable. - * All DockingWindows should be converted the new class. - */ - -class ImplDockingWindowWrapper final -{ -friend class ::vcl::Window; -friend class DockingManager; -friend class DockingWindow; - -private: - -// the original 'Docking'window -VclPtrmpDockingWindow; - -// the original DockingWindow members -VclPtr mpFloatWin; -VclPtrmpOldBorderWin; -VclPtrmpParent; -Link maPopupModeEndHdl; -Point maFloatPos; -Point maDockPos; -Point maMouseOff; -SizemaMinOutSize; -SizemaMaxOutSize; -tools::Rectangle maDragArea; -tools::LongmnTrackX; -tools::LongmnTrackY; -tools::LongmnTrackWidth; -tools::LongmnTrackHeight; -sal_Int32 mnDockLeft; -sal_Int32 mnDockTop; -sal_Int32 mnDockRight; -sal_Int32 mnDockBottom; -WinBits mnFloatBits; -boolmbDockCanceled:1, -mbDocking:1, -mbLastFloatMode:1, -mbDockBtn:1, -mbHideBtn:1, -mbStartDockingEnabled:1, -mbLocked:1; - -DECL_LINK( PopupModeEnd, FloatingWindow*, void ); -voidImplEnableStartDocking() { mbStartDockingEnabled = true; } -boolImplStartDockingEnabled() const { return mbStartDockingEnabled; } -voidImplPreparePopupMode(); - -public: -ImplDockingWindowWrapper( const vcl::Window *pWindow ); -~ImplDockingWindowWrapper(); - -vcl::Window*GetWindow() { return mpDockingWindow; } -voidImplStartDocking( const Point& rPos ); - -// those methods actually call the corresponding handlers -voidStartDocking( const Point& rPos, tools::Rectangle const & rRect ); -boolDocking( const Point& rPos, tools::Rectangle& rRect ); -voidEndDocking( const tools::Rectangle& rRect, bool bFloatMode ); -boolPrepareToggleFloatingMode(); -voidToggleFloatingMode(); - -voidSetDragArea( const tools::Rectangle& rRect ); -const tools::Rectangle& GetDragArea() const { return maDragArea;} - -voidLock(); -voidUnlock(); -boolIsLocked() const { return mbLocked;} - -voidStartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); -voidStartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags ); -boolIsInPopupMode() const; - -voidSetPopupModeEndHdl( const Link& rLink ) { maPopupModeEndHdl = rLink; } - -voidTitleButtonClick( TitleButton nButton ); -voidResizing( Size& rSize ); -voidTracking( const TrackingEvent& rTEvt ); - -voidShowTitleButton( TitleButton nButton, bool bVisible ); - -voidSetMinOutputSizePixel( const Size& rSize ); - -voidSetMaxOutputSizePixel( const Size& rSize ); - -boolIsDocking() const { return mbDocking; } -boolIsDockingCanceled() const { return mbDockCanceled; } - -voidSetFloatingMode( bool bFloatMode ); -boolIsFloatingMode() const; -SystemWindow* GetFloatingWindow() const; - -voidSetFloatStyle( WinBits nWinStyle ); -
[Libreoffice-commits] core.git: extensions/source include/vcl solenv/clang-format vcl/inc vcl/source
extensions/source/update/ui/updatecheckui.cxx |6 - include/vcl/menubarupdateicon.hxx | 89 ++ solenv/clang-format/excludelist |2 vcl/inc/bubblewindow.hxx | 57 vcl/source/window/bubblewindow.cxx|3 5 files changed, 94 insertions(+), 63 deletions(-) New commits: commit 991ce31833b3e14e75f56b213bcb71bd18d4f980 Author: Caolán McNamara AuthorDate: Tue Mar 2 09:35:01 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 10:19:08 2021 +0100 bubblewindow.hxx can be a private vcl header Change-Id: Iaf79521e812ec32f6e0b9276ad778fe7abc836a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111807 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index b9582b465410..a39de0bbd3cb 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -31,12 +31,10 @@ #include #include #include -#include -#include -#include -#include +#include #include #include +#include #include #include diff --git a/include/vcl/menubarupdateicon.hxx b/include/vcl/menubarupdateicon.hxx new file mode 100644 index ..0b021519dffd --- /dev/null +++ b/include/vcl/menubarupdateicon.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include +#include +#include + +class BubbleWindow; +class SystemWindow; +class VclSimpleEvent; +class VclWindowEvent; + +class VCL_DLLPUBLIC MenuBarUpdateIconManager +{ +private: +OUString maBubbleTitle; +OUString maBubbleText; +OUString maBubbleImageURL; +Image maBubbleImage; +VclPtr mpBubbleWin; +VclPtr mpIconSysWin; +VclPtr mpIconMBar; + +Link maWindowEventHdl; +Link maApplicationEventHdl; +Link maClickHdl; + +Timer maTimeoutTimer; +Idle maWaitIdle; + +sal_uInt16 mnIconID; + +bool mbShowMenuIcon; +bool mbShowBubble; +bool mbBubbleChanged; + +DECL_LINK(UserEventHdl, void*, void); +DECL_LINK(TimeOutHdl, Timer*, void); +DECL_LINK(WindowEventHdl, VclWindowEvent&, void); +DECL_LINK(ApplicationEventHdl, VclSimpleEvent&, void); +DECL_LINK(WaitTimeOutHdl, Timer*, void); +DECL_LINK(ClickHdl, MenuBar::MenuBarButtonCallbackArg&, bool); +DECL_LINK(HighlightHdl, MenuBar::MenuBarButtonCallbackArg&, bool); + +VclPtr GetBubbleWindow(); +void SetBubbleChanged(); + +public: +MenuBarUpdateIconManager(); +~MenuBarUpdateIconManager(); + +void SetShowMenuIcon(bool bShowMenuIcon); +void SetShowBubble(bool bShowBubble); +void SetBubbleImage(const Image& rImage); +void SetBubbleTitle(const OUString& rTitle); +void SetBubbleText(const OUString& rText); + +void SetClickHdl(const Link& rHdl) { maClickHdl = rHdl; } + +bool GetShowMenuIcon() const { return mbShowMenuIcon; } +bool GetShowBubble() const { return mbShowBubble; } +OUString GetBubbleTitle() const { return maBubbleTitle; } +OUString GetBubbleText() const { return maBubbleText; } + +void RemoveBubbleWindow(bool bRemoveIcon); + +void AddMenuBarIcon(SystemWindow* pSysWin, bool bAddEventHdl); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 88ecdff9981c..e51305a2f579 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6363,7 +6363,6 @@ include/vcl/accessibletableprovider.hxx include/vcl/alpha.hxx include/vcl/bitmap.hxx include/vcl/bitmapex.hxx -include/vcl/bubblewindow.hxx include/vcl/builder.hxx include/vcl/builderfactory.hxx include/vcl/cairo.hxx @@ -14453,6 +14452,7 @@ vcl/inc/bitmap/bmpfast.hxx vcl/inc/accel.h vcl/inc/accmgr.hxx vcl/inc/brdwin.hxx +vcl/inc/bubblewindow.hxx vcl/inc/calendar.hxx vcl/inc/canvasbitmap.hxx vcl/inc/configsettings.hxx diff --git a/include/vcl/bubblewindow.hxx b/vcl/inc/bubblewindow.hxx similarity index 53% rename fr
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/line/LinePropertyPanel.hxx |1 - 1 file changed, 1 deletion(-) New commits: commit ed6dfdbea32ec8fa97e9dc92ebc5dd18bd6ef78e Author: Caolán McNamara AuthorDate: Tue Mar 2 10:03:12 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 10:09:36 2021 +0100 drop unneeded forward declare Change-Id: I0d786e8f37e893d91b1dd527476c7242e0e29950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111816 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx index 0402918b82bc..cdd4cf29406c 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.hxx +++ b/svx/source/sidebar/line/LinePropertyPanel.hxx @@ -32,7 +32,6 @@ class XLineEndList; class XDashList; class ListBox; class ToolBox; -class FloatingWindow; namespace svx::sidebar { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: extensions/inc extensions/source include/vcl vcl/inc vcl/source
extensions/inc/bitmaps.hlst |2 extensions/source/update/ui/updatecheckui.cxx | 390 +- include/vcl/bubblewindow.hxx | 58 +++ vcl/inc/bitmaps.hlst |3 vcl/source/window/bubblewindow.cxx| 347 ++- 5 files changed, 423 insertions(+), 377 deletions(-) New commits: commit d2cd1fad73b97e62443a215c84b7b5d5ee74a818 Author: Caolán McNamara AuthorDate: Mon Mar 1 21:01:05 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 10:08:33 2021 +0100 split and move MenuBar BubbleWindowManager to vcl Change-Id: I1d0f4b7d56845a77e979199917c5d9c849b76c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111798 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/extensions/inc/bitmaps.hlst b/extensions/inc/bitmaps.hlst index 60a388e0c7b4..c07bc6ec16d1 100644 --- a/extensions/inc/bitmaps.hlst +++ b/extensions/inc/bitmaps.hlst @@ -38,8 +38,6 @@ #define RID_EXTBMP_SCROLLBAR"res/sx10768.png" #define RID_EXTBMP_SPINBUTTON "res/sx10769.png" #define RID_EXTBMP_NAVIGATIONBAR"res/sx10607.png" -#define RID_UPDATE_AVAILABLE_16 "extensions/res/update/ui/onlineupdate_16.png" -#define RID_UPDATE_AVAILABLE_26 "extensions/res/update/ui/onlineupdate_26.png" #define RID_SCANNER_HANDLE "extensions/res/scanner/handle.png" #define BMP_TABLE "res/sx03188.png" #define BMP_QUERY "res/sx03202.png" diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index c73db90d4a4f..b9582b465410 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -31,12 +31,8 @@ #include #include #include -#include #include #include -#include -#include -#include #include #include #include @@ -59,62 +55,22 @@ using namespace ::com::sun::star; namespace { -Image GetMenuBarIcon( MenuBar const * pMBar ) -{ -OUString sResID; -vcl::Window *pMBarWin = pMBar->GetWindow(); -sal_uInt32 nMBarHeight = 20; - -if ( pMBarWin ) -nMBarHeight = pMBarWin->GetOutputSizePixel().getHeight(); - -if (nMBarHeight >= 35) -sResID = RID_UPDATE_AVAILABLE_26; -else -sResID = RID_UPDATE_AVAILABLE_16; - -return Image(StockImage::Yes, sResID); -} - class UpdateCheckUI : public ::cppu::WeakImplHelper < lang::XServiceInfo, document::XDocumentEventListener, beans::XPropertySet > { uno::Reference< uno::XComponentContext > m_xContext; uno::Reference< task::XJob > mrJob; -OUString maBubbleTitle; -OUString maBubbleText; OUString maBubbleImageURL; -Image maBubbleImage; -VclPtr mpBubbleWin; -VclPtr mpIconSysWin; -VclPtr mpIconMBar; +MenuBarUpdateIconManager maBubbleManager; std::locale maSfxLocale; -IdlemaWaitIdle; -Timer maTimeoutTimer; -Link maWindowEventHdl; -Link maApplicationEventHdl; -boolmbShowBubble; -boolmbShowMenuIcon; -boolmbBubbleChanged; -sal_uInt16 mnIconID; private: -DECL_LINK(ClickHdl, MenuBar::MenuBarButtonCallbackArg&, bool); -DECL_LINK(HighlightHdl, MenuBar::MenuBarButtonCallbackArg&, bool); -DECL_LINK(WaitTimeOutHdl, Timer *, void); -DECL_LINK(TimeOutHdl, Timer *, void); -DECL_LINK(UserEventHdl, void *, void); -DECL_LINK(WindowEventHdl, VclWindowEvent&, void); -DECL_LINK(ApplicationEventHdl, VclSimpleEvent&, void); - -VclPtr GetBubbleWindow(); -voidRemoveBubbleWindow( bool bRemoveIcon ); -voidAddMenuBarIcon( SystemWindow* pSysWin, bool bAddEventHdl ); +DECL_LINK(ClickHdl, LinkParamNone*, void); + Image GetBubbleImage( OUString const &rURL ); public: explicitUpdateCheckUI(const uno::Reference&); -virtual~UpdateCheckUI() override; // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; @@ -139,36 +95,18 @@ public: const uno::Reference< beans::XVetoableChangeListener > & aListener) override; }; -UpdateCheckUI::UpdateCheckUI(const uno::Reference& xContext) : - m_xContext(xContext) -, mpIconMBar( nullptr ) -, mbShowBubble( false ) -, mbShowMenuIcon( false ) -, mbBubbleChanged( false ) -, mnIconID( 0 ) +UpdateCheckUI::UpdateCheckUI(const uno::Reference& xContext) +: m_xContext(xContext) { maSfxLocale = Translate::Create("sfx"); -maBubbleImage = GetBubbleImage( maBubbleImageURL ); - -
[Libreoffice-commits] core.git: extensions/source include/vcl solenv/clang-format vcl/Library_vcl.mk vcl/source
extensions/source/update/ui/updatecheckui.cxx | 235 -- include/vcl/bubblewindow.hxx | 55 ++ solenv/clang-format/excludelist |2 vcl/Library_vcl.mk|1 vcl/source/window/bubblewindow.cxx| 219 5 files changed, 278 insertions(+), 234 deletions(-) New commits: commit 9bebf9c676f88c67c04ca4f96d88ee2543c5b9e9 Author: Caolán McNamara AuthorDate: Mon Mar 1 17:04:54 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 3 10:07:58 2021 +0100 move BubbleWindow to vcl Change-Id: I2481a9882dc66337b35b758fb4f73978df5af541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111797 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index 3a177327d256..c73db90d4a4f 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -76,37 +76,6 @@ Image GetMenuBarIcon( MenuBar const * pMBar ) return Image(StockImage::Yes, sResID); } -class BubbleWindow : public FloatingWindow -{ -Point maTipPos; -vcl::Region maBounds; -tools::Polygon maRectPoly; -tools::Polygon maTriPoly; -OUStringmaBubbleTitle; -OUStringmaBubbleText; -Image maBubbleImage; -SizemaMaxTextSize; -tools::Rectangle maTitleRect; -tools::Rectangle maTextRect; -tools::Long mnTipOffset; - -private: -voidRecalcTextRects(); - -public: -BubbleWindow( vcl::Window* pParent, const OUString& rTitle, - const OUString& rText, const Image& rImage ); - -virtual voidMouseButtonDown( const MouseEvent& rMEvt ) override; -virtual voidPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; -voidResize() override; -voidShow( bool bVisible = true ); -voidSetTipPosPixel( const Point& rTipPos ) { maTipPos = rTipPos; } -voidSetTitleAndText( const OUString& rTitle, const OUString& rText, - const Image& rImage ); -}; - - class UpdateCheckUI : public ::cppu::WeakImplHelper < lang::XServiceInfo, document::XDocumentEventListener, beans::XPropertySet > { @@ -673,208 +642,6 @@ IMPL_LINK( UpdateCheckUI, ApplicationEventHdl, VclSimpleEvent&, rEvent, void) } } - -#define TIP_HEIGHT 15 -#define TIP_WIDTH 7 -#define TIP_RIGHT_OFFSET 18 -#define BUBBLE_BORDER 10 -#define TEXT_MAX_WIDTH300 -#define TEXT_MAX_HEIGHT 200 - - -BubbleWindow::BubbleWindow( vcl::Window* pParent, const OUString& rTitle, -const OUString& rText, const Image& rImage ) -: FloatingWindow( pParent, WB_SYSTEMWINDOW - | WB_OWNERDRAWDECORATION - | WB_NOBORDER -) -, maBubbleTitle( rTitle ) -, maBubbleText( rText ) -, maBubbleImage( rImage ) -, maMaxTextSize( TEXT_MAX_WIDTH, TEXT_MAX_HEIGHT ) -, mnTipOffset( 0 ) -{ -SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetHelpColor() ) ); -} - -void BubbleWindow::Resize() -{ -SolarMutexGuard aGuard; - -FloatingWindow::Resize(); - -Size aSize = GetSizePixel(); - -if ( ( aSize.Height() < 20 ) || ( aSize.Width() < 60 ) ) -return; - -tools::Rectangle aRect( 0, TIP_HEIGHT, aSize.Width(), aSize.Height() - TIP_HEIGHT ); -maRectPoly = tools::Polygon( aRect, 6, 6 ); -vcl::Region aRegion( maRectPoly ); -tools::Long nTipOffset = aSize.Width() - TIP_RIGHT_OFFSET + mnTipOffset; - -Point aPointArr[4]; -aPointArr[0] = Point( nTipOffset, TIP_HEIGHT ); -aPointArr[1] = Point( nTipOffset, 0 ); -aPointArr[2] = Point( nTipOffset + TIP_WIDTH , TIP_HEIGHT ); -aPointArr[3] = Point( nTipOffset, TIP_HEIGHT ); -maTriPoly = tools::Polygon( 4, aPointArr ); -vcl::Region aTriRegion( maTriPoly ); - -aRegion.Union( aTriRegion); -maBounds = aRegion; - -SetWindowRegionPixel( maBounds ); -} - - -void BubbleWindow::SetTitleAndText( const OUString& rTitle, -const OUString& rText, -const Image& rImage ) -{ -maBubbleTitle = rTitle; -maBubbleText = rText; -maBubbleImage = rImage; - -Resize(); -} - - -void BubbleWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& /*rRect*/) -{ -SolarMutexGuard aGuard; - -LineInfo aThickLine( LineStyle::Solid, 2 ); - -DrawPolyLine( maRectPoly, aThickLine ); -DrawPolyLine( maTriPoly ); - -Col
[Libreoffice-commits] core.git: framework/source include/vcl vcl/source
framework/source/layoutmanager/toolbarlayoutmanager.cxx |7 +++ include/vcl/dockwin.hxx |3 ++- vcl/source/window/dockmgr.cxx |8 3 files changed, 13 insertions(+), 5 deletions(-) New commits: commit f34e8ab3e7e7138c2ffe4bd61516f43a2d297d3a Author: Caolán McNamara AuthorDate: Tue Mar 2 10:21:44 2021 + Commit: Mike Kaganski CommitDate: Wed Mar 3 10:02:25 2021 +0100 keep ImplDockingWindowWrapper DLL_PRIVATE and use DockingManager to get the FloatingWindow instead Change-Id: Ifedfe3cc9b024069eef5ea9b7952f2dc2f58b645 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111819 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 4182dba99590..36a91c9074f6 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -1851,12 +1851,11 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfos( ui::DockingArea eD DockingManager* pDockMgr = vcl::Window::GetDockingManager(); if (pDockMgr != nullptr) { -ImplDockingWindowWrapper* pWrapper -= pDockMgr->GetDockingWindowWrapper(pWindow); -if (pWrapper != nullptr && pWrapper->GetFloatingWindow()) +SystemWindow* pFloatingWindow = pDockMgr->GetFloatingWindow(pWindow); +if (pFloatingWindow) { // update the position data of the floating window -if (pWrapper->GetFloatingWindow()->UpdatePositionData()) +if (pFloatingWindow->UpdatePositionData()) { awt::Rectangle aTmpRect = xWindow->getPosSize(); UIElement uiElem = elem; diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 48116e42d11c..d8f69ccd1fb5 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -69,7 +69,7 @@ struct EndPopupModeData * All DockingWindows should be converted the new class. */ -class VCL_DLLPUBLIC ImplDockingWindowWrapper final +class ImplDockingWindowWrapper final { friend class ::vcl::Window; friend class DockingManager; @@ -186,6 +186,7 @@ public: bool IsFloating( const vcl::Window *pWin ); void SetFloatingMode( const vcl::Window *pWin, bool bFloating ); +SystemWindow* GetFloatingWindow(const vcl::Window *pWin); void Lock( const vcl::Window *pWin ); void Unlock( const vcl::Window *pWin ); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 3c196211531e..83018e34622b 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -366,6 +366,14 @@ void DockingManager::EndPopupMode( const vcl::Window *pWin ) static_cast(pWrapper->GetFloatingWindow())->EndPopupMode(); } +SystemWindow* DockingManager::GetFloatingWindow(const vcl::Window *pWin) +{ +ImplDockingWindowWrapper *pWrapper = GetDockingWindowWrapper( pWin ); +if (pWrapper) +return pWrapper->GetFloatingWindow(); +return nullptr; +} + void DockingManager::SetPopupModeEndHdl( const vcl::Window *pWindow, const Link& rLink ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/source
connectivity/source/drivers/postgresql/pq_connection.cxx | 12 - connectivity/source/drivers/postgresql/pq_connection.hxx | 13 -- connectivity/source/drivers/postgresql/pq_updateableresultset.cxx |7 ++--- connectivity/source/drivers/postgresql/pq_xcolumn.cxx |8 -- connectivity/source/drivers/postgresql/pq_xcolumns.cxx| 10 +++ connectivity/source/drivers/postgresql/pq_xcolumns.hxx|4 ++- connectivity/source/drivers/postgresql/pq_xcontainer.hxx |6 +++- connectivity/source/drivers/postgresql/pq_xindex.cxx |5 ++- connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx|8 -- connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx | 10 +++ connectivity/source/drivers/postgresql/pq_xindexes.cxx|9 +++--- connectivity/source/drivers/postgresql/pq_xkey.cxx|5 ++- connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx |8 -- connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx | 10 +++ connectivity/source/drivers/postgresql/pq_xkeys.cxx |8 +++--- connectivity/source/drivers/postgresql/pq_xtable.cxx |8 +++--- connectivity/source/drivers/postgresql/pq_xtable.hxx |2 - connectivity/source/drivers/postgresql/pq_xtables.cxx |8 +++--- connectivity/source/drivers/postgresql/pq_xtables.hxx |8 +- connectivity/source/drivers/postgresql/pq_xuser.cxx |5 ++- connectivity/source/drivers/postgresql/pq_xusers.cxx |8 +++--- connectivity/source/drivers/postgresql/pq_xview.cxx |5 ++- connectivity/source/drivers/postgresql/pq_xviews.cxx |8 +++--- connectivity/source/drivers/postgresql/pq_xviews.hxx |8 +- 24 files changed, 108 insertions(+), 75 deletions(-) New commits: commit 4f06d7cd74273e5691bb5a601452ea0e7eccffb3 Author: Stephan Bergmann AuthorDate: Tue Mar 2 13:45:06 2021 +0100 Commit: Stephan Bergmann CommitDate: Wed Mar 3 10:00:31 2021 +0100 loplugin:refcounting (--enable-postgresql-sdbc) Change-Id: I79a1d05be3a4e7a8e278665ff5863cdc4b182009 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111832 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index 2bc1e4a42af8..9487e51def60 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -48,6 +48,7 @@ #include "pq_xviews.hxx" #include "pq_xusers.hxx" +#include #include #include @@ -186,13 +187,12 @@ Reference< XStatement > Connection::createStatement() MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); -Statement *stmt = new Statement( m_xMutex, this , &m_settings ); -Reference< XStatement > ret( stmt ); +rtl::Reference stmt = new Statement( m_xMutex, this , &m_settings ); ::rtl::ByteSequence id( 16 ); rtl_createUuid( reinterpret_cast(id.getArray()), nullptr, false ); m_myStatements[ id ] = Reference< XCloseable > ( stmt ); stmt->queryAdapter()->addReference( new ClosableReference( id, this ) ); -return ret; +return stmt; } Reference< XPreparedStatement > Connection::prepareStatement( const OUString& sql ) @@ -201,14 +201,14 @@ Reference< XPreparedStatement > Connection::prepareStatement( const OUString& sq checkClosed(); OString byteSql = OUStringToOString( sql, ConnectionSettings::encoding ); -PreparedStatement *stmt = new PreparedStatement( m_xMutex, this, &m_settings, byteSql ); -Reference< XPreparedStatement > ret = stmt; +rtl::Reference stmt += new PreparedStatement( m_xMutex, this, &m_settings, byteSql ); ::rtl::ByteSequence id( 16 ); rtl_createUuid( reinterpret_cast(id.getArray()), nullptr, false ); m_myStatements[ id ] = Reference< XCloseable > ( stmt ); stmt->queryAdapter()->addReference( new ClosableReference( id, this ) ); -return ret; +return stmt; } Reference< XPreparedStatement > Connection::prepareCall( const OUString& ) diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx index f8d19c406b18..a580d903f71f 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.hxx +++ b/connectivity/source/drivers/postgresql/pq_connection.hxx @@ -61,19 +61,18 @@ #include #include +#include "pq_xtables.hxx" +#include "pq_xviews.hxx" + namespace pq_sdbc_driver { struct ConnectionSettings; -class Tables; -class Views; struct ConnectionSettings { ConnectionSettings() : pConnection(nullptr), maxNameLen(0), -maxIndexKeys(0), -pTablesImpl(n
[Libreoffice-commits] core.git: sd/inc sd/source
sd/inc/stlsheet.hxx |2 +- sd/source/core/stlfamily.cxx |2 +- sd/source/core/stlsheet.cxx |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit fd91c4937b942f7e28a1b6a30afddfb2abadfcf1 Author: Noel AuthorDate: Tue Mar 2 09:23:06 2021 +0200 Commit: Noel Grandin CommitDate: Wed Mar 3 09:33:29 2021 +0100 loplugin:refcounting in sd Change-Id: I5e259fc7028b75910efd6a99ed445690a9c496ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111803 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index dc32df9fa5eb..b6b693d4f937 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -72,7 +72,7 @@ public: static OUString GetFamilyString( SfxStyleFamily eFamily ); -static SdStyleSheet* CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ); +static rtl::Reference CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ); //Broadcast that a SdStyleSheet has changed, taking into account outline sublevels //which need to be explicitly broadcast as changing if their parent style was diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index 8e9150a292ef..164fb7814b41 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -429,7 +429,7 @@ Reference< XInterface > SAL_CALL SdStyleFamily::createInstance() throw IllegalAccessException(); } return Reference( -static_cast(SdStyleSheet::CreateEmptyUserStyle(*mxPool, mnFamily))); +static_cast(SdStyleSheet::CreateEmptyUserStyle(*mxPool, mnFamily).get())); } Reference< XInterface > SAL_CALL SdStyleFamily::createInstanceWithArguments( const Sequence< Any >& ) diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 270b1c5d63b7..a470ff28c4f1 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -675,7 +675,7 @@ void SdStyleSheet::throwIfDisposed() throw DisposedException(); } -SdStyleSheet* SdStyleSheet::CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ) +rtl::Reference SdStyleSheet::CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily ) { OUString aName; sal_Int32 nIndex = 1; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf139763ShapeAnchor.xlsx |binary sc/qa/unit/subsequent_filters-test.cxx | 32 + sc/source/filter/oox/drawingbase.cxx |2 + 3 files changed, 34 insertions(+) New commits: commit 6c86b57a746ab8941ae1c4b0dd1a10c381395eed Author: Regina Henschel AuthorDate: Tue Feb 23 21:39:00 2021 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Wed Mar 3 09:22:19 2021 +0100 tdf#139763 set anchor type in meEditAs in all cases OOXML specifies a shape anchor type with xdr:absoluteAnchor and xdr:oneCellAnchor, or with xdr:twoCellAnchor and the attribute editAs with values 'absolute' and 'oneCell'. For our UI the member meEditAs is used. But only in case twoCellAnchor it was set. The patch adds the missing assignments. Change-Id: Iceffd4c5c7640e4d9a614cd52cb491774989595f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111436 Tested-by: Jenkins Reviewed-by: Regina Henschel (cherry picked from commit b2848591ca529004fcfef9bd0f3650750b3735d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111425 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/qa/unit/data/xlsx/tdf139763ShapeAnchor.xlsx b/sc/qa/unit/data/xlsx/tdf139763ShapeAnchor.xlsx new file mode 100644 index ..9c255c3ee836 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf139763ShapeAnchor.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 47837905f407..be7ef0f96a0c 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -298,6 +298,7 @@ public: void testDrawCircleInMergeCells(); void testDeleteCirclesInRowAndCol(); void testTdf129940(); +void testTdf139763ShapeAnchor(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testCondFormatFormulaIsXLSX); @@ -481,6 +482,7 @@ public: CPPUNIT_TEST(testDrawCircleInMergeCells); CPPUNIT_TEST(testDeleteCirclesInRowAndCol); CPPUNIT_TEST(testTdf129940); +CPPUNIT_TEST(testTdf139763ShapeAnchor); CPPUNIT_TEST_SUITE_END(); @@ -5388,6 +5390,36 @@ void ScFiltersTest::testTdf129940() xDocSh->DoClose(); } +void ScFiltersTest::testTdf139763ShapeAnchor() +{ +ScDocShellRef xDocSh = loadDoc(u"tdf139763ShapeAnchor.", FORMAT_XLSX); +CPPUNIT_ASSERT_MESSAGE("Failed to load cell-anchored-shapes.xlsx", xDocSh.is()); + +// There are two objects on the first sheet, anchored to page by element xdr:absoluteAnchor +// and anchored to cell by element xdr:oneCellAnchor. Error was, that they were imported as +// "anchor to cell (resize with cell". +ScDocument& rDoc = xDocSh->GetDocument(); + +CPPUNIT_ASSERT_MESSAGE("There should be at least one sheet.", rDoc.GetTableCount() > 0); + +ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); +SdrPage* pPage = pDrawLayer->GetPage(0); +CPPUNIT_ASSERT_MESSAGE("draw page for sheet 1 should exist.", pPage); +// There should be 2 shapes +CPPUNIT_ASSERT_EQUAL(static_cast(2), pPage->GetObjCount()); + +SdrObject* pObj = pPage->GetObj(0); +CPPUNIT_ASSERT_MESSAGE("Failed to get page anchored object.", pObj); +CPPUNIT_ASSERT_MESSAGE("Shape must be page anchored", !ScDrawLayer::IsCellAnchored(*pObj)); + +pObj = pPage->GetObj(1); +CPPUNIT_ASSERT_MESSAGE("Failed to get cell anchored object.", pObj); +CPPUNIT_ASSERT_MESSAGE("Shape must be anchored to cell.", ScDrawLayer::IsCellAnchored(*pObj)); +CPPUNIT_ASSERT_MESSAGE("Shape must not resize with cell.", !ScDrawLayer::IsResizeWithCell(*pObj)); + +xDocSh->DoClose(); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "sc/qa/unit/data" ) { diff --git a/sc/source/filter/oox/drawingbase.cxx b/sc/source/filter/oox/drawingbase.cxx index 29ef7d4b53c4..938f3fa67fcc 100644 --- a/sc/source/filter/oox/drawingbase.cxx +++ b/sc/source/filter/oox/drawingbase.cxx @@ -75,9 +75,11 @@ void ShapeAnchor::importAnchor( sal_Int32 nElement, const AttributeList& rAttrib { case XDR_TOKEN( absoluteAnchor ): meAnchorType = ANCHOR_ABSOLUTE; +meEditAs = ANCHOR_ABSOLUTE; break; case XDR_TOKEN( oneCellAnchor ): meAnchorType = ANCHOR_ONECELL; +meEditAs = ANCHOR_ONECELL; break; case XDR_TOKEN( twoCellAnchor ): { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/pdf/ExternalPDFStreams.hxx | 12 vcl/source/filter/ipdf/pdfdocument.cxx | 12 +--- vcl/source/gdi/pdfwriter_impl.cxx | 12 +--- 3 files changed, 26 insertions(+), 10 deletions(-) New commits: commit ed7a3dabc8c35b8b33bad33fc26ebd8fb80b0cbd Author: Tomaž Vajngerl AuthorDate: Tue Mar 2 18:57:46 2021 +0900 Commit: Adolfo Jayme Barrientos CommitDate: Wed Mar 3 09:14:22 2021 +0100 tdf#140606 make PDF parsing more lenient and prevent a crash If the external document can't be opened, it tried to continue with the export anyway, which eventually lead to a crash. This is fixed by handling this situation and prevent a crash, however the part of the document in this case isn't exported. The document couldn't be opened because of a parsing error - there was a unexpected null character instead of a whitespace, which made the parser panic. Fix this by making the parser more lenient in such a situation when there is an unexpected null and try to continue parsing. Bug document seems to be created with a buggy PDF writer, but other PDF readers don't complain when parsing the document so it looks to be a valid. qpdf --check doesn't complain either. Change-Id: I61eb281e821ccd195ef006d778556e25d1c7f5e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111820 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 2c1ed5a5dad827cde032f27a4348e81be15889bc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111857 Reviewed-by: Adolfo Jayme Barrientos diff --git a/vcl/inc/pdf/ExternalPDFStreams.hxx b/vcl/inc/pdf/ExternalPDFStreams.hxx index ab3d057bd83c..0a1997fe7dc7 100644 --- a/vcl/inc/pdf/ExternalPDFStreams.hxx +++ b/vcl/inc/pdf/ExternalPDFStreams.hxx @@ -33,21 +33,25 @@ struct VCL_DLLPUBLIC ExternalPDFStream std::map& getCopiedResources() { return maCopiedResources; } -filter::PDFDocument& getPDFDocument() +std::shared_ptr& getPDFDocument() { if (!mpPDFDocument) { SvMemoryStream aPDFStream; aPDFStream.WriteBytes(maData.data(), maData.size()); aPDFStream.Seek(0); -mpPDFDocument = std::make_shared(); -if (!mpPDFDocument->Read(aPDFStream)) +auto pPDFDocument = std::make_shared(); +if (!pPDFDocument->Read(aPDFStream)) { SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: reading the PDF document failed"); } +else +{ +mpPDFDocument = pPDFDocument; +} } -return *mpPDFDocument; +return mpPDFDocument; } }; diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 41c44bd01b57..804713abaf10 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -1441,12 +1441,18 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, } else { -if (!rtl::isAsciiWhiteSpace(static_cast(ch))) +auto uChar = static_cast(ch); +// Be more lenient and allow unexpected null char +if (!rtl::isAsciiWhiteSpace(uChar) && uChar != 0) { -SAL_WARN("vcl.filter", "PDFDocument::Tokenize: unexpected character: " - << ch << " at byte position " << rStream.Tell()); +SAL_WARN("vcl.filter", + "PDFDocument::Tokenize: unexpected character with code " + << sal_Int32(ch) << " at byte position " << rStream.Tell()); return false; } +SAL_WARN_IF(uChar == 0, "vcl.filter", +"PDFDocument::Tokenize: unexpected null character at " +<< rStream.Tell() << " - ignoring"); } break; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 951cda0f29da..eeeb4305a181 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8459,10 +8459,16 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) // object. if (rEmit.m_nExternalPDFDataIndex < 0) return; -auto & rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex); -auto & rPDFDocument = rExternalPDFStream.getPDFDocument(); +auto& rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex); +auto& pPDFDocument = rExternalPDFStream.getPDFDocument(); +if (!pPDFDocument) +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/source
vcl/source/window/layout.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 411c870ed16c6a27bbd9c762e187783b3b39849e Author: Caolán McNamara AuthorDate: Mon Mar 1 11:56:17 2021 + Commit: Adolfo Jayme Barrientos CommitDate: Wed Mar 3 09:12:20 2021 +0100 tdf#140537 scroll-wheeling shouldn't affect disabled scrollbars Change-Id: I5d8659c7d431d35d628b12cebfe6a4b4f9cab9ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111703 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 9b562c340b6b..2cf77e81a688 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2059,7 +2059,10 @@ bool VclScrolledWindow::EventNotify(NotifyEvent& rNEvt) const CommandWheelData* pData = rCEvt.GetWheelData(); if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) ) { -bDone = HandleScrollCommand(rCEvt, m_pHScroll, m_pVScroll); +// tdf#140537 only handle scroll commands in the valid shown scrollbars +bDone = HandleScrollCommand(rCEvt, +m_pHScroll->IsVisible() ? m_pHScroll : nullptr, +m_pVScroll->IsVisible() ? m_pVScroll : nullptr); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/rtfexport/rtfexport.cxx | 32 1 file changed, 12 insertions(+), 20 deletions(-) New commits: commit a8ee791b189186332296e6d5462c93ef350dc01d Author: Miklos Vajna AuthorDate: Tue Mar 2 21:09:06 2021 +0100 Commit: Miklos Vajna CommitDate: Wed Mar 3 09:08:53 2021 +0100 CppunitTest_sw_rtfexport: clean up empty hyperlink testcase If the doc needs modifications after loading and we only check the import-export-import result, then it's simpler and faster to use plain CPPUNIT_TEST_FIXTURE(). Change-Id: I25907d46bb79a954915e36fac27c20a3611c3de6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111849 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 737821f73286..049c78bd7f6b 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -66,16 +66,6 @@ public: return (OString(filename).endsWith(".rtf") && std::find(vDenylist.begin(), vDenylist.end(), filename) == vDenylist.end()); } - -virtual void postLoad(const char* pFilename) override -{ -if (OString(pFilename) == "tdf90421.fodt") -{ -// Change the hyperlink, so its URL is empty. -uno::Reference xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); -xRun->setPropertyValue("HyperLinkURL", uno::makeAny(OUString())); -} -} }; DECLARE_RTFEXPORT_TEST(testZoom, "zoom.rtf") @@ -1019,17 +1009,19 @@ DECLARE_RTFEXPORT_TEST(testTdf80708, "tdf80708.rtf") .getLength()); } -DECLARE_RTFEXPORT_TEST(testTdf90421, "tdf90421.fodt") +CPPUNIT_TEST_FIXTURE(Test, testHyperlinkWithoutURL) { -if (mbExported) -{ -SvMemoryStream aMemoryStream; -SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); -aStream.ReadStream(aMemoryStream); -OString aData(static_cast(aMemoryStream.GetData()), aMemoryStream.GetSize()); -// This was some positive number, i.e. we exported a hyperlink with an empty URL. -CPPUNIT_ASSERT_EQUAL(static_cast(-1), aData.indexOf("HYPERLINK")); -} +load(mpTestDocumentPath, "tdf90421.fodt"); +// Change the hyperlink, so its URL is empty. +uno::Reference xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); +xRun->setPropertyValue("HyperLinkURL", uno::makeAny(OUString())); +reload(mpFilter, "gutter-left.rtf"); +SvMemoryStream aMemoryStream; +SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); +aStream.ReadStream(aMemoryStream); +OString aData(static_cast(aMemoryStream.GetData()), aMemoryStream.GetSize()); +// This was some positive number, i.e. we exported a hyperlink with an empty URL. +CPPUNIT_ASSERT_EQUAL(static_cast(-1), aData.indexOf("HYPERLINK")); } DECLARE_RTFEXPORT_TEST(testTdf92521, "tdf92521.odt") ___ 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/inc vcl/skia
vcl/inc/skia/gdiimpl.hxx |4 ++-- vcl/skia/gdiimpl.cxx | 34 +- vcl/skia/win/gdiimpl.cxx |1 + vcl/skia/x11/gdiimpl.cxx |2 ++ 4 files changed, 26 insertions(+), 15 deletions(-) New commits: commit f0c3eec0f26d8b71ec92b32cfa0cf5747f0702eb Author: Luboš Luňák AuthorDate: Thu Feb 25 11:37:54 2021 + Commit: Xisco Fauli CommitDate: Wed Mar 3 09:06:54 2021 +0100 generic Skia workaround for VCL sending empty size (tdf#140288) There have already been commits to handle this, but the case of getting the wrong size the first was still broken (or was fixed in the past and got broken again). Try to be generic by forcing these to be always considered to be offscreen and force non-zero size there. Change-Id: Ie366a296f7f6645333630fa31e9fe18d54c7fba8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111528 Tested-by: Jenkins Reviewed-by: Luboš Luňák (cherry picked from commit 9d8c04d2d5529626d649af3fcebb6d4b65193b28) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111711 Reviewed-by: Caolán McNamara (cherry picked from commit 21305ff47a1bee1fa4787bf792fb3ecdb10d4863) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111782 Reviewed-by: Xisco Fauli diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index ca227e4e809d..057adf4bfcbb 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -229,7 +229,7 @@ protected: void checkSurface(); void destroySurface(); // Reimplemented for X11. -virtual bool avoidRecreateByResize() const { return false; } +virtual bool avoidRecreateByResize() const; void createWindowSurface(bool forceRaster = false); virtual void createWindowContext(bool forceRaster = false) = 0; void createOffscreenSurface(); @@ -239,7 +239,7 @@ protected: void setProvider(SalGeometryProvider* provider) { mProvider = provider; } -bool isOffscreen() const { return mProvider == nullptr || mProvider->IsOffScreen(); } +bool isOffscreen() const; bool isGPU() const { return mIsGPU; } void invert(basegfx::B2DPolygon const& rPoly, SalInvert eFlags); diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index bd497d7f8f6e..946663c2d886 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -311,14 +311,24 @@ void SkiaSalGraphicsImpl::createWindowSurface(bool forceRaster) #endif } +bool SkiaSalGraphicsImpl::isOffscreen() const +{ +if (mProvider == nullptr || mProvider->IsOffScreen()) +return true; +// HACK: Sometimes (tdf#131939, tdf#138022, tdf#140288) VCL passes us a zero-sized window, +// and zero size is invalid for Skia, so force offscreen surface, where we handle this. +if (GetWidth() <= 0 || GetHeight() <= 0) +return true; +return false; +} + void SkiaSalGraphicsImpl::createOffscreenSurface() { SkiaZone zone; assert(isOffscreen()); assert(!mSurface); assert(!mWindowContext); -// When created (especially on Windows), Init() gets called with size (0,0), which is invalid size -// for Skia. May happen also in rare cases such as shutting down (tdf#131939). +// HACK: See isOffscreen(). int width = std::max(1, GetWidth()); int height = std::max(1, GetHeight()); switch (SkiaHelper::renderMethodToUse()) @@ -428,17 +438,7 @@ void SkiaSalGraphicsImpl::checkSurface() } else if (GetWidth() != mSurface->width() || GetHeight() != mSurface->height()) { -if (avoidRecreateByResize()) -return; - -if (!GetWidth() || !GetHeight()) -{ -SAL_WARN("vcl.skia", "recreate(" << this << "): can't create empty surface " - << Size(GetWidth(), GetHeight()) - << " => keeping old one!"); -return; -} - +if (!avoidRecreateByResize()) { Size oldSize(mSurface->width(), mSurface->height()); // Recreating a surface means that the old SkSurface contents will be lost. @@ -471,6 +471,14 @@ void SkiaSalGraphicsImpl::checkSurface() } } +bool SkiaSalGraphicsImpl::avoidRecreateByResize() const +{ +// Keep the old surface if VCL sends us a broken size (see isOffscreen()). +if (GetWidth() == 0 || GetHeight() == 0) +return true; +return false; +} + void SkiaSalGraphicsImpl::flushDrawing() { if (!mSurface) diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index a4cbe062f3a5..3b5249bf4077 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -39,6 +39,7 @@ void WinSkiaSalGraphicsImpl::createWindowContext(bool forceRaster) { SkiaZone zone; sk_app::DisplayParams displayParams; +assert(GetWidth() > 0 && GetHeight() > 0); switch (forceRaster ? SkiaHelper::RenderRaster : SkiaHelper::renderMethodToUse()) { cas
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf139394.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 27 +++ sc/source/filter/excel/xeextlst.cxx | 20 ++-- 3 files changed, 37 insertions(+), 10 deletions(-) New commits: commit 371ea6a4f60c12df6a35bb4715b8ea92a9266e03 Author: Tibor Nagy AuthorDate: Tue Dec 29 08:36:49 2020 +0100 Commit: Gabor Kelemen CommitDate: Wed Mar 3 08:59:53 2021 +0100 tdf#139394 XLSX export: remove extra quotation marks This fixes commit 583e2bfba2d72ac8afe7261c23f380daf5486889 (tdf#139021 XLSX export: fix "contains" conditional formatting). Change-Id: Idae3190b5f87dac551251da19c511f501bdaaa21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108452 Tested-by: László Németh Reviewed-by: László Németh Reviewed-by: Eike Rathke Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108808 Tested-by: Jenkins (cherry picked from commit 9e82c64fa54ce7c0ef18e9de5a06e1243a3a7e44) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111874 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen diff --git a/sc/qa/unit/data/xlsx/tdf139394.xlsx b/sc/qa/unit/data/xlsx/tdf139394.xlsx new file mode 100644 index ..eac83fb2f3a8 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf139394.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 158f1f1a2959..f81437aa6693 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -93,6 +93,7 @@ public: ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, SfxFilterFlags ); void test(); +void testTdf139394(); void testExtCondFormatXLSX(); void testTdf90104(); void testTdf111876(); @@ -277,6 +278,7 @@ public: CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); +CPPUNIT_TEST(testTdf139394); CPPUNIT_TEST(testExtCondFormatXLSX); CPPUNIT_TEST(testTdf90104); CPPUNIT_TEST(testTdf111876); @@ -544,6 +546,31 @@ void ScExportTest::test() xDocSh->DoClose(); } +void ScExportTest::testTdf139394() +{ +ScDocShellRef xShell = loadDoc(u"tdf139394.", FORMAT_XLSX); +CPPUNIT_ASSERT(xShell.is()); + +ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX); +CPPUNIT_ASSERT(xDocSh.is()); + +std::shared_ptr pXPathFile = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX); +xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); +CPPUNIT_ASSERT(pDoc); + +assertXPathContent(pDoc, + "/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[1]/" +"x14:cfRule/xm:f", "LEFT(A1,LEN(\"+\"))=\"+\""); +assertXPathContent(pDoc, + "/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[2]/" +"x14:cfRule/xm:f", "RIGHT(A2,LEN(\"-\"))=\"-\""); +assertXPathContent(pDoc, + "/x:worksheet/x:extLst/x:ext/x14:conditionalFormattings/x14:conditionalFormatting[3]/" +"x14:cfRule/xm:f", "LEFT(A3,LEN($B$3))=$B$3"); + +xDocSh->DoClose(); +} + void ScExportTest::testExtCondFormatXLSX() { ScDocShellRef xShell = loadDoc("tdf139021.", FORMAT_XLSX); diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index f4a385088d8b..887801174301 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -174,16 +174,16 @@ OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, const OString aPos = aBuffer.makeStringAndClear(); switch (eMode) { -case ScConditionMode::BeginsWith: -return OString("LEFT(" + aPos + ",LEN(" + rText + "))=\"" + rText + "\""); -case ScConditionMode::EndsWith: -return OString("RIGHT(" + aPos + ",LEN(" + rText + "))=\"" + rText + "\""); -case ScConditionMode::ContainsText: -return OString("NOT(ISERROR(SEARCH(" + rText + "," + aPos + ")))"); -case ScConditionMode::NotContainsText: -return OString("ISERROR(SEARCH(" + rText + "," + aPos + "))"); -default: -break; +case ScConditionMode::BeginsWith: +return OString("LEFT(" + aPos + ",LEN(" + rText + "))=" + rText); +case ScConditionMode::EndsWith: +return OString("RIGHT(" + aPos + ",LEN(" + rText + "))=" + rText); +case ScConditionMode::ContainsText: +return OString("NOT(ISERROR(SEARCH(" + rText + "," + aPos + ")))"); +case ScConditionMode::NotContainsText: +return OString("ISERROR(SEARCH(" + rText + "," + aPos + "))"); +default: +break; } return ""; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org