[Libreoffice-commits] core.git: bin/find-can-be-private-symbols.functions.results include/svx sc/source svx/source
bin/find-can-be-private-symbols.functions.results |2 +- include/svx/sdr/contact/objectcontact.hxx |2 +- sc/source/ui/view/drawview.cxx|4 ++-- sc/source/ui/view/gridwin4.cxx|2 +- svx/source/sdr/contact/objectcontact.cxx |2 +- svx/source/sdr/contact/viewobjectcontact.cxx |2 +- svx/source/svdraw/svdhdl.cxx |2 +- 7 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 245b92490971d0cf0af0db71837617035b9c2e4b Author: Hannah Meeks AuthorDate: Wed Oct 4 21:26:59 2023 +0100 Commit: Mike Kaganski CommitDate: Fri Oct 6 20:27:25 2023 +0200 Rename ojects to objects! Change-Id: Ia39f59d68a00efea18409a23e243007a9e6a96b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157574 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/bin/find-can-be-private-symbols.functions.results b/bin/find-can-be-private-symbols.functions.results index 139049a3afa6..ad4714f21af9 100644 --- a/bin/find-can-be-private-symbols.functions.results +++ b/bin/find-can-be-private-symbols.functions.results @@ -21753,7 +21753,7 @@ sdr::contact::ObjectContact::RemoveViewObjectContact(sdr::contact::ViewObjectCon sdr::contact::ObjectContact::SetViewObjectContactRedirector(sdr::contact::ViewObjectContactRedirector*) sdr::contact::ObjectContact::TryToGetOutputDevice() const sdr::contact::ObjectContact::TryToGetSdrPageView() const -sdr::contact::ObjectContact::calculateGridOffsetForViewOjectContact(basegfx::B2DVector&, sdr::contact::ViewObjectContact const&) const +sdr::contact::ObjectContact::calculateGridOffsetForViewObjectContact(basegfx::B2DVector&, sdr::contact::ViewObjectContact const&) const sdr::contact::ObjectContact::getActiveViewContact() const sdr::contact::ObjectContact::isDrawModeGray() const sdr::contact::ObjectContact::isDrawModeHighContrast() const diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx index f38eb768c4ee..8d2dc8c6ad8c 100644 --- a/include/svx/sdr/contact/objectcontact.hxx +++ b/include/svx/sdr/contact/objectcontact.hxx @@ -170,7 +170,7 @@ public: // interface to support GridOffset for non-linear ViewToDevice transformation (calc) virtual bool supportsGridOffsets() const; -virtual void calculateGridOffsetForViewOjectContact( +virtual void calculateGridOffsetForViewObjectContact( basegfx::B2DVector& rTarget, const ViewObjectContact& rClient) const; virtual void calculateGridOffsetForB2DRange( diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 24315ce4812e..10dc7c990f3a 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -1168,7 +1168,7 @@ namespace sdr::contact const char* pDebugName); virtual bool supportsGridOffsets() const override; -virtual void calculateGridOffsetForViewOjectContact( +virtual void calculateGridOffsetForViewObjectContact( basegfx::B2DVector& rTarget, const ViewObjectContact& rClient) const override; virtual void calculateGridOffsetForB2DRange( @@ -1212,7 +1212,7 @@ namespace sdr::contact return true; } -void ObjectContactOfScDrawView::calculateGridOffsetForViewOjectContact( +void ObjectContactOfScDrawView::calculateGridOffsetForViewObjectContact( basegfx::B2DVector& rTarget, const ViewObjectContact& rClient) const { diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index a86902d57944..3639e8287698 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1498,7 +1498,7 @@ namespace virtual bool supportsGridOffsets() const override { return true; } -virtual void calculateGridOffsetForViewOjectContact( +virtual void calculateGridOffsetForViewObjectContact( basegfx::B2DVector& rTarget, const sdr::contact::ViewObjectContact& rClient) const override { diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx index b09966c5a01e..f36c5412b182 100644 --- a/svx/source/sdr/contact/objectcontact.cxx +++ b/svx/source/sdr/contact/objectcontact.cxx @@ -32,7 +32,7 @@ bool ObjectContact::supportsGridOffsets() const return false; } -void ObjectContact::calculateGridOffsetForViewOjectContact( +void ObjectContact::calculateGridOffsetForViewObjectContact( basegfx::B2DVector& /*rTarget*/, const ViewObjectContact& /*rClient*/) const { diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 8482187f959b..55ea9681785d 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobject
[Libreoffice-commits] core.git: filter/source
filter/source/config/cache/filtercache.cxx | 177 ++--- 1 file changed, 41 insertions(+), 136 deletions(-) New commits: commit 3288065782544e7a2571c808f3ff17487018f762 Author: Hannah Meeks AuthorDate: Fri Aug 18 21:41:41 2023 +0100 Commit: Mike Kaganski CommitDate: Tue Oct 3 20:54:46 2023 +0200 Simplify long if statements Change-Id: I379fb5809e5e00788445bcf9cebdcaba563b1af4 Use structured binding, fixup Change-Id: Ibd52ff1313336aa8a082477dee3ea7fce0f1d3f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157492 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index aa0eff534cb4..534195893744 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -1809,6 +1809,37 @@ void FilterCache::impl_saveItem(const css::uno::Reference< css::container::XName } } +namespace { +constexpr struct { +SfxFilterFlags eFlag; +rtl::OUStringConstExpr aName; +} flagFilterSwitcher[] = { +{ SfxFilterFlags::STARONEFILTER, FLAGNAME_3RDPARTYFILTER }, +{ SfxFilterFlags::ALIEN, FLAGNAME_ALIEN }, +{ SfxFilterFlags::CONSULTSERVICE, FLAGNAME_CONSULTSERVICE }, +{ SfxFilterFlags::DEFAULT, FLAGNAME_DEFAULT }, +{ SfxFilterFlags::ENCRYPTION, FLAGNAME_ENCRYPTION }, +{ SfxFilterFlags::EXPORT, FLAGNAME_EXPORT }, +{ SfxFilterFlags::IMPORT, FLAGNAME_IMPORT }, +{ SfxFilterFlags::INTERNAL, FLAGNAME_INTERNAL }, +{ SfxFilterFlags::NOTINFILEDLG, FLAGNAME_NOTINFILEDIALOG }, +{ SfxFilterFlags::MUSTINSTALL, FLAGNAME_NOTINSTALLED }, +{ SfxFilterFlags::OWN, FLAGNAME_OWN }, +{ SfxFilterFlags::PACKED, FLAGNAME_PACKED }, +{ SfxFilterFlags::PASSWORDTOMODIFY, FLAGNAME_PASSWORDTOMODIFY }, +{ SfxFilterFlags::PREFERED, FLAGNAME_PREFERRED }, +{ SfxFilterFlags::STARTPRESENTATION, FLAGNAME_STARTPRESENTATION }, +{ SfxFilterFlags::OPENREADONLY, FLAGNAME_READONLY }, +{ SfxFilterFlags::SUPPORTSSELECTION, FLAGNAME_SUPPORTSSELECTION }, +{ SfxFilterFlags::TEMPLATE, FLAGNAME_TEMPLATE }, +{ SfxFilterFlags::TEMPLATEPATH, FLAGNAME_TEMPLATEPATH }, +{ SfxFilterFlags::COMBINED, FLAGNAME_COMBINED }, +{ SfxFilterFlags::SUPPORTSSIGNING, FLAGNAME_SUPPORTSSIGNING }, +{ SfxFilterFlags::GPGENCRYPTION, FLAGNAME_GPGENCRYPTION }, +{ SfxFilterFlags::EXOTIC, FLAGNAME_EXOTIC }, +}; +} + /*--- static! => no locks necessary ---*/ @@ -1816,29 +1847,11 @@ css::uno::Sequence< OUString > FilterCache::impl_convertFlagField2FlagNames(SfxF { std::vector lFlagNames; -if (nFlags & SfxFilterFlags::STARONEFILTER) lFlagNames.emplace_back(FLAGNAME_3RDPARTYFILTER ); -if (nFlags & SfxFilterFlags::ALIEN) lFlagNames.emplace_back(FLAGNAME_ALIEN); -if (nFlags & SfxFilterFlags::CONSULTSERVICE ) lFlagNames.emplace_back(FLAGNAME_CONSULTSERVICE ); -if (nFlags & SfxFilterFlags::DEFAULT ) lFlagNames.emplace_back(FLAGNAME_DEFAULT ); -if (nFlags & SfxFilterFlags::ENCRYPTION ) lFlagNames.emplace_back(FLAGNAME_ENCRYPTION ); -if (nFlags & SfxFilterFlags::EXPORT ) lFlagNames.emplace_back(FLAGNAME_EXPORT ); -if (nFlags & SfxFilterFlags::IMPORT ) lFlagNames.emplace_back(FLAGNAME_IMPORT ); -if (nFlags & SfxFilterFlags::INTERNAL ) lFlagNames.emplace_back(FLAGNAME_INTERNAL ); -if (nFlags & SfxFilterFlags::NOTINFILEDLG ) lFlagNames.emplace_back(FLAGNAME_NOTINFILEDIALOG ); -if (nFlags & SfxFilterFlags::MUSTINSTALL ) lFlagNames.emplace_back(FLAGNAME_NOTINSTALLED ); -if (nFlags & SfxFilterFlags::OWN ) lFlagNames.emplace_back(FLAGNAME_OWN ); -if (nFlags & SfxFilterFlags::PACKED ) lFlagNames.emplace_back(FLAGNAME_PACKED ); -if (nFlags & SfxFilterFlags::PASSWORDTOMODIFY ) lFlagNames.emplace_back(FLAGNAME_PASSWORDTOMODIFY ); -if (nFlags & SfxFilterFlags::PREFERED ) lFlagNames.emplace_back(FLAGNAME_PREFERRED); -if (nFlags & SfxFilterFlags::STARTPRESENTATION) lFlagNames.emplace_back(FLAGNAME_STARTPRESENTATION); -if (nFlags & SfxFilterFlags::OPENREADONLY ) lFlagNames.emplace_back(FLAGNAME_READONLY ); -if (nFlags & SfxFilterFlags::SUPPORTSSELECTION) lFlagNames.emplace_back(FLAGNAME_SUPPORTSSELECTION); -if (nFlags & SfxFilterFlags::TEMPLATE ) lFlagNames.emplace_back(FLAGNAME_TEMPLATE ); -if (nFlags & SfxFilterFlags::TEMPLATEPATH ) lFlagNames.emplace_back(FLAGNAME_TEMPLATEPATH ); -if
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - vcl/jsdialog
vcl/jsdialog/enabled.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit fddade544feaeed62d3c6f7ca990fc9c1e1f5e09 Author: Hannah Meeks AuthorDate: Fri Feb 10 22:15:36 2023 + Commit: Szymon Kłos CommitDate: Tue Feb 21 11:13:22 2023 + jsdialog: enable line numbering Change-Id: I3d188abe79605f88739b0ee17a77c6c7f8ab7754 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147328 Tested-by: Jenkins Reviewed-by: Szymon Kłos (cherry picked from commit d6617bf6f6cebc68018f72ac38bb3dd7a43c766c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147355 Tested-by: Szymon Kłos diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index c11365d6dcbc..d58e08bf32d6 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -76,6 +76,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"modules/swriter/ui/contentcontroldlg.ui" || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui" || rUIFile == u"modules/swriter/ui/insertcaption.ui" +|| rUIFile == u"modules/swriter/ui/linenumbering.ui" || rUIFile == u"modules/swriter/ui/splittable.ui" || rUIFile == u"modules/swriter/ui/translationdialog.ui" || rUIFile == u"modules/swriter/ui/pagenumberdlg.ui"
[Libreoffice-commits] core.git: vcl/jsdialog
vcl/jsdialog/enabled.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit d6617bf6f6cebc68018f72ac38bb3dd7a43c766c Author: Hannah Meeks AuthorDate: Fri Feb 10 22:15:36 2023 + Commit: Szymon Kłos CommitDate: Tue Feb 21 08:34:15 2023 + jsdialog: enable line numbering Change-Id: I3d188abe79605f88739b0ee17a77c6c7f8ab7754 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147328 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index c11365d6dcbc..d58e08bf32d6 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -76,6 +76,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"modules/swriter/ui/contentcontroldlg.ui" || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui" || rUIFile == u"modules/swriter/ui/insertcaption.ui" +|| rUIFile == u"modules/swriter/ui/linenumbering.ui" || rUIFile == u"modules/swriter/ui/splittable.ui" || rUIFile == u"modules/swriter/ui/translationdialog.ui" || rUIFile == u"modules/swriter/ui/pagenumberdlg.ui"
[Libreoffice-commits] core.git: include/vbahelper sc/qa sc/source sw/source vbahelper/source
include/vbahelper/vbafontbase.hxx |8 ++- sc/qa/extras/testdocuments/BGR-RGBTest.xls |binary sc/qa/extras/vba-macro-test.cxx|2 + sc/source/ui/vba/vbafont.cxx |2 - sw/source/ui/vba/vbafont.cxx | 11 +- sw/source/ui/vba/vbafont.hxx |1 vbahelper/source/vbahelper/vbafontbase.cxx | 30 ++--- 7 files changed, 35 insertions(+), 19 deletions(-) New commits: commit 0548269ca03f093c41f6292e783cc6c77328808e Author: Hannah Meeks AuthorDate: Fri Dec 23 21:54:01 2022 + Commit: Mike Kaganski CommitDate: Mon Feb 20 16:55:31 2023 + VBA: Remove conversions in writer from OORGBTOXLRGB (XLRGB is actually BGR!) Enum to store if document is Writer or Calc because font colors are treated differently depending on this: In writer the colors come in as RGB but in calc they are in BGR and both palettes are in RBG so we only need this conversion for calc. Includes testdoc for calc - to show this still works Change-Id: I79d9d585dbfc527c0781543ce1f1095c4db190b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144788 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vbahelper/vbafontbase.hxx b/include/vbahelper/vbafontbase.hxx index 732a67bc1d1e..d388715c93ba 100644 --- a/include/vbahelper/vbafontbase.hxx +++ b/include/vbahelper/vbafontbase.hxx @@ -44,9 +44,13 @@ typedef InheritedHelperInterfaceWeakImpl< ov::XFontBase > VbaFontBase_BASE; class VBAHELPER_DLLPUBLIC VbaFontBase : public VbaFontBase_BASE { +public: +enum Component { WORD, EXCEL }; + protected: css::uno::Reference< css::beans::XPropertySet > mxFont; css::uno::Reference< css::container::XIndexAccess > mxPalette; +Component meWhich; bool mbFormControl; public: @@ -79,7 +83,9 @@ public: const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPalette, const css::uno::Reference< css::beans::XPropertySet >& xPropertySet, -bool bFormControl = false ); +Component eWhich, +bool bFormControl = false); + virtual ~VbaFontBase() override;// {} // Attributes diff --git a/sc/qa/extras/testdocuments/BGR-RGBTest.xls b/sc/qa/extras/testdocuments/BGR-RGBTest.xls new file mode 100755 index ..e2bf43fb0e92 Binary files /dev/null and b/sc/qa/extras/testdocuments/BGR-RGBTest.xls differ diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx index 04e4efece2cf..2464996d2812 100644 --- a/sc/qa/extras/vba-macro-test.cxx +++ b/sc/qa/extras/vba-macro-test.cxx @@ -466,6 +466,8 @@ void VBAMacroTest::testVba() { OUString("vba_findFunction."), OUString( "vnd.sun.Star.script:VBAProject.testMacros.test?language=Basic=document") }, +{ OUString("BGR-RGBTest."), + OUString("vnd.sun.Star.script:VBAProject.Module1.test?language=Basic=document") } }; OUString sTempDir; OUString sTempDirURL; diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 99afd919bea7..db49f013499c 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -37,7 +37,7 @@ ScVbaFont::ScVbaFont( const ScVbaPalette& dPalette, const uno::Reference< beans::XPropertySet >& xPropertySet, ScCellRangeObj* pRangeObj, bool bFormControl ) : -ScVbaFont_BASE( xParent, xContext, dPalette.getPalette(), xPropertySet, bFormControl ), +ScVbaFont_BASE( xParent, xContext, dPalette.getPalette(), xPropertySet, Component::EXCEL, bFormControl ), mpRangeObj( pRangeObj ) { } diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx index de37a6c74e18..91a31ec66470 100644 --- a/sw/source/ui/vba/vbafont.cxx +++ b/sw/source/ui/vba/vbafont.cxx @@ -111,7 +111,8 @@ public: } -SwVbaFont::SwVbaFont( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPalette, uno::Reference< css::beans::XPropertySet > const & xPropertySet ) : SwVbaFont_BASE( xParent, xContext, xPalette, xPropertySet ) +SwVbaFont::SwVbaFont( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPalette, uno::Reference< css::beans::XPropertySet > const & xPropertySet ) +: SwVbaFont_BASE( xParent, xContext, xPalette, xPropertySet, Component::WORD ) { } @@ -141,14 +142,6 @@ SwVbaFont::getServiceImplName() return "SwVbaFont"; } -void SAL_CALL -SwVbaFont::setColorIndex( const uno::Any&
[Libreoffice-commits] core.git: cui/source vcl/jsdialog
cui/source/dialogs/cuifmsearch.cxx |9 +++-- vcl/jsdialog/enabled.cxx |1 + 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit 36343165c251e30c700360cc5c4266f576d4ac00 Author: Hannah Meeks AuthorDate: Wed Jan 25 11:07:28 2023 + Commit: Szymon Kłos CommitDate: Wed Feb 1 06:27:15 2023 + cui: Make SimilaritySearch dialog async and enable use for jsdialog Change-Id: I89c6665138c94aa355efbbc4aa0947226c68af5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146130 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index f1af2838c4b8..bb3bfaf5cac5 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -312,15 +312,20 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, weld::Button&, rButton, void if (m_ppbApproxSettings.get() == ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); -ScopedVclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), + +VclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); -if (pDlg->Execute() == RET_OK) +pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){ + +if (nResult == RET_OK) { m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); m_pSearchEngine->SetLevOther( pDlg->GetOther() ); m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); } +pDlg->disposeOnce(); +}); } else if (m_pSoundsLikeCJKSettings.get() == ) { diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index e0791954d5f8..c11365d6dcbc 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -39,6 +39,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"cui/ui/numberingformatpage.ui" || rUIFile == u"cui/ui/password.ui" || rUIFile == u"cui/ui/splitcellsdialog.ui" +|| rUIFile == u"cui/ui/similaritysearchdialog.ui" || rUIFile == u"cui/ui/widgettestdialog.ui" // scalc || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - cui/source vcl/jsdialog
cui/source/dialogs/cuifmsearch.cxx |9 +++-- vcl/jsdialog/enabled.cxx |1 + 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit a883f757573182c4f81625abc178edab2b4adf66 Author: Hannah Meeks AuthorDate: Wed Jan 25 11:07:28 2023 + Commit: Michael Meeks CommitDate: Tue Jan 31 14:49:16 2023 + cui: Make SimilaritySearch dialog async and enable use for jsdialog Change-Id: I89c6665138c94aa355efbbc4aa0947226c68af5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146326 Tested-by: Michael Meeks Reviewed-by: Michael Meeks diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index f1af2838c4b8..bb3bfaf5cac5 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -312,15 +312,20 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, weld::Button&, rButton, void if (m_ppbApproxSettings.get() == ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); -ScopedVclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), + +VclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); -if (pDlg->Execute() == RET_OK) +pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){ + +if (nResult == RET_OK) { m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); m_pSearchEngine->SetLevOther( pDlg->GetOther() ); m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); } +pDlg->disposeOnce(); +}); } else if (m_pSoundsLikeCJKSettings.get() == ) { diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index e0791954d5f8..c11365d6dcbc 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -39,6 +39,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"cui/ui/numberingformatpage.ui" || rUIFile == u"cui/ui/password.ui" || rUIFile == u"cui/ui/splitcellsdialog.ui" +|| rUIFile == u"cui/ui/similaritysearchdialog.ui" || rUIFile == u"cui/ui/widgettestdialog.ui" // scalc || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - cui/source vcl/jsdialog
cui/source/dialogs/cuifmsearch.cxx |9 +++-- vcl/jsdialog/enabled.cxx |1 + 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit d6e52da9123a2bb2f08752919596690fa49b72dc Author: Hannah Meeks AuthorDate: Wed Jan 25 11:07:28 2023 + Commit: Michael Meeks CommitDate: Tue Jan 31 10:03:55 2023 + cui: Make SimilaritySearch dialog async and enable use for jsdialog Change-Id: I89c6665138c94aa355efbbc4aa0947226c68af5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146325 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index 18f9cae66536..571ecc80695e 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -311,15 +311,20 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, weld::Button&, rButton, void if (m_ppbApproxSettings.get() == ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); -ScopedVclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), + +VclPtr pDlg(pFact->CreateSvxSearchSimilarityDialog(m_xDialog.get(), m_pSearchEngine->GetLevRelaxed(), m_pSearchEngine->GetLevOther(), m_pSearchEngine->GetLevShorter(), m_pSearchEngine->GetLevLonger() )); -if (pDlg->Execute() == RET_OK) +pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){ + +if (nResult == RET_OK) { m_pSearchEngine->SetLevRelaxed( pDlg->IsRelaxed() ); m_pSearchEngine->SetLevOther( pDlg->GetOther() ); m_pSearchEngine->SetLevShorter(pDlg->GetShorter() ); m_pSearchEngine->SetLevLonger( pDlg->GetLonger() ); } +pDlg->disposeOnce(); +}); } else if (m_pSoundsLikeCJKSettings.get() == ) { diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index bc53c8c3a45c..6969dace6f58 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -39,6 +39,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile) || rUIFile == u"cui/ui/numberingformatpage.ui" || rUIFile == u"cui/ui/password.ui" || rUIFile == u"cui/ui/splitcellsdialog.ui" +|| rUIFile == u"cui/ui/similaritysearchdialog.ui" || rUIFile == u"cui/ui/widgettestdialog.ui" // scalc || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa
sw/qa/core/macros-test.cxx | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) New commits: commit 4995a30bd0720c96ebe48e1f567e0386a9c80d42 Author: Hannah Meeks AuthorDate: Mon Jul 4 16:56:54 2022 +0100 Commit: Miklos Vajna CommitDate: Mon Oct 24 15:05:13 2022 +0200 Re-work extension handling to make tests easier to add. Change-Id: Idddbb99804bdc1354db7a1059c68c820ba6a98b3 Signed-off-by: Hannah Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136943 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141594 Tested-by: Jenkins CollaboraOffice Reviewed-by: Justin Luth diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 91c7a928a46a..f3b10af8a30d 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -64,7 +64,7 @@ class SwMacrosTest : public test::BootstrapFixture, public unotest::MacrosTest public: SwMacrosTest(); -void createFileURL(std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath); +void createFileURL(std::u16string_view aFile, OUString& rFilePath); virtual void setUp() override; virtual void tearDown() override; @@ -94,24 +94,27 @@ private: OUString m_aBaseString; }; -void SwMacrosTest::createFileURL(std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath) +void SwMacrosTest::createFileURL(std::u16string_view aFile, OUString& rFilePath) { -rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileExtension + "/" -+ aFileBase + aFileExtension; +auto i = aFile.find_last_of('.'); +CPPUNIT_ASSERT_MESSAGE("Missing Extension", i != std::string_view::npos); +std::u16string_view aFileExtension = aFile.substr(i+1); + +rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileExtension + "/" + aFile; } void SwMacrosTest::testVba() { TestMacroInfo testInfo[] = { { -OUString("testVba."), +OUString("testVba.doc"), OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic=document") } }; for ( size_t i=0; i xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); OUString sUrl = testInfo[i].sMacroUrl; Any aRet; @@ -203,7 +206,7 @@ void SwMacrosTest::testBookmarkDeleteTdf90816() void SwMacrosTest::testControlShapeGrouping() { OUString aFileName; -createFileURL(u"testControlShapeGrouping.", u"odt", aFileName); +createFileURL(u"testControlShapeGrouping.odt", aFileName); Reference< css::lang::XComponent > xComponent( loadFromDesktop(aFileName, "com.sun.star.text.TextDocument")); @@ -343,7 +346,7 @@ void SwMacrosTest::testFdo55289() void SwMacrosTest::testFdo68983() { OUString aFileName; -createFileURL(u"fdo68983.", u"odt", aFileName); +createFileURL(u"fdo68983.odt", aFileName); Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/dialog.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 70c69ba1c48a42b763dd5426bd4f008d950ad967 Author: Hannah Meeks AuthorDate: Sat Aug 6 11:50:51 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Sat Aug 27 13:17:24 2022 +0200 VBA: make debugging of VBA tests much easier When basic fails it displays a MessageBox - which is immediately cancelled. With this we can easily see what it would have said. Change-Id: Icd0719caa87ede4217fa9731671e36f380cba702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137897 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 9e766060d9f3..91f5a65b4054 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -945,6 +946,12 @@ bool Dialog::ImplStartExecute() SAL_WARN("lok.dialog", "Dialog \"" << ImplGetDialogText(this) << "\" is being synchronously executed over an existing synchronously executing dialog."); } +if (SalInstance::IsRunningUnitTest()) +{ // helps starbasic unit tests show their errors +std::cerr << "Dialog \"" << ImplGetDialogText(this) + << "\"cancelled in silent mode"; +} + SAL_INFO( "vcl", "Dialog \"" << ImplGetDialogText(this)
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/data/docm/testTables.docm |binary sw/qa/core/macros-test.cxx |8 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit aa1e77cd1733ba448eaa04fc1853e47a7dc200b3 Author: Hannah Meeks AuthorDate: Fri Aug 5 10:54:48 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Sat Aug 27 13:16:09 2022 +0200 VBA Add test documents for XTable Change-Id: Ia12c055addda545574c33a55ba758b3f1d5b0b73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137852 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/docm/testTables.docm b/sw/qa/core/data/docm/testTables.docm index a3695f667f1e..5d4502ade055 100644 Binary files a/sw/qa/core/data/docm/testTables.docm and b/sw/qa/core/data/docm/testTables.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 49d5b6ecf586..51b6b4c3cc00 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -113,7 +113,7 @@ void SwMacrosTest::testVba() { OUString("testDocumentRange.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") -} +}, /*{ OUString("testSelectionFind.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") @@ -136,11 +136,11 @@ void SwMacrosTest::testVba() { OUString("testParagraphFormat.docm"), OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") -}, +},*/ { OUString("testTables.docm"), - OUString("vnd.sun.Star.script:Project.ThisDocument.RightPadding?language=Basic=document") -}*/ + OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") +} }; for ( size_t i=0; i
Week 8 - update
Hi, This week I finished off my work on XTable, I added all the padding properties and also added unit conversions to application which I then put in global as well as adding my tests.- https://gerrit.libreoffice.org/c/core/+/137630 https://gerrit.libreoffice.org/c/core/+/137787 https://gerrit.libreoffice.org/c/core/+/137851 https://gerrit.libreoffice.org/c/core/+/137852 I also added a dialogue so that I could more easily see errors - it prints out MsgBox contents for my macros tests if they fail in writer, which is very helpful. - https://gerrit.libreoffice.org/c/core/+/137897 I also had a look at some of my previous XParagraphFormat tests but plan to do some more with this next working week. Hannah
[Libreoffice-commits] core.git: oovbaapi/ooo sw/source
oovbaapi/ooo/vba/word/XGlobals.idl |9 +++ sw/source/ui/vba/vbaglobals.cxx| 45 + sw/source/ui/vba/vbaglobals.hxx| 10 3 files changed, 64 insertions(+) New commits: commit 5fecf10b9ef6e76aa1d06b7ab350abb5a495dda0 Author: Hannah Meeks AuthorDate: Fri Aug 5 10:48:50 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Sat Aug 6 14:16:50 2022 +0200 VBA Add conversion methods to global Change-Id: I920799321f245c015a527c816272c1038cc04544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137851 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oovbaapi/ooo/vba/word/XGlobals.idl b/oovbaapi/ooo/vba/word/XGlobals.idl index 9808187a0d9f..8d2ee3900fcc 100644 --- a/oovbaapi/ooo/vba/word/XGlobals.idl +++ b/oovbaapi/ooo/vba/word/XGlobals.idl @@ -37,6 +37,15 @@ interface XGlobals : com::sun::star::uno::XInterface any Dialogs( [in] any Index ); any ListGalleries( [in] any aIndex ); float CentimetersToPoints([in] float Centimeters ); +float PointsToCentimeters( [in] float Points); +float PixelsToPoints( [in] float Pixels, [in] boolean fVertical ); +float PointsToPixels( [in] float Points, [in] boolean fVertical); +float InchesToPoints( [in] float Inches); +float PointsToInches( [in] float Points); +float MillimetersToPoints( [in] float Millimeters ); +float PointsToMillimeters( [in] float Points); +float PicasToPoints( [in] float Picas); +float PointsToPicas( [in] float Points); }; }; }; }; diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index 0e5db3802895..6492b2628d59 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -129,6 +129,51 @@ float SAL_CALL SwVbaGlobals::CentimetersToPoints( float Centimeters ) return getApplication()->CentimetersToPoints( Centimeters ); } +float SAL_CALL SwVbaGlobals::PointsToCentimeters( float Points ) +{ +return getApplication()->PointsToCentimeters( Points ); +} + +float SAL_CALL SwVbaGlobals::PixelsToPoints( float Pixels, ::sal_Bool fVertical ) +{ +return getApplication()->PixelsToPoints( Pixels, fVertical ); +} + +float SAL_CALL SwVbaGlobals::PointsToPixels( float Points, ::sal_Bool fVertical ) +{ +return getApplication()->PointsToPixels( Points, fVertical ); +} + +float SAL_CALL SwVbaGlobals::InchesToPoints( float Inches ) +{ +return getApplication()->InchesToPoints( Inches ); +} + +float SAL_CALL SwVbaGlobals::PointsToInches( float Points ) +{ +return getApplication()->PointsToInches( Points ); +} + +float SAL_CALL SwVbaGlobals::MillimetersToPoints( float Millimeters ) +{ +return getApplication()->MillimetersToPoints( Millimeters ); +} + +float SAL_CALL SwVbaGlobals::PointsToMillimeters( float Points ) +{ +return getApplication()->PointsToMillimeters( Points ); +} + +float SAL_CALL SwVbaGlobals::PicasToPoints( float Picas ) +{ +return getApplication()->PicasToPoints( Picas ); +} + +float SAL_CALL SwVbaGlobals::PointsToPicas( float Points ) +{ +return getApplication()->PointsToPicas( Points ); +} + OUString SwVbaGlobals::getServiceImplName() { diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx index 1d8c0b4f8a2a..af26f1b6256d 100644 --- a/sw/source/ui/vba/vbaglobals.hxx +++ b/sw/source/ui/vba/vbaglobals.hxx @@ -56,6 +56,16 @@ public: virtual css::uno::Any SAL_CALL Dialogs(const css::uno::Any& aIndex) override; virtual css::uno::Any SAL_CALL ListGalleries(const css::uno::Any& aIndex) override; virtual float SAL_CALL CentimetersToPoints(float Centimeters) override; +virtual float SAL_CALL PointsToCentimeters(float Points) override; +virtual float SAL_CALL PixelsToPoints(float Pixels, ::sal_Bool fVertical) override; +virtual float SAL_CALL PointsToPixels(float Pixels, ::sal_Bool fVertical) override; +virtual float SAL_CALL InchesToPoints(float Inches) override; +virtual float SAL_CALL PointsToInches(float Points) override; +virtual float SAL_CALL MillimetersToPoints(float Millimeters) override; +virtual float SAL_CALL PointsToMillimeters(float Points) override; +virtual float SAL_CALL PicasToPoints(float Picas) override; +virtual float SAL_CALL PointsToPicas(float Points) override; + // XMultiServiceFactory virtual css::uno::Sequence SAL_CALL getAvailableServiceNames() override;
[Libreoffice-commits] core.git: oovbaapi/ooo sw/qa sw/source
oovbaapi/ooo/vba/word/XTable.idl |5 ++ sw/qa/core/macros-test.cxx | 11 ++--- sw/source/ui/vba/vbatable.cxx| 85 ++- sw/source/ui/vba/vbatable.hxx| 10 sw/source/ui/vba/vbatables.cxx |4 + 5 files changed, 107 insertions(+), 8 deletions(-) New commits: commit f3234f4f14702da71528561418f07ee6670a8c2a Author: Hannah Meeks AuthorDate: Sat Jul 30 11:11:06 2022 +0100 Commit: Michael Meeks CommitDate: Fri Aug 5 12:06:26 2022 +0200 VBA Add Padding properties to XTable Change-Id: I021ad15b81ce55c4f9e9e9b515be1ddaaca8d07d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137630 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/oovbaapi/ooo/vba/word/XTable.idl b/oovbaapi/ooo/vba/word/XTable.idl index 0ce702c7e613..683e859e4040 100644 --- a/oovbaapi/ooo/vba/word/XTable.idl +++ b/oovbaapi/ooo/vba/word/XTable.idl @@ -54,6 +54,11 @@ interface XTable any Rows([in] any aIndex ); any Columns([in] any aIndex ); + +[attribute] double BottomPadding; +[attribute] double LeftPadding; +[attribute] double RightPadding; +[attribute] double TopPadding; }; }; }; }; diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 02d097a2a8bb..49d5b6ecf586 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -113,17 +113,18 @@ void SwMacrosTest::testVba() { OUString("testDocumentRange.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") -}, +} /*{ OUString("testSelectionFind.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") -},*/ +}, { //current working tests here! + OUString("testFontColor.docm"), OUString("vnd.sun.Star.script:Project.ThisDocument.testAll?language=Basic=document") } -/* TODO - make these pass in Writer +// TODO - make these pass in Writer { OUString("testSentences.docm"), OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") @@ -138,8 +139,8 @@ void SwMacrosTest::testVba() }, { OUString("testTables.docm"), - OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") -},*/ + OUString("vnd.sun.Star.script:Project.ThisDocument.RightPadding?language=Basic=document") +}*/ }; for ( size_t i=0; i #include #include +#include +#include #include "vbaborders.hxx" #include "vbapalette.hxx" #include "vbarows.hxx" #include "vbacolumns.hxx" +#include "vbaapplication.hxx" + +#include + +#include using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -70,7 +77,7 @@ SwVbaTable::Delete( ) } OUString SAL_CALL -SwVbaTable::getName() +SwVbaTable::getName( ) { uno::Reference< container::XNamed > xNamed( mxTextTable, uno::UNO_QUERY_THROW ); return xNamed->getName(); @@ -87,6 +94,82 @@ SwVbaTable::Borders( const uno::Any& index ) return uno::Any( xCol ); } +double SAL_CALL +SwVbaTable::getBottomPadding() +{ +uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); +table::TableBorderDistances aTableBorderDistances; +xPropertySet->getPropertyValue("TableBorderDistances") >>= aTableBorderDistances; +return convertMm100ToPoint(aTableBorderDistances.BottomDistance); +} + +void SAL_CALL +SwVbaTable::setBottomPadding( double fValue ) +{ +uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); +table::TableBorderDistances aTableBorderDistances; +aTableBorderDistances.IsBottomDistanceValid = true; +aTableBorderDistances.BottomDistance = convertPointToMm100(fValue); +xPropertySet->setPropertyValue( "TableBorderDistances", uno::Any( aTableBorderDistances ) ); +} + +double SAL_CALL +SwVbaTable::getLeftPadding() +{ +uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); +table::TableBorderDistances aTableBorderDistances; +xPropertySet->getPropertyValue("TableBorderDistances") >>= aTableBorderDistances; +return convertMm100ToPoint(aTableBorderDistances.LeftDistance); +} + +void SAL_CALL +SwVbaTable::setLeftPadding( double fValue ) +{ +uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); +table::TableBorderDistances aTableBorderDistances; +aTableBorderDistances.IsLeftDistanceValid = true; +aTableBorderDistances.LeftDistance = convertPoi
[Libreoffice-commits] core.git: oovbaapi/ooo sw/source
oovbaapi/ooo/vba/word/XApplication.idl | 11 + sw/source/ui/vba/vbaapplication.cxx| 61 - sw/source/ui/vba/vbaapplication.hxx| 12 ++ 3 files changed, 82 insertions(+), 2 deletions(-) New commits: commit c9b57b7226de7062b9feaf7706825f6dc2a6fee8 Author: Hannah Meeks AuthorDate: Thu Aug 4 09:45:22 2022 +0100 Commit: Michael Meeks CommitDate: Fri Aug 5 12:06:59 2022 +0200 VBA Add conversion methods to Application Change-Id: Ic0de06699a647565deca7985742965a72614df16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137787 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Michael Meeks diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl index 257903eb47f2..0475c2d82829 100644 --- a/oovbaapi/ooo/vba/word/XApplication.idl +++ b/oovbaapi/ooo/vba/word/XApplication.idl @@ -52,7 +52,16 @@ interface XApplication : XConnectable any Addins( [in] any Index ); any Dialogs( [in] any Index ); any ListGalleries( [in] any aIndex ); -float CentimetersToPoints([in] float Centimeters ); +float CentimetersToPoints( [in] float Centimeters ); +float PointsToCentimeters( [in] float Points); +float PixelsToPoints( [in] float Pixels, [in] boolean fVertical ); +float PointsToPixels( [in] float Points, [in] boolean fVertical); +float InchesToPoints( [in] float Inches); +float PointsToInches( [in] float Points); +float MillimetersToPoints( [in] float Millimeters ); +float PointsToMillimeters( [in] float Points); +float PicasToPoints( [in] float Picas); +float PointsToPicas( [in] float Points); void ShowMe(); void Resize( [in] long Width, [in] long Height ); void Move( [in] long Left, [in] long Top ); diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx index 1cab0573121a..c95c855c01fd 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include "vbaapplication.hxx" #include "vbadocument.hxx" @@ -417,9 +418,67 @@ float SAL_CALL SwVbaApplication::CentimetersToPoints( float Centimeters ) return VbaApplicationBase::CentimetersToPoints( Centimeters ); } +float SAL_CALL SwVbaApplication::PointsToCentimeters( float Points ) +{ +return o3tl::convert(Points, o3tl::Length::pt, o3tl::Length::cm); +} + +float SAL_CALL SwVbaApplication::PixelsToPoints( float Pixels, ::sal_Bool fVertical ) +{ +//Set up xDevice +uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); +uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); +uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); +uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); +css::uno::Reference< css::awt::XDevice > xDevice( xWindow, css::uno::UNO_QUERY ); + +return ooo::vba::PixelsToPoints(xDevice, Pixels, fVertical); +} + +float SAL_CALL SwVbaApplication::PointsToPixels( float Pixels, ::sal_Bool fVertical ) +{ +uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); +uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); +uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); +uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); +css::uno::Reference< css::awt::XDevice > xDevice( xWindow, css::uno::UNO_QUERY ); + +return ooo::vba::PointsToPixels(xDevice, Pixels, fVertical); +} + +float SAL_CALL SwVbaApplication::InchesToPoints( float Inches ) +{ +return o3tl::convert(Inches, o3tl::Length::ch, o3tl::Length::pt); +} + +float SAL_CALL SwVbaApplication::PointsToInches( float Points ) +{ +return o3tl::convert(Points, o3tl::Length::pt, o3tl::Length::ch); +} + +float SAL_CALL SwVbaApplication::MillimetersToPoints( float Millimeters ) +{ +return o3tl::convert(Millimeters, o3tl::Length::mm, o3tl::Length::pt); +} + +float SAL_CALL SwVbaApplication::PointsToMillimeters( float Points ) +{ +return o3tl::convert(Points, o3tl::Length::pt, o3tl::Length::mm); +} + +float SAL_CALL SwVbaApplication::PicasToPoints( float Picas ) +{ +return o3tl::convert(Picas, o3tl::Length::pc, o3tl::Length::pt); +} + +float SAL_CALL SwVbaApplication::PointsToPicas( float Points ) +{ +return o3tl::convert(Points, o3tl::Length::pt, o3tl::Length::pc); +} + void SAL_CALL SwVbaApplication::ShowMe() { -// No idea what we should or could do +// Method no longer supported in word - deprecated } void SAL_CALL SwVbaApplication::Resize( sal_Int32 Width, sal_Int32 Height ) diff --g
Week 7 - update
Hi, This week I focused on Xtable, I then ended up getting stuck on table styles for a few days, I was trying to implement Table.ApplyStyleHeadingRows ( https://docs.microsoft.com/en-us/office/vba/api/word.table.applystyleheadingrows) because there are a lot of similar style properties in word. I found this really hard because there were only a few methods in vbatable & vbatablehelper so I had to look into the core. I used XRay to try and make my own style but I couldn't work out how to do this with the headings. I ended up reading lots of code and help online but in the end I had to give up because I couldn't find the table styles uno interface so it was much too hard. I then had a look at adding RightPadding - https://gerrit.libreoffice.org/c/core/+/137630, however this needs to be cleaned and tested. Next week I plan to look at the points to pixels and make sure that the measurements line up with ms as well as to run my tests for XTable and try to make these pass for the border distances. Once RightPadding is complete it shouldn't be too hard to copy these for LeftPadding etc.. ( https://docs.microsoft.com/en-us/office/vba/api/word.table.leftpadding). Hannah
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/data/docm/testFontColor.docm |binary sw/qa/core/macros-test.cxx |9 + sw/source/ui/vba/vbafont.cxx|4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) New commits: commit 78071a36def92096920a0441b5fdac0fdd5a7c8e Author: Hannah Meeks AuthorDate: Sat Jul 23 18:24:31 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Sun Jul 24 08:18:20 2022 +0200 VBA Fix Color mapping issues wdRed should retrun wdRed etc. Change-Id: I5ae359c8b5ec9c34ddd2fd18894bd860384b3cc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137383 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/docm/testFontColor.docm b/sw/qa/core/data/docm/testFontColor.docm new file mode 100755 index ..8e43601cf6d3 Binary files /dev/null and b/sw/qa/core/data/docm/testFontColor.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index dd612ae509d8..0bc278d8d688 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -113,6 +113,15 @@ void SwMacrosTest::testVba() { OUString("testDocumentRange.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") +}, +/*{ +OUString("testSelectionFind.docm"), + OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") +},*/ +{ +//current working tests here! +OUString("testFontColor.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.testAll?language=Basic=document") } /* TODO - make these pass in Writer { diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx index c36efb4c471f..e7a1f30a1381 100644 --- a/sw/source/ui/vba/vbafont.cxx +++ b/sw/source/ui/vba/vbafont.cxx @@ -146,7 +146,7 @@ SwVbaFont::setColorIndex( const uno::Any& _colorindex ) { sal_Int32 nIndex = 0; _colorindex >>= nIndex; -return setColor( OORGBToXLRGB(mxPalette->getByIndex( nIndex )) ); +return setColor( mxPalette->getByIndex( nIndex ) ); } uno::Any SAL_CALL @@ -154,7 +154,7 @@ SwVbaFont::getColorIndex() { sal_Int32 nColor = 0; -XLRGBToOORGB( getColor() ) >>= nColor; +getColor() >>= nColor; sal_Int32 nElems = mxPalette->getCount(); sal_Int32 nIndex = 0; for ( sal_Int32 count=0; count
Week 6 - update
Hi, This week I had a look at Document and fixed the off by one error in setting the range :https://gerrit.libreoffice.org/c/core/+/137262. I also rewrote the loop with an exception so that the range could not longer be wrapped around the text (start could not be larger than end) for compatibility with word. The range should behave in the same way as the selection in that the selection should select all the text if nothing selected (fixed this this week: https://gerrit.libreoffice.org/c/core/+/137202/5). My test for this with the range fails because word inserts a new line here which doesn't happen in writer, I plan to look at this within the next few weeks and add the test. I ended up looking into Font.Color as one of my XFind tests used this and it didn't work. Got a bit confused to start with when writing my macros tests because I chose a color that had been (mostly) removed from ms! - wdClassicBlue - interestingly you could still set the ColorIndex to this but it returned wdBlack. There was a problem with the color mapping for a few sets of numbers because they were being mapped twice so I changed this: https://gerrit.libreoffice.org/c/core/+/137383 In word when setting the Color to a random value and returning the ColorIndex the ColorIndex closest to that value is returned but in writer wdAuto is returned. I aim to start next week by changing this if it doesn't take too long. In word when the first letter of a word is capitalised this is also caps when replaced using Find, I had a look at trying to add this function but writer seems to be missing it completely. Mostly finished with my XFind tests but will hopefully be able to add the rest when the color and new-line issues are resolved. Next week I will focus on looking at XTable and XParagraphFormat, trying to make my tests for these objects pass in order to cover different parts of the api. Hannah
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/data/docm/testDocumentRange.docm |binary sw/qa/core/data/docm/testFind.docm |binary sw/qa/core/macros-test.cxx |4 +++ sw/source/ui/vba/vbadocument.cxx| 30 +++- 4 files changed, 25 insertions(+), 9 deletions(-) New commits: commit 4205fb723144e825ae75e977034a6df1a99f4881 Author: Hannah Meeks AuthorDate: Wed Jul 20 13:33:26 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jul 20 22:45:18 2022 +0200 VBA Fix off by one error in setting range xEnd should not be smaller than xStart for compatibility Add first Document tests Change-Id: Ia8898d79db8c2885c6253ee9aaca793082b9dd20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137262 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/docm/testDocumentRange.docm b/sw/qa/core/data/docm/testDocumentRange.docm new file mode 100755 index ..f1d5b328c383 Binary files /dev/null and b/sw/qa/core/data/docm/testDocumentRange.docm differ diff --git a/sw/qa/core/data/docm/testFind.docm b/sw/qa/core/data/docm/testFind.docm old mode 100644 new mode 100755 index 115fb95b3259..afcba6f0e5d0 Binary files a/sw/qa/core/data/docm/testFind.docm and b/sw/qa/core/data/docm/testFind.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 147e10dda222..dd612ae509d8 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -109,6 +109,10 @@ void SwMacrosTest::testVba() { OUString("testFind.docm"), OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") +}, +{ +OUString("testDocumentRange.docm"), + OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") } /* TODO - make these pass in Writer { diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 4a1a8dd8a2ae..79faf58fe4ab 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -137,22 +137,34 @@ SwVbaDocument::Range( const uno::Any& rStart, const uno::Any& rEnd ) sal_Int32 nEnd = 0; rStart >>= nStart; rEnd >>= nEnd; -nStart--; -nEnd--; uno::Reference< text::XTextRange > xStart; uno::Reference< text::XTextRange > xEnd; -if( nStart != -1 || nEnd != -1 ) -{ -if( nStart == -1 ) -xStart = mxTextDocument->getText()->getStart(); -else -xStart = SwVbaRangeHelper::getRangeByPosition( mxTextDocument->getText(), nStart ); -if( nEnd == -1 ) +if( nStart > nEnd) + throw uno::RuntimeException(); + +if( nEnd != 0) +{ +if( nEnd == nStart ) +{ +xStart = mxTextDocument->getText()->getEnd(); xEnd = mxTextDocument->getText()->getEnd(); +} else +{ xEnd = SwVbaRangeHelper::getRangeByPosition( mxTextDocument->getText(), nEnd ); + +if( nStart != 0 ) +xStart = SwVbaRangeHelper::getRangeByPosition( mxTextDocument->getText(), nStart ); +else +xStart = mxTextDocument->getText()->getStart(); +} +} +else +{ +xStart = mxTextDocument->getText()->getEnd(); +xEnd = mxTextDocument->getText()->getEnd(); } if( !xStart.is() && !xEnd.is() )
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/data/docm/testFind.docm |binary sw/qa/core/macros-test.cxx |4 ++-- sw/source/ui/vba/vbaselection.cxx |9 + 3 files changed, 11 insertions(+), 2 deletions(-) New commits: commit f6d45f07fcbb33ce542f128caf90064a85a91d31 Author: Hannah Meeks AuthorDate: Mon Jul 18 16:35:28 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jul 20 22:44:28 2022 +0200 VBA: Selection.Find should select whole doc if no prior selection. Change-Id: I8b77ae982a772a95290aea186f4fe6556f2a2e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137202 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/docm/testFind.docm b/sw/qa/core/data/docm/testFind.docm index a0a316685b79..115fb95b3259 100644 Binary files a/sw/qa/core/data/docm/testFind.docm and b/sw/qa/core/data/docm/testFind.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index e412cdd03430..147e10dda222 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -107,8 +107,8 @@ void SwMacrosTest::testVba() { TestMacroInfo testInfo[] = { { - OUString("testFind.docm"), - OUString("vnd.sun.Star.script:Project.Module1.testFind?language=Basic=document") +OUString("testFind.docm"), + OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic=document") } /* TODO - make these pass in Writer { diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx index 43da7dc6af48..18554fad1b5c 100644 --- a/sw/source/ui/vba/vbaselection.cxx +++ b/sw/source/ui/vba/vbaselection.cxx @@ -519,6 +519,15 @@ uno::Reference< word::XFind > SAL_CALL SwVbaSelection::getFind() { uno::Reference< text::XTextRange > xTextRange = GetSelectedRange(); +uno::Reference< text::XTextRange > xStart = xTextRange->getStart(); +uno::Reference< text::XTextRange > xEnd = xTextRange->getEnd(); +uno::Reference< text::XTextRangeCompare > xTRC( xTextRange->getText(), uno::UNO_QUERY_THROW ); +int n = xTRC->compareRegionStarts( xStart, xEnd); +if( n == 0 ) +{ +WholeStory(); +xTextRange = GetSelectedRange(); +} return SwVbaFind::GetOrCreateFind(this, mxContext, mxModel, xTextRange); }
[Libreoffice-commits] core.git: oovbaapi/ooo sw/source
oovbaapi/ooo/vba/word/XDocument.idl |1 + sw/source/ui/vba/vbadocument.cxx|8 sw/source/ui/vba/vbadocument.hxx|1 + 3 files changed, 10 insertions(+) New commits: commit 4a49644c97c0f2c3e14a931592f28044a8596425 Author: Hannah Meeks AuthorDate: Fri Jul 15 18:55:41 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jul 20 14:46:37 2022 +0200 VBA: Add Select Method to ActiveDocument Change-Id: I0d8d02c555fd113b96661085b339b12d83c6010f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137109 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oovbaapi/ooo/vba/word/XDocument.idl b/oovbaapi/ooo/vba/word/XDocument.idl index d9717a7eea0c..0f7b5f994aa1 100644 --- a/oovbaapi/ooo/vba/word/XDocument.idl +++ b/oovbaapi/ooo/vba/word/XDocument.idl @@ -43,6 +43,7 @@ interface XDocument any Tables( [in] any Index ); any Fields( [in] any Index ); any Shapes( [in] any Index ); +void Select(); any Sections( [in] any Index ); void Activate(); any PageSetup(); diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 92251ef36da2..4a1a8dd8a2ae 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -255,6 +255,14 @@ SwVbaDocument::Shapes( const uno::Any& index ) return uno::Any( xCol ); } +void SAL_CALL +SwVbaDocument::Select() +{ +auto xRange = getContent(); +if ( xRange ) +xRange->Select(); +} + uno::Any SAL_CALL SwVbaDocument::Sections( const uno::Any& index ) { diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx index 0d213690a982..f1352e44f625 100644 --- a/sw/source/ui/vba/vbadocument.hxx +++ b/sw/source/ui/vba/vbadocument.hxx @@ -63,6 +63,7 @@ public: virtual css::uno::Any SAL_CALL Tables( const css::uno::Any& aIndex ) override; virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) override; virtual css::uno::Any SAL_CALL Shapes( const css::uno::Any& aIndex ) override; +virtual void SAL_CALL Select() override; virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) override; virtual void SAL_CALL Activate() override; virtual css::uno::Any SAL_CALL PageSetup() override;
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/data/docm/testParagraphFormat.docm |binary sw/qa/core/data/docm/testSentences.docm |binary sw/qa/core/data/docm/testTables.docm |binary sw/qa/core/data/docm/testWords.docm |binary sw/qa/core/macros-test.cxx| 18 ++ 5 files changed, 18 insertions(+) New commits: commit 4d945a41bc15412b20490535ac322b01953b64b6 Author: Hannah Meeks AuthorDate: Fri Jul 15 13:54:28 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jul 20 14:44:23 2022 +0200 VBA: Add test documents for vba Mostly disabled for now pending core fixing Change-Id: Idf71cea820c52f2b56fb26b1d8de2666026bf90e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137105 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/docm/testParagraphFormat.docm b/sw/qa/core/data/docm/testParagraphFormat.docm new file mode 100755 index ..ce638946e2b8 Binary files /dev/null and b/sw/qa/core/data/docm/testParagraphFormat.docm differ diff --git a/sw/qa/core/data/docm/testSentences.docm b/sw/qa/core/data/docm/testSentences.docm new file mode 100755 index ..5275307ddb02 Binary files /dev/null and b/sw/qa/core/data/docm/testSentences.docm differ diff --git a/sw/qa/core/data/docm/testTables.docm b/sw/qa/core/data/docm/testTables.docm new file mode 100755 index ..a3695f667f1e Binary files /dev/null and b/sw/qa/core/data/docm/testTables.docm differ diff --git a/sw/qa/core/data/docm/testWords.docm b/sw/qa/core/data/docm/testWords.docm new file mode 100755 index ..b88416bb77ed Binary files /dev/null and b/sw/qa/core/data/docm/testWords.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 50ca4744a761..e412cdd03430 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -110,6 +110,24 @@ void SwMacrosTest::testVba() OUString("testFind.docm"), OUString("vnd.sun.Star.script:Project.Module1.testFind?language=Basic=document") } +/* TODO - make these pass in Writer +{ +OUString("testSentences.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") +}, +{ +OUString("testWords.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") +}, +{ +OUString("testParagraphFormat.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") +}, +{ +OUString("testTables.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.TestAll?language=Basic=document") +},*/ + }; for ( size_t i=0; i
[Libreoffice-commits] core.git: solenv/gbuild
solenv/gbuild/CppunitTest.mk |2 +- solenv/gbuild/PythonTest.mk |2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit 5eb4c5e93b0f0a3fd9cded5e086086d07cb7c92d Author: Hannah Meeks AuthorDate: Mon Jul 18 16:42:37 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Jul 18 20:22:03 2022 +0200 Mend python support for lldb cppunit tests. Change-Id: I02f4872ac75d82f2d77c1854ce040b72883b484a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137204 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index cae6e2a2f9be..821d1d6f2c74 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -137,7 +137,7 @@ else $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ $(if $(strip $(PYTHON_URE)),\ PYTHONDONTWRITEBYTECODE=1) \ - $(if $(strip $(CPPUNITTRACE)),\ + $(if $(filter gdb,$(CPPUNITTRACE)),\ PYTHONWARNINGS=default) \ $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \ $(gb_CppunitTest_CPPTESTCOMMAND) \ diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk index 4e81261d2354..09f039771895 100644 --- a/solenv/gbuild/PythonTest.mk +++ b/solenv/gbuild/PythonTest.mk @@ -60,6 +60,8 @@ else TestUserDir="$(call gb_Helper_make_url,$(dir $(call gb_PythonTest_get_target,$*)))" \ PYTHONDONTWRITEBYTECODE=1 \ $(gb_TEST_ENV_VARS) \ + $(if $(filter gdb,$(CPPUNITTRACE)),\ + PYTHONWARNINGS=default) \ $(ICECREAM_RUN) $(gb_PythonTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \ $(gb_PythonTest_COMMAND) \ $(if $(PYTHON_TEST_NAME),$(PYTHON_TEST_NAME),$(MODULES)) \
Week 5 - update
Hi, This week I managed to finish making the framework in order to run my tests - https://gerrit.libreoffice.org/c/core/+/136943 Still had some problems with the debugger but this was resolved after moving the python warnings around - https://gerrit.libreoffice.org/c/core/+/137032 One of the most useful things I did was in vcl/source/window/dialog.cxx - Dialog::ImplStartExecute - where I swapped the dialog "cancelled in silent mode" to a SAL_DEBUG so that I can see basic errors. This would be good to have on all unit tests so that when they fail randomly there is a clear reason why. Managed to upload most of my macros tests and try these in writer, two objects - Word and Sentence are not implemented in writer so the plan is to do this at some point in the next few weeks then run the tests - https://gerrit.libreoffice.org/c/core/+/137105 Testing with ParagraphFormat lots of properties/attributes are missing so will try to add some of those next week in order for tests to pass. Had some problems with ActiveDocument.Select not working in writer so fixed this by adding the select method to the Document object - https://gerrit.libreoffice.org/c/core/+/137109 I updated XRange to include Find - https://gerrit.libreoffice.org/c/core/+/137004 Got a bit confused with what was happening with the selection on the find object so wrote some more tests to look at this in word - seemingly Selection.Find.Execute creates the selection (if nothing was selected previously) or it makes a range to do the find and replace on and then returns a new selection depending on find settings. I tried to have a look at this in sw/source/ui/vba/vbaselection.cxx but hopefully will fix it by next week. Hannah
[Libreoffice-commits] core.git: solenv/gbuild
solenv/gbuild/CppunitTest.mk |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 7a4814f717520b8de8c963dc2d576f05fc15d2e9 Author: Hannah Meeks AuthorDate: Wed Jul 13 14:45:37 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Jul 14 10:20:35 2022 +0200 Change make file so that debugging works - Previous error: hannah@localhost:~/master/sw> make CppunitTest_sw_macros_test CPPUNITTRACE="gdb --args" [CUT] sw_macros_test S=/data/opt/libreoffice/master && I=$S/instdir && W=$S/workdir && mkdir -p $W/CppunitTest/ && rm -fr $W/CppunitTest/sw_macros_test.test.user && cp -r $W/unittest $W/CppunitTest/sw_macros_test.test.user && ( MAX_CONCURRENCY=4 MOZILLA_CERTIFICATE_FOLDER=dbm: SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1 SAL_USE_VCLPLUGIN=svp LIBO_LANG=C icerun PYTHONWARNINGS=default gdb -return-child-result -ex "add-auto-load-safe-path $S/instdir" -ex "set environment LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program":$W/UnpackedTarball/cppunit/src/cppunit/.libs" -ex 'set environment MALLOC_CHECK_=2; set environment MALLOC_PERTURB_=153' --args $W/LinkTarget/Executable/cppunittester $W/LinkTarget/CppunitTest/libtest_sw_macros_test.so --headless "-env:BRAND_BASE_DIR=file://$S/instdir" "-env:BRAND_SHARE_SUBDIR=share" "-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource" "-env:UserInstallation=file://$W/CppunitTest/sw_macros_test.test.user" "-env:CONFIGURATION_LAY ERS=xcsxcu:file://$I/share/registry xcsxcu:file://$W/unittest/registry" "-env:UNO_TYPES=file://$I/program/types/offapi.rdb file://$I/program/types/oovbaapi.rdb file://$I/program/types.rdb" "-env:UNO_SERVICES=file://$W/Rdb/ure/services.rdb file://$W/Rdb/services.rdb" -env:URE_BIN_DIR=file://$I/program -env:URE_INTERNAL_LIB_DIR=file://$I/program -env:LO_LIB_DIR=file://$I/program -env:LO_JAVA_DIR=file://$I/program/classes --protector $W/LinkTarget/Library/unoexceptionprotector.so unoexceptionprotector --protector $W/LinkTarget/Library/unobootstrapprotector.so unobootstrapprotector --protector $W/LinkTarget/Library/libvclbootstrapprotector.so vclbootstrapprotector "-env:CPPUNITTESTTARGET=$W/CppunitTest/sw_macros_test.test" ) ICECC[448] 2022-07-13 13:23:02: couldn't find any PYTHONWARNINGS=default ICECC[448] 2022-07-13 13:23:02: could not find PYTHONWARNINGS=default in PATH. make: *** [/data/opt/libreoffice/master/solenv/gbuild/CppunitTest.mk:121: /data/opt/libreoffice/master/workdir/CppunitTest/sw_macros_test.test] Error 115 hannah@localhost:~/master/sw> Change-Id: Idebbd385f70edd9b691d91f6eded8ee02ac9cce7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 7900c8f05ac5..cae6e2a2f9be 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -26,10 +26,10 @@ ifneq ($(strip $(CPPUNITTRACE)),) ifneq ($(filter gdb,$(CPPUNITTRACE)),) # sneak (a) setting the LD_LIBRARY_PATH, and (b) setting malloc debug flags, into the "gdb --args" command line gb_CppunitTest_GDBTRACE := $(subst gdb,\ - PYTHONWARNINGS=default gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\ + gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\ $(CPPUNITTRACE)) gb_PythonTest_GDBTRACE := $(subst gdb,\ - PYTHONWARNINGS=default gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_PythonTest_PRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\ + gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_PythonTest_PRECOMMAND))" $(if $(PYTHONWARNINGS),-ex 'set environment PYTHONWARNINGS $(PYTHONWARNINGS)') $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\ $(CPPUNITTRACE)) else ifneq ($(filter lldb,$(CPPUNITTRACE)),) gb_CppunitTest_GDBTRACE := $(subst lldb,\ @@ -137,6 +137,8 @@ else $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ $(if $
[Libreoffice-commits] core.git: oovbaapi/ooo sw/source
oovbaapi/ooo/vba/word/XRange.idl |2 ++ sw/source/ui/vba/vbarange.hxx|4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) New commits: commit febfbaff07562dd68bc2b5bc870699754f763e50 Author: Hannah Meeks AuthorDate: Tue Jul 12 17:15:17 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Jul 14 10:19:57 2022 +0200 The DefaultPropertyName for range is tex Change-Id: I0e5f1ae0757a2ad8f58f011df435c30c577d8a79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137006 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oovbaapi/ooo/vba/word/XRange.idl b/oovbaapi/ooo/vba/word/XRange.idl index ea5e05d2a497..3b51db78ca3e 100644 --- a/oovbaapi/ooo/vba/word/XRange.idl +++ b/oovbaapi/ooo/vba/word/XRange.idl @@ -28,6 +28,8 @@ interface XListFormat; interface XRange { interface ooo::vba::XHelperInterface; +interface com::sun::star::script::XDefaultProperty; + [attribute] string Text; [attribute] XParagraphFormat ParagraphFormat; diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx index 38e2631e40fe..ee8ed621bb8c 100644 --- a/sw/source/ui/vba/vbarange.hxx +++ b/sw/source/ui/vba/vbarange.hxx @@ -67,11 +67,13 @@ public: virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) override; virtual css::uno::Any SAL_CALL getStyle() override; virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) override; - virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override; virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() override; virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override; +//XDefaultProperty +virtual OUString SAL_CALL getDefaultPropertyName() override { return "Text"; } + // Methods virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType) override; virtual void SAL_CALL Select() override;
[Libreoffice-commits] core.git: oovbaapi/ooo sw/source
oovbaapi/ooo/vba/word/XRange.idl |3 +++ sw/source/ui/vba/vbarange.cxx|9 + sw/source/ui/vba/vbarange.hxx|3 +++ 3 files changed, 15 insertions(+) New commits: commit 0b5df6634a2021986b0de2ab12a41c0d4af4f60c Author: Hannah Meeks AuthorDate: Tue Jul 12 15:47:03 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Jul 14 10:19:31 2022 +0200 tdf#149963 - XFind not a property/attribute of XRange Updated XRange to include XFind Change-Id: If9570fbb5de8d14063a72a4c4c55fcfd491dd496 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137004 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/oovbaapi/ooo/vba/word/XRange.idl b/oovbaapi/ooo/vba/word/XRange.idl index fa0bf5e6d718..ea5e05d2a497 100644 --- a/oovbaapi/ooo/vba/word/XRange.idl +++ b/oovbaapi/ooo/vba/word/XRange.idl @@ -23,6 +23,7 @@ module ooo { module vba { module word { interface XParagraphFormat; interface XStyle; interface XFont; +interface XFind; interface XListFormat; interface XRange { @@ -35,6 +36,8 @@ interface XRange // Of course Font is NOT readonly, #FIXME #TODO // readonly though will force an error attempting to write [attribute, readonly] XFont Font; +[attribute, readonly] XFind Find; + [attribute] long LanguageID; [attribute] long Start; [attribute] long End; diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx index eaa7cac51c3b..8803b067316b 100644 --- a/sw/source/ui/vba/vbarange.cxx +++ b/sw/source/ui/vba/vbarange.cxx @@ -29,6 +29,7 @@ #include "vbaparagraphformat.hxx" #include "vbastyle.hxx" #include "vbafont.hxx" +#include "vbafind.hxx" #include "vbapalette.hxx" #include "vbapagesetup.hxx" #include "vbalistformat.hxx" @@ -297,6 +298,14 @@ SwVbaRange::getFont() return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), uno::Reference< beans::XPropertySet >( getXTextRange(), uno::UNO_QUERY_THROW ) ); } +uno::Reference< word::XFind > SAL_CALL +SwVbaRange::getFind() +{ +uno::Reference< text::XTextRange > xTextRange = getXTextRange(); +uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); +return SwVbaFind::GetOrCreateFind(this, mxContext, xModel, xTextRange); +} + uno::Reference< word::XListFormat > SAL_CALL SwVbaRange::getListFormat() { diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx index d311c25a70c9..38e2631e40fe 100644 --- a/sw/source/ui/vba/vbarange.hxx +++ b/sw/source/ui/vba/vbarange.hxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,9 @@ public: virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) override; virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override; +virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() override; virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override; + // Methods virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType) override; virtual void SAL_CALL Select() override;
[Libreoffice-commits] core.git: sw/qa
dev/null |binary sw/qa/core/data/docm/testFind.docm |binary sw/qa/core/macros-test.cxx | 10 +- 3 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 72f631977435a704008a55d3be6489ba619e3064 Author: Hannah Meeks AuthorDate: Sat Jul 9 23:10:26 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Jul 13 08:32:16 2022 +0200 add first writer vba test - for find behavior Change-Id: I25136c7954339d79521f84ad9eca79a701930fdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136944 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/core/data/doc/testVba.doc b/sw/qa/core/data/doc/testVba.doc deleted file mode 100644 index e8c87c6eec5b.. Binary files a/sw/qa/core/data/doc/testVba.doc and /dev/null differ diff --git a/sw/qa/core/data/docm/testFind.docm b/sw/qa/core/data/docm/testFind.docm new file mode 100755 index ..a0a316685b79 Binary files /dev/null and b/sw/qa/core/data/docm/testFind.docm differ diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 282fa5d618bf..50ca4744a761 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -107,8 +107,8 @@ void SwMacrosTest::testVba() { TestMacroInfo testInfo[] = { { -OUString("testVba.doc"), - OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic=document") + OUString("testFind.docm"), + OUString("vnd.sun.Star.script:Project.Module1.testFind?language=Basic=document") } }; for ( size_t i=0; i>= aStringRes; -// CPPUNIT_ASSERT_EQUAL(OUString("OK"), aStringRes); +CPPUNIT_ASSERT(aRet >>= aStringRes); +CPPUNIT_ASSERT_EQUAL(OUString("OK"), aStringRes); pFoundShell->DoClose(); } }
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/doc.hxx|7 +++ sw/source/core/doc/docnew.cxx |2 ++ sw/source/ui/vba/vbafind.cxx | 30 -- sw/source/ui/vba/vbafind.hxx |5 +++-- sw/source/ui/vba/vbaselection.cxx |3 ++- 5 files changed, 42 insertions(+), 5 deletions(-) New commits: commit f6be2bf969bac1f5c6ac452b313374ba09ffaa58 Author: Hannah Meeks AuthorDate: Wed Jun 29 16:27:17 2022 +0100 Commit: Tomaž Vajngerl CommitDate: Tue Jul 12 07:38:07 2022 +0200 tdf#149775 - VBA: Find should stay around. Previously we would create and destroy it for each set of a property on it making it useless. VBA Find object oddly represents the Find dialog in Word. Add it to SwDoc. Change-Id: Id9850cbd2296b24f9c93dc99b2967095bd84921f Signed-off-by: Hannah Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136630 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 624686890850..e88214977e76 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -175,6 +175,10 @@ namespace com::sun::star { namespace script::vba { class XVBAEventProcessor; } } +namespace ooo::vba::word { +class XFind; +} + namespace sfx2 { class IXmlIdRegistry; } @@ -281,6 +285,7 @@ class SW_DLLPUBLIC SwDoc final std::unique_ptr mpGrammarContact; //< for grammar checking in paragraphs during editing css::uno::Reference< css::script::vba::XVBAEventProcessor > mxVbaEvents; +css::uno::Reference< ooo::vba::word::XFind > mxVbaFind; css::uno::Reference m_xTemplateToProjectCache; /// Table styles (autoformats that are applied with table changes). @@ -1619,6 +1624,8 @@ public: void SetDefaultPageMode(bool bSquaredPageMode); bool IsSquaredPageMode() const; +css::uno::Reference< ooo::vba::word::XFind > getVbaFind() const { return mxVbaFind; } +void setVbaFind( const css::uno::Reference< ooo::vba::word::XFind > ) { mxVbaFind = xFind; } css::uno::Reference< css::script::vba::XVBAEventProcessor > const & GetVbaEventProcessor(); void SetVBATemplateToProjectCache( css::uno::Reference< css::container::XNameContainer > const & xCache ) { m_xTemplateToProjectCache = xCache; }; const css::uno::Reference< css::container::XNameContainer >& GetVBATemplateToProjectCache() const { return m_xTemplateToProjectCache; }; diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1a9f7e868980..576dde4c7a89 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -395,6 +395,8 @@ SwDoc::SwDoc() */ SwDoc::~SwDoc() { +mxVbaFind.clear(); + // nothing here should create Undo actions! GetIDocumentUndoRedo().DoUndo(false); diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx index db34a32f9b64..3c9940cc0e1f 100644 --- a/sw/source/ui/vba/vbafind.cxx +++ b/sw/source/ui/vba/vbafind.cxx @@ -22,13 +22,18 @@ #include #include #include +#include +#include #include "wordvbahelper.hxx" +#include +#include using namespace ::ooo::vba; using namespace ::com::sun::star; -SwVbaFind::SwVbaFind( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) : -SwVbaFind_BASE( rParent, rContext ), mxModel( xModel ), mxTextRange( xTextRange ), mbReplace( false ), mnReplaceType( word::WdReplace::wdReplaceOne ), mnWrap( word::WdFindWrap::wdFindStop ) + +SwVbaFind::SwVbaFind( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel ) : +SwVbaFind_BASE( rParent, rContext ), mxModel( xModel ), mbReplace( false ), mnReplaceType( word::WdReplace::wdReplaceOne ), mnWrap( word::WdFindWrap::wdFindStop ) { mxReplaceable.set( mxModel, uno::UNO_QUERY_THROW ); mxPropertyReplace.set( mxReplaceable->createReplaceDescriptor(), uno::UNO_QUERY_THROW ); @@ -40,6 +45,27 @@ SwVbaFind::~SwVbaFind() { } +uno::Reference< word::XFind > SwVbaFind::GetOrCreateFind(const uno::Reference< ooo::vba::XHelperInterface >& rParent, + const uno::Reference< uno::XComponentContext >& rContext, + const uno::Reference< frame::XModel >& xModel, + const uno::Reference< text::XTextRange >& xTextRange) +{ +rtl::Reference< SwVbaFind > xFind; +SwDoc* pDoc = word::getDocShell( xModel )->GetDoc(); +if( pDoc ) +xFind = dynamic_cast
[Libreoffice-commits] core.git: sw/qa
sw/qa/core/macros-test.cxx | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) New commits: commit b12c18c8cfcf37e8a351d76b96aa853cf9bb6766 Author: Hannah Meeks AuthorDate: Mon Jul 4 16:56:54 2022 +0100 Commit: Noel Grandin CommitDate: Mon Jul 11 15:19:24 2022 +0200 Re-work extension handling to make tests easier to add. Change-Id: Idddbb99804bdc1354db7a1059c68c820ba6a98b3 Signed-off-by: Hannah Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136943 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 6840a6884a05..282fa5d618bf 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -64,7 +64,7 @@ class SwMacrosTest : public test::BootstrapFixture, public unotest::MacrosTest public: SwMacrosTest(); -void createFileURL(std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath); +void createFileURL(std::u16string_view aFile, OUString& rFilePath); virtual void setUp() override; virtual void tearDown() override; @@ -94,24 +94,27 @@ private: OUString m_aBaseString; }; -void SwMacrosTest::createFileURL(std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath) +void SwMacrosTest::createFileURL(std::u16string_view aFile, OUString& rFilePath) { -rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileExtension + "/" -+ aFileBase + aFileExtension; +auto i = aFile.find_last_of('.'); +CPPUNIT_ASSERT_MESSAGE("Missing Extension", i != std::string_view::npos); +std::u16string_view aFileExtension = aFile.substr(i+1); + +rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileExtension + "/" + aFile; } void SwMacrosTest::testVba() { TestMacroInfo testInfo[] = { { -OUString("testVba."), +OUString("testVba.doc"), OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic=document") } }; for ( size_t i=0; i xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); OUString sUrl = testInfo[i].sMacroUrl; Any aRet; @@ -203,7 +206,7 @@ void SwMacrosTest::testBookmarkDeleteTdf90816() void SwMacrosTest::testControlShapeGrouping() { OUString aFileName; -createFileURL(u"testControlShapeGrouping.", u"odt", aFileName); +createFileURL(u"testControlShapeGrouping.odt", aFileName); Reference< css::lang::XComponent > xComponent( loadFromDesktop(aFileName, "com.sun.star.text.TextDocument")); @@ -343,7 +346,7 @@ void SwMacrosTest::testFdo55289() void SwMacrosTest::testFdo68983() { OUString aFileName; -createFileURL(u"fdo68983.", u"odt", aFileName); +createFileURL(u"fdo68983.odt", aFileName); Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
Week 4 - update
Hi, This week I tried to add the Space...Auto methods to ParagraphFormat in XParagraphFormat.idl Had some problems with this in the end understanding what to do when the property was not defined, also the macros in word didn't behave as expected from the msdn documentation so ended up not focusing on this too much - but can come back to another week. I also tried to make a test framework to sw/qa/core/macros-test.cxx looking at the working tests for excel in sc/qa/extras/vba-macros-test.cxx in order to test my macros, this took significantly more time than expected because it took me some time to understand the code and some of the tests don't seem to actually do anything - blank macros (testVba (Macro1))! Had some problems with return values in running the tests and there seems to be a problem with print statements running in the basic macros when testing which stopped the function after the print had executed with no warning/exception. Tried to improve some of the macros testing by changing the filing method so that the file extensions were included in the file name instead of being separated - this should help add my docm macros - in order to do this I had to have a look at std::u16string_view with some misteps. Also experimented with making some more test macros for XParagraphFormat and XTable which should ultimately help identify bugs/gaps in the code to fix. Next week I will try to get some of my tests to work and will add my new macros to test these objects as well as looking more at XFind. Next Problem I can't solve is with macros tests passing OK and then failing on exit with no helpful message - https://gerrit.libreoffice.org/c/core/+/136944 - will chat to mentors but any help appreciated Hannah
Week 3 - update
Hi, This week I: - resolved previous issued & pushed my changes for getValue2 and mutex commits - wrote macro tests on word to test for the .Find object - tests didn’t work on writer, new find objects were being created and destroyed each time .Find was called losing the properties. ^^ (filed a bug report for this) - https://bugs.documentfoundation.org/show_bug.cgi?id=149775 - tried anchoring the find object to the selection which also was continually created and destroyed - made this a global like in word, now some tests work - https://gerrit.libreoffice.org/c/core/+/136630 - set up a better editor - gedit to vscode - started looking at XParagraphFormat and writing macro tests for this exploring some methods and starting to try and add them to LibreOffice Next week I want to set up more automated tests for writer vba and make sure they pass Hannah
[Libreoffice-commits] core.git: oovbaapi/ooo sc/qa sc/source
oovbaapi/ooo/vba/excel/XRange.idl |1 sc/qa/extras/testdocuments/vba.xls |binary sc/source/ui/vba/vbarange.cxx | 41 +++-- sc/source/ui/vba/vbarange.hxx |5 4 files changed, 36 insertions(+), 11 deletions(-) New commits: commit cb41db23a044e6e6337bad642aad2c49174aa068 Author: Hannah Meeks AuthorDate: Fri Apr 29 15:25:51 2022 +0100 Commit: Mike Kaganski CommitDate: Thu Jun 30 03:36:15 2022 +0200 tdf#99514 - implement Value2 for compatibility Value2 ignores date formatting in a way that Value does not. Extended vba.xls to test this too. Change-Id: Id75a3dafae2166221731847b7c81e93e8ad835fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133645 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/oovbaapi/ooo/vba/excel/XRange.idl b/oovbaapi/ooo/vba/excel/XRange.idl index e640f39eb33e..9dcc41f95166 100644 --- a/oovbaapi/ooo/vba/excel/XRange.idl +++ b/oovbaapi/ooo/vba/excel/XRange.idl @@ -43,6 +43,7 @@ interface XRange //interface ::ooo::vba::XHelperInterface; [attribute] any Value; +[attribute] any Value2; [attribute] any Formula; [attribute] any FormulaArray; [attribute] any FormulaR1C1; diff --git a/sc/qa/extras/testdocuments/vba.xls b/sc/qa/extras/testdocuments/vba.xls index 399b1ec20675..22bee379caf1 100644 Binary files a/sc/qa/extras/testdocuments/vba.xls and b/sc/qa/extras/testdocuments/vba.xls differ diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index d94bd7b04a35..99bcce81ba00 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -781,13 +781,13 @@ namespace { class CellValueGetter : public ValueGetter { protected: +RangeValueType meValueType; uno::Any maValue; public: -CellValueGetter() {} +CellValueGetter(RangeValueType eValueType) { meValueType = eValueType; } virtual void visitNode( sal_Int32 x, sal_Int32 y, const uno::Reference< table::XCell >& xCell ) override; virtual void processValue( const uno::Any& aValue ) override; const uno::Any& getValue() const override { return maValue; } - }; } @@ -800,10 +800,10 @@ CellValueGetter::processValue( const uno::Any& aValue ) void CellValueGetter::visitNode( sal_Int32 /*x*/, sal_Int32 /*y*/, const uno::Reference< table::XCell >& xCell ) { uno::Any aValue; -table::CellContentType eType = xCell->getType(); -if( eType == table::CellContentType_VALUE || eType == table::CellContentType_FORMULA ) +table::CellContentType eCellContentType = xCell->getType(); +if( eCellContentType == table::CellContentType_VALUE || eCellContentType == table::CellContentType_FORMULA ) { -if ( eType == table::CellContentType_FORMULA ) +if ( eCellContentType == table::CellContentType_FORMULA ) { OUString sFormula = xCell->getFormula(); @@ -834,13 +834,13 @@ void CellValueGetter::visitNode( sal_Int32 /*x*/, sal_Int32 /*y*/, const uno::Re NumFormatHelper cellFormat( xRange ); if ( cellFormat.isBooleanType() ) aValue <<= ( xCell->getValue() != 0.0 ); -else if ( cellFormat.isDateType() ) +else if ( cellFormat.isDateType() && meValueType == RangeValueType::value) aValue <<= bridge::oleautomation::Date( xCell->getValue() ); else aValue <<= xCell->getValue(); } } -if( eType == table::CellContentType_TEXT ) +if( eCellContentType == table::CellContentType_TEXT ) { uno::Reference< text::XTextRange > xTextRange(xCell, ::uno::UNO_QUERY_THROW); aValue <<= xTextRange->getString(); @@ -908,7 +908,8 @@ private: ScDocument& m_rDoc; formula::FormulaGrammar::Grammar m_eGrammar; public: -CellFormulaValueGetter(ScDocument& rDoc, formula::FormulaGrammar::Grammar eGram ) : m_rDoc( rDoc ), m_eGrammar( eGram ) {} +CellFormulaValueGetter(ScDocument& rDoc, formula::FormulaGrammar::Grammar eGram ) : + CellValueGetter( RangeValueType::value ), m_rDoc( rDoc ), m_eGrammar( eGram ) {} virtual void visitNode( sal_Int32 /*x*/, sal_Int32 /*y*/, const uno::Reference< table::XCell >& xCell ) override { uno::Any aValue; @@ -1524,8 +1525,7 @@ ScVbaRange::getValue( ValueGetter& valueGetter) return uno::Any( script::ArrayWrapper( false, arrayGetter.getValue() ) ); } -uno::Any SAL_CALL -ScVbaRange::getValue() +css::uno::Any ScVbaRange::DoGetValue( RangeValueType eValueType ) { // #TODO code within the test below "if ( m_Areas... " can be removed // Test is performed only because m_xRange is NOT set to be @@ -1537,11 +1537,23 @@ ScVbaRange::getValue() return xRange->getValue(); } -CellValueGetter valueGetter; +CellValueGet
Week 2 - update
Hi, This week I fixed my changes from the previous week, I also looked at the XFind method on writer and wrote macro tests in word to test find and replace. Struggled for a while before finding this : Selection seemed to be a problem to start with and the test will not work without A. Also seemed like the 'with' is broken and creates new find objects - B Selection.TypeText Text:="testing number two" ' without this it doesn't work ... A . ActiveDocument.Content.Select Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting B. +let f = Selection.Find + With f ' works -With Selection.Find ' breaks things. .Text = "t" .Replacement.Text = "l" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll End With Looks like this could be due to code in sw/source/ui/vba/vbaselection.cxx getFind which I will aim to look at next week
[Libreoffice-commits] core.git: unoxml/inc unoxml/source
unoxml/inc/node.hxx|6 unoxml/source/dom/node.cxx | 67 +++-- 2 files changed, 41 insertions(+), 32 deletions(-) New commits: commit a1c6d24aac530d7374cf0fdc5c62570d86e30996 Author: Hannah Meeks AuthorDate: Sat Jun 18 16:06:44 2022 +0100 Commit: Noel Grandin CommitDate: Mon Jun 20 18:53:27 2022 +0200 Simplify checks with functions. Change-Id: I55fbab5d8184a743ace3cfec884b0364536ee6fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136088 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/unoxml/inc/node.hxx b/unoxml/inc/node.hxx index e6974271f83a..852bcd1ae972 100644 --- a/unoxml/inc/node.hxx +++ b/unoxml/inc/node.hxx @@ -113,6 +113,12 @@ namespace DOM void dispatchSubtreeModified(); +void checkNoParent(css::uno::Reference< css::xml::dom::XNode >const& xNode); + +static void checkNoParent(const xmlNodePtr pNode); + +void checkSameOwner(css::uno::Reference< css::xml::dom::XNode >const& xNode); + public: virtual ~CNode() override; diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 235af0bc5e0d..f5bd99aef475 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -268,6 +268,28 @@ namespace DOM return false; } +void CNode::checkNoParent(Referenceconst& xNode){ +if (xNode->getParentNode() != Reference(this)){ +DOMException e; +e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; +throw e; +} +} +void CNode::checkNoParent(const xmlNodePtr pNode){ +if (pNode->parent != nullptr){ +DOMException e; +e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; +throw e; +} +} +void CNode::checkSameOwner(Referenceconst& xNode){ +if (xNode->getOwnerDocument() != getOwnerDocument()) { +DOMException e; +e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR; +throw e; +} +} + /** Adds the node newChild to the end of the list of children of this node. */ @@ -296,11 +318,8 @@ namespace DOM e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; throw e; } -if (cur->parent != nullptr) { -DOMException e; -e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; -throw e; -} +checkNoParent(cur); + if (!IsChildTypeAllowed(pNewChild->m_aNodeType)) { DOMException e; e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; @@ -610,11 +629,8 @@ namespace DOM { if (!newChild.is() || !refChild.is()) { throw RuntimeException(); } -if (newChild->getOwnerDocument() != getOwnerDocument()) { -DOMException e; -e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR; -throw e; -} +checkSameOwner(newChild); + if (refChild->getParentNode() != Reference< XNode >(this)) { DOMException e; e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; @@ -636,12 +652,8 @@ namespace DOM throw e; } // already has parent -if (pNewChild->parent != nullptr) -{ -DOMException e; -e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; -throw e; -} +checkNoParent(pNewChild); + if (!IsChildTypeAllowed(pNewNode->m_aNodeType)) { DOMException e; e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; @@ -714,11 +726,8 @@ namespace DOM throw RuntimeException(); } -if (xOldChild->getOwnerDocument() != getOwnerDocument()) { -DOMException e; -e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR; -throw e; -} +checkSameOwner(xOldChild); + if (xOldChild->getParentNode() != Reference< XNode >(this)) { DOMException e; e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; @@ -784,16 +793,13 @@ namespace DOM Reference< XNode > SAL_CALL CNode::replaceChild( Reference< XNode > const& xNewChild, Reference< XNode > const& xOldChild) -{ + { if (!xOldChild.is() || !xNewChild.is()) { throw RuntimeException(); } -if (xNewChild->getOwnerDocument() != getOwnerDocument()) { -DOMException e; -e.Code = DOMExceptionType_WRONG_DOCUMENT_ERR; -throw e; -} +checkSameOwner(xNewChild); + if (xOldChild->getParentNode() != Reference< XNode >(this)) { DOMException e; e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR; @@ -817,11 +823,8 @@ namespace DOM throw e; }
Week 1 - update
Hi, This week I got a bit distracted by mutex issues in https://bugs.documentfoundation.org/show_bug.cgi?id=148852 In the end I wanted to get this finished before concentrating on the project so tried to simplify the deadlocking code for the next personto work on. Also tried to get most of the std::mutex code included and working with a recursive mutex for now - https://gerrit.libreoffice.org/c/core/+/136088 and https://gerrit.libreoffice.org/c/core/+/134250 I also addressed the feedback in more fully implementing test for Value2 - https://gerrit.libreoffice.org/c/core/+/133645 Next week I hope to get these merged and to do some research on writer, Hannah
GSOC intro
Hi everyone, I’m Hannah a first year undergrad studying engineering, and looking forward to a summer full of coding! This summer I will be working on adding and updating tests for writer as well as implementing missing methods to improve compatibility, with the project “VBA Macros – Tests and missing APIs”. I want to say a large thank you to my mentors – Thorsten Behrens and Quikee and to the rest of the community. Regards, Hannah
[no subject]
All of my past & future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license.
[Libreoffice-commits] core.git: cui/qa sc/qa
cui/qa/uitest/dialogs/chardlg.py|4 ++-- sc/qa/uitest/calc_tests3/insertQrCodeGen.py |2 +- sc/qa/uitest/calc_tests4/exportToPDF.py |6 +++--- sc/qa/uitest/calc_tests8/tdf144940.py |4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 182833b893ae4ad7430479f2dfebcc9c130cf27c Author: Hannah Meeks AuthorDate: Sat Apr 16 18:07:54 2022 +0100 Commit: Ilmari Lauhakangas CommitDate: Tue Apr 19 17:12:30 2022 +0200 tdf#97361 - make unit tests more pythonic. Change-Id: I853cda76522ebf3c9a8f7389d5b2b6fc9611f502 Signed-off-by: Hannah Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133136 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py index 21a1582567a0..c52664f36d0e 100644 --- a/cui/qa/uitest/dialogs/chardlg.py +++ b/cui/qa/uitest/dialogs/chardlg.py @@ -35,8 +35,8 @@ class Test(UITestCase): xFontTransparency.executeAction("UP", tuple()) # Verify the result. -drawPage = component.getDrawPages().getByIndex(0) -shape = drawPage.getByIndex(0) +drawPage = component.getDrawPages()[0] +shape = drawPage[0] # Without the accompanying fix in place, this test would have failed with: # AssertionError: 100 != 5 diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py index 2594b66c2dea..7337962c23ba 100644 --- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py +++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py @@ -30,7 +30,7 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) # check the QR code in the document -element = document.Sheets.getByIndex(0).DrawPage.getByIndex(0) +element = document.Sheets[0].DrawPage[0] self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) self.assertEqual(element.BarCodeProperties.Border, 1) diff --git a/sc/qa/uitest/calc_tests4/exportToPDF.py b/sc/qa/uitest/calc_tests4/exportToPDF.py index 3cf589bbb9c3..565a5337e9ee 100644 --- a/sc/qa/uitest/calc_tests4/exportToPDF.py +++ b/sc/qa/uitest/calc_tests4/exportToPDF.py @@ -71,8 +71,8 @@ class exportToPDF(UITestCase): with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: -self.assertEqual("Sheet1", document.DrawPages[0].getByIndex(0).String) -self.assertEqual("Page 1", document.DrawPages[0].getByIndex(1).String) -self.assertEqual("Hello World", document.DrawPages[0].getByIndex(2).String) +self.assertEqual("Sheet1", document.DrawPages[0][0].String) +self.assertEqual("Page 1", document.DrawPages[0][1].String) +self.assertEqual("Hello World", document.DrawPages[0][2].String) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests8/tdf144940.py b/sc/qa/uitest/calc_tests8/tdf144940.py index b117b56d2a9b..ab47384311ad 100644 --- a/sc/qa/uitest/calc_tests8/tdf144940.py +++ b/sc/qa/uitest/calc_tests8/tdf144940.py @@ -50,8 +50,8 @@ class tdf144940(UITestCase): with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: -xPageStyles = document.StyleFamilies.getByIndex(1) -xDefaultPageStyle = xPageStyles.getByIndex(0) +xPageStyles = document.StyleFamilies[1] +xDefaultPageStyle = xPageStyles[0] # Without the fix in place, this test would have failed with # AssertionError: False is not true
Hannah Meeks license statement
All of my past & future contributions to LibreOffice may be licensed under the MPLv2/LGPLv3+ dual license.