[Libreoffice-commits] core.git: officecfg/registry vcl/source
officecfg/registry/schema/org/openoffice/Office/Common.xcs |8 vcl/source/font/fontmetric.cxx |8 2 files changed, 8 insertions(+), 8 deletions(-) New commits: commit a38e1537cd06367783a43cc8d3b0e8d674b6e142 Author: Khaled Hosny AuthorDate: Mon Jun 5 07:47:47 2023 +0300 Commit: خالد حسني CommitDate: Mon Jun 5 08:42:28 2023 +0200 tdf#155676: Use colon in FontsUseWinMetrics config key The use of comma breaks editing in Expert Configuration dialog, so users effectively can’t use this. After editing Celticmd,1571,-567,1571,-547,2126,559 becomes Celticmd1571-5671571-5472126559 Using colon instead of comma seems to fix this. Change-Id: I4bba26fe9d94a33e62a0d34c3324daae0845c30b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152597 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Reviewed-by: خالد حسني diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index f47edadcae0f..2eb90331ad33 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5126,12 +5126,12 @@ - Celticmd,1571,-567,1571,-547,2126,559 + Celticmd:1571:-567:1571:-547:2126:559 - DIN Light,1509,-503,1509,-483,1997,483 + DIN Light:1509:-503:1509:-483:1997:483 - B Nazanin,1343,-705,1990,-1045,1990,1045 - B Nazanin,1341,-707,2126,-1120,2126,1120 + B Nazanin:1343:-705:1990:-1045:1990:1045 + B Nazanin:1341:-707:2126:-1120:2126:1120 diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index 8a998c6815c6..f9740704ca96 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -400,10 +400,10 @@ bool ImplFontMetricData::ShouldUseWinMetrics(int nAscent, int nDescent, int nTyp return false; OUString aFontIdentifier( -GetFamilyName() + "," -+ OUString::number(nAscent) + "," + OUString::number(nDescent) + "," -+ OUString::number(nTypoAscent) + "," + OUString::number(nTypoDescent) + "," -+ OUString::number(nWinAscent) + "," + OUString::number(nWinDescent)); +GetFamilyName() + ":" ++ OUString::number(nAscent) + ":" + OUString::number(nDescent) + ":" ++ OUString::number(nTypoAscent) + ":" + OUString::number(nTypoDescent) + ":" ++ OUString::number(nWinAscent) + ":" + OUString::number(nWinDescent)); css::uno::Sequence rWinMetricFontList( officecfg::Office::Common::Misc::FontsUseWinMetrics::get());
[Libreoffice-commits] core.git: sw/source
sw/source/core/access/AccessibilityCheck.cxx |1 + sw/source/core/access/AccessibilityIssue.cxx |3 +++ 2 files changed, 4 insertions(+) New commits: commit 5ec593ac096395c9915e16acc1a2699432d10af5 Author: Samuel Mehrbrodt AuthorDate: Thu Jun 1 16:24:58 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon Jun 5 08:19:14 2023 +0200 Update a11y check after quick fix actions Change-Id: Ie2f9a38ece130bc0cdafedf2c188c4c755233eba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152501 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 4502eae1a01c..1766052b5d44 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -119,6 +119,7 @@ class NoTextNodeAltTextCheck : public NodeCheck pIssue->setDoc(pNoTextNode->GetDoc()); pIssue->setIssueObject(IssueObject::GRAPHIC); pIssue->setObjectID(pNoTextNode->GetFlyFormat()->GetName()); +pIssue->setNode(pNoTextNode); } } diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index 81072800d42d..7f09b9d7cf05 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -145,6 +146,8 @@ void AccessibilityIssue::quickFixIssue() const default: break; } +if (m_pNode) +m_pDoc->getOnlineAccessibilityCheck()->resetAndQueue(m_pNode); } } // end sw namespace
[Libreoffice-commits] core.git: include/svx svx/source sw/source
include/svx/svdpage.hxx |1 + svx/source/svdraw/svdpage.cxx| 11 +++ sw/source/core/access/AccessibilityIssue.cxx | 20 +++- 3 files changed, 31 insertions(+), 1 deletion(-) New commits: commit 1f09bab0d033953542d17987e1de56cebfa3497b Author: Samuel Mehrbrodt AuthorDate: Thu Jun 1 14:54:07 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon Jun 5 08:18:51 2023 +0200 tdf#155504 Add "Fix" function to shapes Change-Id: I9494207b0bcdf121034f79d936aeadd95cecdf23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152494 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index 7443c408814d..778e8c2ee327 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -141,6 +141,7 @@ public: size_t GetObjCount() const; SdrObject* GetObj(size_t nNum) const; +SdrObject* GetObjByName(std::u16string_view sName) const; /// linked page or linked group object virtual bool IsReadOnly() const; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 175f58b2ad7a..f7df7c12a730 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -789,6 +789,17 @@ SdrObject* SdrObjList::GetObj(size_t nNum) const return nullptr; } +SdrObject* SdrObjList::GetObjByName(std::u16string_view sName) const +{ +for (size_t i = 0; i < GetObjCount(); ++i) +{ +SdrObject* pObj = GetObj(i); +if (pObj->GetName() == sName) +return pObj; +} +return nullptr; +} + bool SdrObjList::IsReadOnly() const { diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index e11531ecd474..81072800d42d 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -10,13 +10,16 @@ #include #include +#include #include +#include #include #include #include #include #include #include +#include namespace sw { @@ -100,7 +103,8 @@ void AccessibilityIssue::gotoIssue() const bool AccessibilityIssue::canQuickFixIssue() const { -return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == IssueObject::OLE; +return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == IssueObject::OLE + || m_eIssueObject == IssueObject::SHAPE; } void AccessibilityIssue::quickFixIssue() const @@ -124,6 +128,20 @@ void AccessibilityIssue::quickFixIssue() const } } break; +case IssueObject::SHAPE: +{ +OUString aDesc = SwResId(STR_ENTER_ALT); +SvxNameDialog aNameDialog(m_pParent, "", aDesc); +if (aNameDialog.run() == RET_OK) +{ +SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell(); +auto pPage = pWrtShell->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); +SdrObject* pObj = pPage->GetObjByName(m_sObjectID); +if (pObj) +pObj->SetTitle(aNameDialog.GetName()); +} +} +break; default: break; }
[Libreoffice-commits] core.git: sw/source
sw/source/core/model/ThemeColorChanger.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 81f9e88e7237f54c636a018b413192f7fdefbaca Author: Andrea Gelmini AuthorDate: Sun Jun 4 21:52:43 2023 +0200 Commit: Julien Nabet CommitDate: Mon Jun 5 07:21:53 2023 +0200 Fix typo in code Change-Id: Ie25dfed8d3178f71256b19d9ec3247dff6d0c704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152593 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/sw/source/core/model/ThemeColorChanger.cxx b/sw/source/core/model/ThemeColorChanger.cxx index fb3175e929cf..e9ae920362a5 100644 --- a/sw/source/core/model/ThemeColorChanger.cxx +++ b/sw/source/core/model/ThemeColorChanger.cxx @@ -143,7 +143,7 @@ public: } } -void updateParagraphAttibutes(SwTextNode* pTextNode) +void updateParagraphAttributes(SwTextNode* pTextNode) { if (!pTextNode->HasSwAttrSet()) return; @@ -238,7 +238,7 @@ public: return; updateHints(pNode->GetTextNode()); -updateParagraphAttibutes(pNode->GetTextNode()); +updateParagraphAttributes(pNode->GetTextNode()); } void handleSdrObject(SdrObject* pObject) override
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/schema/org/openoffice/Office/Common.xcs |3 +++ 1 file changed, 3 insertions(+) New commits: commit 1263873edf86ce223ee54ecd93297273ac3b0e9f Author: Khaled Hosny AuthorDate: Sun Jun 4 23:28:59 2023 +0300 Commit: خالد حسني CommitDate: Mon Jun 5 06:37:58 2023 +0200 tdf#155297: Use usWinAscent and usWinDescent for B Nazanin font Its hhea.ascender and hhea.descender metrics are too small, but it does not have USE_TYPO_METRICS bit set. Since usWinAscent/usWinDescent are equal to sTypoAscender/sTypoDescender, we can use the former. Change-Id: I638fa81483365f8c44278ee13ad57cd8cf8d8769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152595 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 2b6aabf31c3e..f47edadcae0f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5129,6 +5129,9 @@ Celticmd,1571,-567,1571,-547,2126,559 DIN Light,1509,-503,1509,-483,1997,483 + + B Nazanin,1343,-705,1990,-1045,1990,1045 + B Nazanin,1341,-707,2126,-1120,2126,1120
[Libreoffice-commits] core.git: 2 commits - vcl/unx
vcl/unx/gtk3/a11y/atkwrapper.cxx |4 1 file changed, 4 insertions(+) New commits: commit 8698b354ca9cd3b48aee513dd1564e46ca513261 Author: Colomban Wendling AuthorDate: Wed May 31 19:20:40 2023 +0200 Commit: Michael Weghorn CommitDate: Mon Jun 5 06:37:29 2023 +0200 gtk3 a11y: Consolidate reporting accessible name Just like in I61c4d8d4713b2b82ebb40d9de2a8a773405591ba, avoid the any assumption on what the parent would do in its own implementation, and return ourselves when we mean to. The case of AtkObjectWrapper::get_name() is actually currently fine, because AtkObject::get_name() does what we think it does, and GtkWidgetAccessible doesn't override it, but it's safer not to rely on those assumptions. Change-Id: Ib500d8efa8501206da66c3cca4f6b93bd426cb7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152457 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx index b8cb62cf8b30..f322987dbbcd 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx @@ -377,6 +377,8 @@ wrapper_get_name( AtkObject *atk_obj ) if( atk_obj->name ) g_free(atk_obj->name); atk_obj->name = g_strdup(aName.getStr()); + +return atk_obj->name; } } catch(const uno::Exception&) { commit ac643f1ae48bae7af6e7c0a5cc5a8dc83beac49b Author: Colomban Wendling AuthorDate: Wed May 31 19:12:33 2023 +0200 Commit: Michael Weghorn CommitDate: Mon Jun 5 06:37:22 2023 +0200 gtk3 a11y: Fix reporting accessible description AtkObjectWrapper::get_description() sets the AtkObject::description field and chains up to its parent, expecting it to return that member to the caller. This is a questionable assumption, but that's what AtkObject does. However, since f3b0a95f9c2f85604808c21485e46e43aebbbfed which fixed tdf#150496, the direct parent is GtkWidgetAccessible, not AtkObject. And the assumption about returning AtkObject::description doesn't hold then, because GtkWidgetAccessible short-circuits the call if it can't find the associate GtkWidget, which doesn't exist. To fix this, return the member directly when we set it, but leave it to the parent if we don't have anything better in case it could actually do something useful, and because it's customary. Change-Id: I61c4d8d4713b2b82ebb40d9de2a8a773405591ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152456 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx index 22a6715d3037..b8cb62cf8b30 100644 --- a/vcl/unx/gtk3/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx @@ -404,6 +404,8 @@ wrapper_get_description( AtkObject *atk_obj ) g_free(atk_obj->description); atk_obj->description = g_strdup(aDescription.getStr()); + +return atk_obj->description; } catch(const uno::Exception&) { g_warning( "Exception in getAccessibleDescription()" );
[Libreoffice-commits] core.git: canvas/source
canvas/source/cairo/cairo_canvas.cxx|4 +--- canvas/source/cairo/cairo_spritecanvas.cxx |3 +-- canvas/source/cairo/cairo_textlayout.cxx|2 +- canvas/source/directx/dx_canvas.cxx |6 ++ canvas/source/directx/dx_spritecanvas.cxx |3 +-- canvas/source/directx/dx_spritedevicehelper.cxx |2 +- canvas/source/opengl/ogl_canvascustomsprite.cxx |2 +- canvas/source/opengl/ogl_spritecanvas.cxx |3 +-- canvas/source/vcl/canvas.cxx|3 +-- canvas/source/vcl/spritecanvas.cxx |3 +-- 10 files changed, 11 insertions(+), 20 deletions(-) New commits: commit 07af51d62d84bb843679e086f5f29833cd1359a1 Author: Mike Kaganski AuthorDate: Sun Apr 23 20:13:04 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Jun 5 06:00:06 2023 +0200 Use getXWeak in canvas Change-Id: I51b4c20eadc594057d5384bff51b4547da86129d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150837 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 60b807e8196b..1a16a9f813cb 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -176,15 +176,13 @@ com_sun_star_comp_rendering_Canvas_Cairo_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence const& args) { rtl::Reference p = new cairocanvas::Canvas(args, context); -p->acquire(); try { p->initialize(); } catch (css::uno::Exception&) { p->dispose(); -p->release(); throw; } -return static_cast(p.get()); +return cppu::acquire(p.get()); } diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 74b2ce5892b6..5af40370c57f 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -225,9 +225,8 @@ com_sun_star_comp_rendering_SpriteCanvas_Cairo_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence const& args) { rtl::Reference p = new cairocanvas::SpriteCanvas(args, context); -p->acquire(); p->initialize(); -return static_cast(p.get()); +return cppu::acquire(p.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 00a1d19d5577..955a180330d4 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -125,7 +125,7 @@ namespace cairocanvas if( aAdvancements.getLength() != maText.Length ) { SAL_WARN("canvas.cairo", "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" ); -throw lang::IllegalArgumentException("mismatching number of advancements", static_cast(this), 1); +throw lang::IllegalArgumentException("mismatching number of advancements", getXWeak(), 1); } maLogicalAdvancements = aAdvancements; diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index fbf0f8490071..c19ea1ea9017 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -240,8 +240,7 @@ namespace dxcanvas { rtl::Reference xCanvas(new Canvas(args, context)); xCanvas->initialize(); -xCanvas->acquire(); -return static_cast(xCanvas.get()); +return cppu::acquire(xCanvas.get()); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* @@ -250,8 +249,7 @@ namespace dxcanvas { rtl::Reference xCanvas(new BitmapCanvas(args, context)); xCanvas->initialize(); -xCanvas->acquire(); -return static_cast(xCanvas.get()); +return cppu::acquire(xCanvas.get()); } } diff --git a/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx index 5f1a68b34515..f4fe39203f4b 100644 --- a/canvas/source/directx/dx_spritecanvas.cxx +++ b/canvas/source/directx/dx_spritecanvas.cxx @@ -183,8 +183,7 @@ namespace dxcanvas { rtl::Reference xCanvas(new SpriteCanvas(args, context)); xCanvas->initialize(); -xCanvas->acquire(); -return static_cast(xCanvas.get()); +return cppu::acquire(xCanvas.get()); } } diff --git a/canvas/source/directx/dx_spritedevicehelper.cxx b/canvas/source/directx/dx_spritedevicehelper.cxx index 4ed0a267476c..24d18945bede 100644 --- a/canvas/source/directx/dx_spritedevicehelper.cxx +++ b/canvas/source/directx/dx_spritedevicehelper.cxx @@ -80,7 +80,7 @@ namespace dxcanvas catch (...) { throw lang::NoSupportException( "Could not create DirectX device!", -static_cast< ::cppu::OWeakObject* >(&rSpriteCanvas) ); +rSpriteCanvas.getXWeak() ); }
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmodel.cxx | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) New commits: commit f97a7b965be154824e108802b386e3132b0a237a Author: Julien Nabet AuthorDate: Sun Jun 4 21:59:50 2023 +0200 Commit: Julien Nabet CommitDate: Mon Jun 5 00:03:04 2023 +0200 Simplify vector intialization in svx/svdmodel Change-Id: Ieaed80e4621084baf531b794323b2742ccd80310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152594 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 82c9a92fa503..4e1ea3c78ac5 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1834,23 +1834,15 @@ void SdrModel::ReadUserDataSequenceValue(const beans::PropertyValue* pValue) } } -template -static void addPair(std::vector< std::pair< OUString, uno::Any > >& aUserData, const OUString& name, const T val) -{ -aUserData.push_back(std::pair< OUString, uno::Any >(name, uno::Any(val))); -} - void SdrModel::WriteUserDataSequence(uno::Sequence & rValues) { -std::vector< std::pair< OUString, uno::Any > > aUserData; -addPair(aUserData, "AnchoredTextOverflowLegacy", - GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)); -addPair(aUserData, "LegacySingleLineFontwork", - GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)); -addPair(aUserData, "ConnectorUseSnapRect", -GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)); -addPair(aUserData, "IgnoreBreakAfterMultilineField", - GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)); +std::vector< std::pair< OUString, uno::Any > > aUserData +{ +{ "AnchoredTextOverflowLegacy", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)) }, +{ "LegacySingleLineFontwork", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)) }, +{ "ConnectorUseSnapRect", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)) }, +{ "IgnoreBreakAfterMultilineField", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)) } +}; const sal_Int32 nOldLength = rValues.getLength(); rValues.realloc(nOldLength + aUserData.size());
[Libreoffice-commits] core.git: cui/source
cui/source/inc/connect.hxx |2 +- cui/source/tabpages/connect.cxx | 16 2 files changed, 9 insertions(+), 9 deletions(-) New commits: commit af27b57521075b35234daed4a6a7b554ed434df7 Author: Hossein AuthorDate: Sun Jun 4 22:16:27 2023 +0200 Commit: Hossein CommitDate: Sun Jun 4 23:56:55 2023 +0200 Rename function to SetMetricValueAndSave Rename the function, remove prefix and suffix Change-Id: Iaca0541d15a9162f11f8461892bf4c4454c9d674 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151843 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index 9aa2cc92dabb..73891d0ff8e6 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -56,7 +56,7 @@ private: DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void); template -void lcl_SetMetricValueAndSave_new(const SfxItemSet *rAttrs, weld::MetricSpinButton &rField, TypedWhichId nWhich); +void SetMetricValueAndSave(const SfxItemSet *rAttrs, weld::MetricSpinButton &rField, TypedWhichId nWhich); public: SvxConnectionPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index a76de5eff3fd..b69f17b55113 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -119,7 +119,7 @@ SvxConnectionPage::~SvxConnectionPage() } template -void SvxConnectionPage::lcl_SetMetricValueAndSave_new(const SfxItemSet* rAttrs, weld::MetricSpinButton& rField, TypedWhichId nWhich) +void SvxConnectionPage::SetMetricValueAndSave(const SfxItemSet* rAttrs, weld::MetricSpinButton& rField, TypedWhichId nWhich) { const SfxPoolItem* pItem = GetItem( *rAttrs, nWhich); const SfxItemPool* pPool = rAttrs->GetPool(); @@ -141,25 +141,25 @@ void SvxConnectionPage::Reset( const SfxItemSet* rAttrs ) const SfxItemPool* pPool = rAttrs->GetPool(); // SdrEdgeNode1HorzDistItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz1, SDRATTR_EDGENODE1HORZDIST); +SetMetricValueAndSave(rAttrs, *m_xMtrFldHorz1, SDRATTR_EDGENODE1HORZDIST); // SdrEdgeNode2HorzDistItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldHorz2, SDRATTR_EDGENODE2HORZDIST); +SetMetricValueAndSave(rAttrs, *m_xMtrFldHorz2, SDRATTR_EDGENODE2HORZDIST); // SdrEdgeNode1VertDistItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert1, SDRATTR_EDGENODE1VERTDIST); +SetMetricValueAndSave(rAttrs, *m_xMtrFldVert1, SDRATTR_EDGENODE1VERTDIST); // SdrEdgeNode2VertDistItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldVert2, SDRATTR_EDGENODE2VERTDIST); +SetMetricValueAndSave(rAttrs, *m_xMtrFldVert2, SDRATTR_EDGENODE2VERTDIST); // SdrEdgeLine1DeltaItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine1, SDRATTR_EDGELINE1DELTA); +SetMetricValueAndSave(rAttrs, *m_xMtrFldLine1, SDRATTR_EDGELINE1DELTA); // SdrEdgeLine2DeltaItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine2, SDRATTR_EDGELINE2DELTA); +SetMetricValueAndSave(rAttrs, *m_xMtrFldLine2, SDRATTR_EDGELINE2DELTA); // SdrEdgeLine3DeltaItem -lcl_SetMetricValueAndSave_new(rAttrs, *m_xMtrFldLine3, SDRATTR_EDGELINE3DELTA); +SetMetricValueAndSave(rAttrs, *m_xMtrFldLine3, SDRATTR_EDGELINE3DELTA); // SdrEdgeLineDeltaAnzItem pItem = GetItem( *rAttrs, SDRATTR_EDGELINEDELTACOUNT );
[Libreoffice-commits] core.git: lingucomponent/source
lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 23f918ef6a542cc5f473f6c9bb5897ce5be9dd06 Author: Mike Kaganski AuthorDate: Sun Apr 23 20:14:10 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 22:51:50 2023 +0200 Use getXWeak in lingucomponent Change-Id: Icd70dd656d847f595cc1325ed0decb4941a82cde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150857 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index c68a17cbd466..7152a6ff0880 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -528,7 +528,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* lingucomponent_LanguageToolGrammarChecker_get_implementation( css::uno::XComponentContext*, css::uno::Sequence const&) { -return cppu::acquire(static_cast(new LanguageToolGrammarChecker())); +return cppu::acquire(new LanguageToolGrammarChecker()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
[Libreoffice-commits] core.git: 2 commits - connectivity/source reportdesign/source
connectivity/source/commontools/conncleanup.cxx |2 connectivity/source/cpool/ZDriverWrapper.cxx |2 connectivity/source/drivers/calc/CDriver.cxx |2 connectivity/source/drivers/dbase/DDriver.cxx|2 connectivity/source/drivers/evoab2/NResultSet.cxx|2 connectivity/source/drivers/flat/EDriver.cxx |2 connectivity/source/drivers/jdbc/JStatement.cxx |2 connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx |2 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx |2 connectivity/source/drivers/writer/WDriver.cxx |7 -- reportdesign/source/core/api/FixedLine.cxx |4 - reportdesign/source/core/api/Functions.cxx |2 reportdesign/source/core/api/Groups.cxx |2 reportdesign/source/core/api/ReportDefinition.cxx| 26 -- reportdesign/source/core/api/Section.cxx |2 reportdesign/source/core/sdr/RptModel.cxx| 10 +-- reportdesign/source/core/sdr/RptPage.cxx |2 17 files changed, 34 insertions(+), 39 deletions(-) New commits: commit e2360bfd6263dace3c0c441b78537c214687656f Author: Mike Kaganski AuthorDate: Sun Apr 23 20:13:17 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 22:35:38 2023 +0200 Use getXWeak in connectivity Change-Id: Id301a9321f77e5ccc1269a3b677e9faeb19a4011 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150841 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/connectivity/source/commontools/conncleanup.cxx b/connectivity/source/commontools/conncleanup.cxx index cdb5069cb322..5504c4e14253 100644 --- a/connectivity/source/commontools/conncleanup.cxx +++ b/connectivity/source/commontools/conncleanup.cxx @@ -78,7 +78,7 @@ namespace dbtools void OAutoConnectionDisposer::stopPropertyListening( const Reference< XPropertySet >& _rxEventSource ) { // prevent deletion of ourself while we're herein -Reference< XInterface > xKeepAlive(static_cast< XWeak* >(this)); +Reference< XInterface > xKeepAlive(getXWeak()); try { // remove ourself as property change listener diff --git a/connectivity/source/cpool/ZDriverWrapper.cxx b/connectivity/source/cpool/ZDriverWrapper.cxx index 811f103bc9a6..9a1bdf971f97 100644 --- a/connectivity/source/cpool/ZDriverWrapper.cxx +++ b/connectivity/source/cpool/ZDriverWrapper.cxx @@ -48,7 +48,7 @@ namespace connectivity OSL_ENSURE(m_xDriver.is(), "ODriverWrapper::ODriverWrapper: invalid aggregate (no XDriver)!"); // set ourself as delegator -m_xDriverAggregate->setDelegator( static_cast< XWeak* >( this ) ); +m_xDriverAggregate->setDelegator( getXWeak() ); } osl_atomic_decrement( &m_refCount ); } diff --git a/connectivity/source/drivers/calc/CDriver.cxx b/connectivity/source/drivers/calc/CDriver.cxx index b7b11cc29176..eccf97751c8f 100644 --- a/connectivity/source/drivers/calc/CDriver.cxx +++ b/connectivity/source/drivers/calc/CDriver.cxx @@ -53,7 +53,7 @@ connectivity_calc_ODriver( } if (ret) ret->acquire(); -return static_cast(ret.get()); +return getXWeak(ret.get()); } diff --git a/connectivity/source/drivers/dbase/DDriver.cxx b/connectivity/source/drivers/dbase/DDriver.cxx index 8eae0013c940..ff0ec256e18a 100644 --- a/connectivity/source/drivers/dbase/DDriver.cxx +++ b/connectivity/source/drivers/dbase/DDriver.cxx @@ -51,7 +51,7 @@ connectivity_dbase_ODriver( } if (ret) ret->acquire(); -return static_cast(ret.get()); +return getXWeak(ret.get()); } diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 2505cbf3dc81..043be2553f86 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -912,7 +912,7 @@ Reference< XInterface > SAL_CALL OEvoabResultSet::getStatement( ) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); -return static_cast(m_pStatement); +return cppu::getXWeak(m_pStatement); } diff --git a/connectivity/source/drivers/flat/EDriver.cxx b/connectivity/source/drivers/flat/EDriver.cxx index 29492895510e..51e357611558 100644 --- a/connectivity/source/drivers/flat/EDriver.cxx +++ b/connectivity/source/drivers/flat/EDriver.cxx @@ -54,7 +54,7 @@ connectivity_flat_ODriver( } if (ret) ret->acquire(); -return static_cast(ret.get()); +return getXWeak(ret.get()); } Reference< XConnection > SAL_CALL ODriver::connect( const OUString& url, const Sequence< PropertyValue >& info ) diff --git a/connectiv
[Libreoffice-commits] core.git: configure.ac
configure.ac |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 45f6b03349b2626c5e75008bccd4e094f96e2769 Author: Khaled Hosny AuthorDate: Sun Jun 4 21:47:32 2023 +0300 Commit: خالد حسني CommitDate: Sun Jun 4 21:41:52 2023 +0200 Fix ccache cache size detection I have ccache 4.8.1 and it reports: (/home/khaled/.config/ccache/ccache.conf) max_size = 30.0 GB With a space between the number and the unit and the configure check with then see a unit-less 30 and will warn: ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection Change-Id: I12bad9204feddfe06be7207d9367586da871a5e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152592 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/configure.ac b/configure.ac index e86e3c30141d..bb2e3bcd6999 100644 --- a/configure.ac +++ b/configure.ac @@ -3317,8 +3317,9 @@ AC_SUBST(CCACHE_DEPEND_MODE) # sccache defaults are good enough if test "$CCACHE" != "" -a -z "$SCCACHE"; then # e.g. (/home/rene/.config/ccache/ccache.conf) max_size = 20.0G +# or (...) max_size = 20.0 G # -p works with both 4.2 and 4.4 -ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 }' | sed -e 's/\.[0-9]*//']) +ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 $5 }' | sed -e 's/\.[0-9]*//']) ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//') if test "$ccache_size" = ""; then ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/filter/RtfFilter.cxx|2 +- writerfilter/source/filter/WriterFilter.cxx |8 +++- 2 files changed, 4 insertions(+), 6 deletions(-) New commits: commit 7157cf5dee03a8a62033025521a68eec2a08d1f4 Author: Mike Kaganski AuthorDate: Sun Apr 23 20:15:44 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 20:58:31 2023 +0200 Use getXWeak in writerfilter Change-Id: I3e0e68c44750f30bd1998c79dc74a13f2c9ade9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150886 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index 69c27585cd51..8f80b85353b2 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -167,7 +167,7 @@ sal_Bool RtfFilter::filter(const uno::Sequence& rDescripto { css::uno::Any anyEx = cppu::getCaughtException(); // cannot throw WrongFormatException directly :( -throw lang::WrappedTargetRuntimeException("", static_cast(this), anyEx); +throw lang::WrappedTargetRuntimeException("", getXWeak(), anyEx); } catch (const uno::Exception&) { diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 3ac82d766c6a..1cfb0bee5387 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -211,15 +211,13 @@ sal_Bool WriterFilter::filter(const uno::Sequence& rDescri { // note: SfxObjectShell checks for WrongFormatException io::WrongFormatException wfe(lcl_GetExceptionMessage(e)); -throw lang::WrappedTargetRuntimeException("", static_cast(this), - uno::Any(wfe)); +throw lang::WrappedTargetRuntimeException("", getXWeak(), uno::Any(wfe)); } catch (xml::sax::SAXException const& e) { // note: SfxObjectShell checks for WrongFormatException io::WrongFormatException wfe(lcl_GetExceptionMessage(e)); -throw lang::WrappedTargetRuntimeException("", static_cast(this), - uno::Any(wfe)); +throw lang::WrappedTargetRuntimeException("", getXWeak(), uno::Any(wfe)); } catch (uno::RuntimeException const&) { @@ -230,7 +228,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence& rDescri css::uno::Any anyEx = cppu::getCaughtException(); SAL_WARN("writerfilter", "WriterFilter::filter(): failed with " << exceptionToString(anyEx)); -throw lang::WrappedTargetRuntimeException("", static_cast(this), anyEx); +throw lang::WrappedTargetRuntimeException("", getXWeak(), anyEx); } // Adding some properties to the document's grab bag for interoperability purposes:
[Libreoffice-commits] core.git: 2 commits - filter/source unotools/source
filter/source/config/cache/basecontainer.cxx |6 +++--- filter/source/config/cache/typedetection.cxx |2 +- filter/source/xsltfilter/XSLTFilter.cxx |4 ++-- unotools/source/streaming/streamhelper.cxx | 14 +++--- unotools/source/streaming/streamwrap.cxx | 18 +- unotools/source/ucbhelper/tempfile.cxx | 26 +- unotools/source/ucbhelper/ucblockbytes.cxx |4 ++-- unotools/source/ucbhelper/xtempfile.cxx | 26 +- 8 files changed, 50 insertions(+), 50 deletions(-) New commits: commit 4129fca3739090651a9ffb11b35245e09816556f Author: Mike Kaganski AuthorDate: Sun Apr 23 20:13:47 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 20:58:22 2023 +0200 Use getXWeak in filter Change-Id: I9854e28a4c577fae71bfc7e4bbaaadbdbce08684 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150850 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx index 7937eb19ab6b..86b6677ffa1d 100644 --- a/filter/source/config/cache/basecontainer.cxx +++ b/filter/source/config/cache/basecontainer.cxx @@ -91,7 +91,7 @@ void BaseContainer::impl_initFlushMode(std::unique_lock& /*rGuard*/) m_pFlushCache = GetTheFilterCache().clone(); if (!m_pFlushCache) throw css::uno::RuntimeException( "Can not create write copy of internal used cache on demand.", -static_cast< OWeakObject* >(this)); +getXWeak()); } @@ -380,7 +380,7 @@ void SAL_CALL BaseContainer::flush() if (!m_pFlushCache) throw css::lang::WrappedTargetRuntimeException( "Can not guarantee cache consistency. Special flush container does not exists!", -static_cast< OWeakObject* >(this), +getXWeak(), css::uno::Any()); try @@ -402,7 +402,7 @@ void SAL_CALL BaseContainer::flush() // later again ... throw css::lang::WrappedTargetRuntimeException( "Flush rejected by internal container.", -static_cast< OWeakObject* >(this), +getXWeak(), css::uno::Any(ex)); } diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index c05f30af7649..18d13a8f7796 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -1097,7 +1097,7 @@ void TypeDetection::impl_openStream(utl::MediaDescriptor& rDescriptor) if ( !bSuccess ) throw css::uno::Exception( "Could not open stream for <" + sURL + ">", -static_cast(this)); +getXWeak()); if ( !bRequestedReadOnly ) { diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index 44f9ce4d8172..771b5a37f8fc 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -374,7 +374,7 @@ namespace XSLT Sequence excArgs(0); css::ucb::InteractiveAugmentedIOException exc( "Timeout!", -static_cast< OWeakObject * >( this ), +getXWeak(), InteractionClassification_ERROR, css::ucb::IOErrorCode_GENERAL, excArgs); @@ -501,7 +501,7 @@ namespace XSLT Sequence excArgs(0); css::ucb::InteractiveAugmentedIOException exc( "Timeout!", -static_cast< OWeakObject * >( this ), +getXWeak(), InteractionClassification_ERROR, css::ucb::IOErrorCode_GENERAL, excArgs); commit b00c351f0466c65ba51e980d8554e09efe0b7bd8 Author: Mike Kaganski AuthorDate: Sun Apr 23 20:15:30 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 20:58:12 2023 +0200 Use getXWeak in unotools Change-Id: I61ae9f11c3017442ac7461ca57f5625d1687fc68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150882 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index b5f07e6a6a7f..12f6ad7afd5a 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -31,10 +31,10 @@ namespace utl sal_Int32 SAL_CAL
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/userlist.hxx |5 ++--- sc/source/core/tool/userlist.cxx | 12 +--- 2 files changed, 7 insertions(+), 10 deletions(-) New commits: commit 4900217e74e29c8e19c9a697883c21cbd50c9dbc Author: Mike Kaganski AuthorDate: Sun Jun 4 16:22:38 2023 +0200 Commit: Mike Kaganski CommitDate: Sun Jun 4 19:56:38 2023 +0200 Move uppercase to SubStr ctor Change-Id: Ifeeaead20e3ad37705fea04a6c3b9efa4339ddc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152543 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index b421c33370db..5f913bc47dae 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -30,15 +30,14 @@ */ class SC_DLLPUBLIC ScUserListData final { -public: +private: struct SAL_DLLPRIVATE SubStr { OUString maReal; OUString maUpper; -SubStr(OUString aReal, OUString aUpper); +SubStr(OUString&& aReal); }; -private: std::vector maSubStrings; OUString aStr; diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index b91d3ba3819a..b1030eca6293 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -17,7 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include + #include #include @@ -29,8 +30,8 @@ #include #include -ScUserListData::SubStr::SubStr(OUString aReal, OUString aUpper) : -maReal(std::move(aReal)), maUpper(std::move(aUpper)) {} +ScUserListData::SubStr::SubStr(OUString&& aReal) : +maReal(std::move(aReal)), maUpper(ScGlobal::getCharClass().uppercase(maReal)) {} void ScUserListData::InitTokens() { @@ -40,10 +41,7 @@ void ScUserListData::InitTokens() { OUString aSub = aStr.getToken(0, ScGlobal::cListDelimiter, nIndex); if (!aSub.isEmpty()) -{ -OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); -maSubStrings.emplace_back(aSub, aUpStr); -} +maSubStrings.emplace_back(std::move(aSub)); } while (nIndex >= 0); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source
sw/qa/extras/layout/data/tdf155611_table_and_nested_section.fodt | 33 ++ sw/qa/extras/layout/layout2.cxx | 28 sw/source/core/layout/sectfrm.cxx| 16 3 files changed, 76 insertions(+), 1 deletion(-) New commits: commit 036d1d8bb324df779410b339e86d369f339cc58b Author: Mike Kaganski AuthorDate: Wed May 31 18:07:14 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 19:11:26 2023 +0200 tdf#155611: SwFrame::FindNext sometimes returns a sub-frame of this frame This resulted in wrong split of the section frame, when the table frame was the last in the section, the split needed to happen after that table (i.e., at the very end of the section), and passing the table frame as pFrameStartAfter gave its last cell's subtable as pSav (i.e., the frame to move after the split). The first frame of the last cell (the one prior to pSav) got lost from the layout, and wasn't destroyed when SwRootFrame was destroyed, and then it crashed referencing destroyed root frame and view shell. Change-Id: I1a539818aa890f65e961f4185ce50916ce7e4e4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152454 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152465 Reviewed-by: Michael Stahl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152484 Tested-by: Jenkins CollaboraOffice diff --git a/sw/qa/extras/layout/data/tdf155611_table_and_nested_section.fodt b/sw/qa/extras/layout/data/tdf155611_table_and_nested_section.fodt new file mode 100644 index ..28c0701ea2fc --- /dev/null +++ b/sw/qa/extras/layout/data/tdf155611_table_and_nested_section.fodt @@ -0,0 +1,33 @@ + + + + + + + + + + + foo + + + bar + + + + + baz + + + + + + + + abc + + + + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 59e9d7d9f43c..70ebd9843ceb 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -1815,6 +1815,34 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf154113) "Section3. End selection here -->"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf155611) +{ +createSwDoc(DATA_DIRECTORY, "tdf155611_table_and_nested_section.fodt"); +Scheduler::ProcessEventsToIdle(); + +xmlDocUniquePtr pXml = parseLayoutDump(); +CPPUNIT_ASSERT(pXml); + +// Check the layout: single page, two section frames (no section frames after the one for Inner +// section), correct table structure and content in the first section frame, including nested +// table in the last cell, and the last section text. +assertXPath(pXml, "/root/page"); +// Without the fix in place, this would fail with +// - Expected: 2 +// - Actual : 3 +assertXPath(pXml, "/root/page/body/section", 2); +assertXPath(pXml, "/root/page/body/section[1]/tab"); +assertXPath(pXml, "/root/page/body/section[1]/tab/row"); +assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell", 2); +assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[1]/txt/Text[@Portion='foo']"); +assertXPath(pXml, "/root/page/body/section[1]/tab/row/cell[2]/txt/Text[@Portion='bar']"); +assertXPath(pXml, + "/root/page/body/section[1]/tab/row/cell[2]/tab/row/cell/txt/Text[@Portion='baz']"); +assertXPath(pXml, "/root/page/body/section[2]/txt[1]/Text[@Portion='abc']"); + +// Also must not crash on close because of a frame that accidentally fell off of the layout +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 111c31f7d3b6..1163e048e64b 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -519,7 +519,21 @@ void SwSectionFrame::MergeNext( SwSectionFrame* pNxt ) SwSectionFrame* SwSectionFrame::SplitSect( SwFrame* pFrameStartAfter, SwFrame* pFramePutAfter ) { assert(!pFrameStartAfter || IsAnLower(pFrameStartAfter)); -SwFrame* pSav = pFrameStartAfter ? pFrameStartAfter->FindNext() : ContainsAny(); +SwFrame* pSav; +if (pFrameStartAfter) +{ +pSav = pFrameStartAfter->FindNext(); +// If pFrameStartAfter is a complex object like table, and it has no next, +// its FindNext may return its own last subframe. In this case, assume that +// we are at the end. +if (pSav && pFrameStartAfter->IsLayoutFrame()) +if (static_cast(pFrameStartAfter)->IsAnLower(pSav)) +pSav = nullptr; +} +else +{ +pSav = ContainsAny(); +} if (pSav && !IsAnLower(pSav)) pSav = nullptr;
[Libreoffice-commits] core.git: cui/source editeng/source include/editeng include/svx svx/source sw/inc sw/source
cui/source/tabpages/border.cxx |4 cui/source/tabpages/chardlg.cxx | 34 ++- cui/source/tabpages/tpcolor.cxx | 32 -- editeng/source/items/borderline.cxx | 22 +- editeng/source/items/frmitems.cxx| 68 ++ editeng/source/items/textitem.cxx| 39 ++- include/editeng/borderline.hxx | 19 + include/editeng/boxitem.hxx | 17 + include/editeng/memberids.h | 17 + include/editeng/udlnitem.hxx | 26 +- include/svx/frmsel.hxx |2 svx/source/dialog/frmsel.cxx |6 svx/source/unodraw/unobrushitemhelper.cxx| 15 - sw/inc/unoprnms.hxx | 20 + sw/source/core/docnode/ndtbl1.cxx|8 sw/source/core/model/ThemeColorChanger.cxx | 297 +-- sw/source/core/unocore/unomap.cxx| 23 +- sw/source/core/unocore/unomap1.cxx | 30 ++ sw/source/core/unocore/unomapproperties.hxx | 27 ++ sw/source/uibase/docvw/edtwin.cxx|2 sw/source/uibase/inc/uitool.hxx |3 sw/source/uibase/shells/basesh.cxx |6 sw/source/uibase/shells/frmsh.cxx| 16 - sw/source/uibase/shells/textsh1.cxx | 34 +-- sw/source/uibase/sidebar/PageStylesPanel.cxx |5 sw/source/uibase/utlui/uitool.cxx|7 26 files changed, 644 insertions(+), 135 deletions(-) New commits: commit cc6db9f418cae422a4733163f85801c5a14f47c8 Author: Tomaž Vajngerl AuthorDate: Tue May 30 21:11:28 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jun 4 18:27:45 2023 +0200 sw: border and background theme color support for multiple props. This adds support for theme colors for multiple properties that are stored in SvxBoxItem and SvxBrushItem / XFillColorItem. For those items the ComplexColor member variable was introduced. The UNO properties for the colors are added. The properties with the added support includes paragraph border and background + styles, page border and background, frame border and background + styles. The ThemeColorChanges has been extended to support changing the colors for those propertes. Color picker and tab pages have been fixed so they pass or set the theme color properties to the items. Change-Id: Id27272f5c4a448703a62a759d829e8a9540066e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152397 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 9b94bc0eb28a..549ab533410a 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -1234,8 +1234,8 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelSdwHdl_Impl, ValueSet*, void) IMPL_LINK(SvxBorderTabPage, SelColHdl_Impl, ColorListBox&, rColorBox, void) { -Color aColor = rColorBox.GetSelectEntryColor(); -m_aFrameSel.SetColorToSelection(aColor); +NamedColor aNamedColor = rColorBox.GetSelectedEntry(); +m_aFrameSel.SetColorToSelection(aNamedColor.m_aColor, aNamedColor.getComplexColor()); } IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthLBHdl_Impl, weld::ComboBox&, void) diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 7a8788728b46..ace220bcc5c0 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2095,21 +2095,26 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet ) //! item-state in the 'rOldSet' will be invalid. In this case //! changing the underline style will be allowed if a style is //! selected in the listbox. -bool bAllowChg = nPos != -1 && +bool bAllowChange = nPos != -1 && SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich ); const SvxUnderlineItem& rItem = *static_cast(pOld); -if ( rItem.GetValue() == eUnder && - ( LINESTYLE_NONE == eUnder || rItem.GetColor() == m_xUnderlineColorLB->GetSelectEntryColor() ) && - ! bAllowChg ) +if (rItem.GetValue() == eUnder && + (LINESTYLE_NONE == eUnder || (rItem.GetColor() == m_xUnderlineColorLB->GetSelectEntryColor() && + rItem.getComplexColor() == m_xUnderlineColorLB->GetSelectedEntry().getComplexColor())) && + !bAllowChange) +{ bChanged = false; +} } if ( bChanged ) { SvxUnderlineItem aNewItem( eUnder, nWhich ); -aNewItem.SetColor( m_xUnderlineColorLB->GetSelectEntryColor() ); -rSet->Put( aNewItem ); +auto aNamedColor = m_xUnderlineColorLB->GetSelectedEntry(); +aNewItem.SetColor(aNamedColor.m_aColor); +aNewItem.setComplexColor(aNamedColor.getComplexColor()); +rSet->Put(aNewItem); bMo
[Libreoffice-commits] core.git: configure.ac
configure.ac | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) New commits: commit f2b270e79016097077bd49c0ae4ac2b8762dc91b Author: خالد حسني AuthorDate: Sun Jun 4 15:09:15 2023 +0200 Commit: Khaled Hosny (خالد حسني) CommitDate: Sun Jun 4 17:26:12 2023 +0200 Revert "Fix ccache cache size detection" This reverts commit 70fd835b4cf75e386ee115c705241a4059fb68a8. Reason for revert: cache_size_kibibyte is the current cache size not the maximum size Change-Id: Idca3f7f3af9d2d6f20a50cb8360754dc63729726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152542 Tested-by: Jenkins Reviewed-by: Khaled Hosny (خالد حسني) diff --git a/configure.ac b/configure.ac index 06a60ebf8d8d..e86e3c30141d 100644 --- a/configure.ac +++ b/configure.ac @@ -3316,15 +3316,31 @@ AC_SUBST(CCACHE_DEPEND_MODE) # sccache defaults are good enough if test "$CCACHE" != "" -a -z "$SCCACHE"; then -ccache_size=$($CCACHE --print-stats | $AWK /cache_size_kibibyte/'{ print $2 }') -if test $ccache_size -lt 976563; then -CCACHE="" -AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection]) -add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled" -elif test $ccache_size -lt 4883000; then -# warn that ccache may be too small for debug build -AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build]) -add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build" +# e.g. (/home/rene/.config/ccache/ccache.conf) max_size = 20.0G +# -p works with both 4.2 and 4.4 +ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 }' | sed -e 's/\.[0-9]*//']) +ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//') +if test "$ccache_size" = ""; then +ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//') +if test "$ccache_size" = ""; then +ccache_size=0 +fi +# we could not determine the size or it was less than 1GB -> disable auto-ccache +if test $ccache_size -lt 1024; then +CCACHE="" +AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection]) +add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled" +else +# warn that ccache may be too small for debug build +AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build]) +add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build" +fi +else +if test $ccache_size -lt 5; then +#warn that ccache may be too small for debug build +AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build]) +add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build" +fi fi fi
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/userlist.hxx |3 --- sc/source/core/tool/userlist.cxx | 17 ++--- 2 files changed, 2 insertions(+), 18 deletions(-) New commits: commit 83eee0095c337e454acd5368f70855e34ec4a174 Author: Mike Kaganski AuthorDate: Sun Jun 4 14:34:47 2023 +0200 Commit: Mike Kaganski CommitDate: Sun Jun 4 16:50:36 2023 +0200 ScUserListData::InitTokens can't produce different splits ... for the same input, because ScGlobal::cListDelimiter is a constant. This means, that the copy ctor and assignment operator can be default, and ScUserListData comparison can be simplified. Change-Id: I500892ab592fd0dd24550c5189151f670efed4d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152541 Reviewed-by: Noel Grandin Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 1cf759e463e7..b421c33370db 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -46,9 +46,6 @@ private: public: ScUserListData(OUString aStr); -// Copy ctor and assignment operator re-initialize tokens. Is this intended on copy? -ScUserListData(const ScUserListData& rData); -ScUserListData& operator=(const ScUserListData& rData); const OUString& GetString() const { return aStr; } void SetString(const OUString& rStr); diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 984b51c1058e..b91d3ba3819a 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -34,12 +34,11 @@ ScUserListData::SubStr::SubStr(OUString aReal, OUString aUpper) : void ScUserListData::InitTokens() { -sal_Unicode cSep = ScGlobal::cListDelimiter; maSubStrings.clear(); sal_Int32 nIndex = 0; do { -OUString aSub = aStr.getToken(0, cSep, nIndex); +OUString aSub = aStr.getToken(0, ScGlobal::cListDelimiter, nIndex); if (!aSub.isEmpty()) { OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); @@ -54,18 +53,6 @@ ScUserListData::ScUserListData(OUString _aStr) : InitTokens(); } -ScUserListData::ScUserListData(const ScUserListData& rData) : -aStr(rData.aStr) -{ -InitTokens(); -} - -ScUserListData& ScUserListData::operator=(const ScUserListData& rData) -{ -SetString(rData.aStr); -return *this; -} - void ScUserListData::SetString( const OUString& rStr ) { aStr = rStr; @@ -249,7 +236,7 @@ bool ScUserList::operator==( const ScUserList& r ) const { return std::equal(maData.begin(), maData.end(), r.maData.begin(), r.maData.end(), [](const ScUserListData& lhs, const ScUserListData& rhs) { -return (lhs.GetString() == rhs.GetString()) && (lhs.GetSubCount() == rhs.GetSubCount()); +return lhs.GetString() == rhs.GetString(); }); }
[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-23.05.0-3'
Tag 'cp-23.05.0-3' created by Andras Timar at 2023-06-04 14:46 + cp-23.05.0-3 Changes since cp-23.05.0-2-108: --- 0 files changed ---
[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-23.05.0-3'
Tag 'cp-23.05.0-3' created by Andras Timar at 2023-06-04 14:46 + cp-23.05.0-3 Changes since cp-23.05.0-2-1: --- 0 files changed ---
[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-23.05.0-3'
Tag 'cp-23.05.0-3' created by Andras Timar at 2023-06-04 14:46 + cp-23.05.0-3 Changes since co-23.05-branch-point-9: --- 0 files changed ---
[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-23.05.0-3'
Tag 'cp-23.05.0-3' created by Andras Timar at 2023-06-04 14:46 + cp-23.05.0-3 Changes since co-23.05-branch-point: Andras Timar (1): On Linux dictionaries are packaged separately --- Module_dictionaries.mk |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - configure.ac
configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7dbb601eb61bc50df79bde9e071042560c1f23b8 Author: Andras Timar AuthorDate: Sun Jun 4 16:44:54 2023 +0200 Commit: Andras Timar CommitDate: Sun Jun 4 16:44:54 2023 +0200 Bump version to 23.05.0.3 Change-Id: I0c88a3ba9b02a484ea4ec4a8f919b35ec5ed9a8b diff --git a/configure.ac b/configure.ac index d5b31cb55d16..ab38d98228c2 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[23.05.0.2],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[23.05.0.3],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - translations
translations |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 270756154c41d19397db60242720f75b8db2a2c9 Author: Martin Srebotnjak AuthorDate: Sun Jun 4 16:35:00 2023 +0200 Commit: Gerrit Code Review CommitDate: Sun Jun 4 16:35:00 2023 +0200 Update git submodules * Update translations from branch 'distro/collabora/co-23.05' to 06777a9277072ef5a3382b3168f3edf33d2aa511 - Updated Slovenian translation Change-Id: I8816df9aa1b2329f68cdedebcc87e8a19b799b03 - update translations for 7.5.4 rc2 and force-fix errors using pocheck Change-Id: I2dfd1d2c48495c7e905d6f350d2d2efa783a2e91 diff --git a/translations b/translations index 800c67d1a572..06777a927707 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 800c67d1a572474e137f03e93c7f3122ffa7febc +Subproject commit 06777a9277072ef5a3382b3168f3edf33d2aa511
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 31 commits - basegfx/source drawinglayer/source emfio/qa include/basegfx include/svx include/xmloff oox/source readlicense_oo/licen
basegfx/source/tools/bgradient.cxx | 206 basegfx/source/tools/gradienttools.cxx | 99 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 205 drawinglayer/source/tools/emfphelperdata.cxx | 56 drawinglayer/source/tools/emfphelperdata.hxx |2 drawinglayer/source/tools/emfppath.cxx | 126 drawinglayer/source/tools/emfppath.hxx |5 emfio/qa/cppunit/emf/EmfImportTest.cxx | 186 emfio/qa/cppunit/emf/data/TestEmfPlusFillClosedCurve.emf |binary emfio/qa/cppunit/emf/data/TestEmfPlusRecordTypeDrawCurve.emf |binary include/basegfx/utils/bgradient.hxx | 29 include/basegfx/utils/gradienttools.hxx | 21 include/svx/sdr/contact/viewobjectcontact.hxx|3 include/xmloff/GradientStyle.hxx |4 include/xmloff/HatchStyle.hxx|4 oox/source/drawingml/fillproperties.cxx | 97 oox/source/export/drawingml.cxx | 61 readlicense_oo/license/CREDITS.fodt | 3438 +-- sc/qa/uitest/calc_tests9/tdf154174.py| 35 sc/source/core/data/column3.cxx | 23 sc/source/core/data/conditio.cxx |2 sc/source/core/data/dociter.cxx |6 sc/source/ui/view/viewfunc.cxx |2 sd/source/ui/dlg/navigatr.cxx|1 sd/source/ui/dlg/sdtreelb.cxx| 35 svtools/source/misc/sampletext.cxx |5 svx/source/sdr/contact/viewobjectcontact.cxx | 11 svx/source/xoutdev/xattr.cxx |7 sw/qa/extras/htmlexport/data/listsWithNumFormat.fodt | 74 sw/qa/extras/htmlexport/data/tableRight.fodt | 22 sw/qa/extras/htmlexport/htmlexport.cxx | 31 sw/qa/extras/uiwriter/data/pageBreakWithPageStyle.fodt | 17 sw/qa/extras/uiwriter/uiwriter8.cxx | 32 sw/qa/extras/ww8export/data/tdf104704_mangledFooter.odt |binary sw/qa/extras/ww8export/ww8export4.cxx|5 sw/source/core/doc/docfmt.cxx| 60 sw/source/core/doc/notxtfrm.cxx |3 sw/source/core/text/porlay.cxx | 24 sw/source/filter/html/htmlnumwriter.cxx |5 sw/source/filter/html/htmltabw.cxx | 19 sw/source/filter/ww8/ww8atr.cxx |5 sw/source/uibase/uiview/viewmdi.cxx | 13 vcl/inc/osx/a11ywrapper.h|3 vcl/osx/a11ytextattributeswrapper.mm |1 vcl/osx/a11ywrapper.mm | 72 vcl/osx/salframeview.mm |8 vcl/qa/cppunit/pdfexport/data/tdf155190.odt |binary vcl/qa/cppunit/pdfexport/pdfexport.cxx | 96 vcl/quartz/salgdi.cxx|6 vcl/source/gdi/CommonSalLayout.cxx |2 vcl/source/gdi/impglyphitem.cxx |5 vcl/source/gdi/sallayout.cxx | 13 vcl/source/outdev/font.cxx |8 xmloff/qa/unit/data/MCGR_Border_restoration.pptx |binary xmloff/qa/unit/data/MCGR_TransparencyBorder_restoration.pptx |binary xmloff/qa/unit/style.cxx | 76 xmloff/source/style/GradientStyle.cxx| 116 xmloff/source/style/HatchStyle.cxx | 26 xmloff/source/style/TransGradientStyle.cxx | 72 59 files changed, 3224 insertions(+), 2259 deletions(-) New commits: commit dd2c45a12218f63be5121ce113a0e75bd317aba1 Author: Regina Henschel AuthorDate: Thu Jun 1 19:01:00 2023 +0200 Commit: Andras Timar CommitDate: Sun Jun 4 16:34:12 2023 +0200 MCGR: Use tryToRecreateBorder too for transparency This is similar to 'Use tryToRecreateBorder for better BW comp with LO' (see commit 8259a99f41367a1d8326c9157fe1902915715879), but now for transparency gradients. Change-Id: I1c2e11562fa998c364896d517f4ed3bfe92f6c15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152508 Tested-by: Jenkins Reviewed-by: Regina Henschel diff --git a/xmloff/qa/unit/data/MCGR_TransparencyBorder_restoration.pptx b/xmloff/qa/unit/data/MCGR_TransparencyBorder_restoration.pptx new file mode 100644 index ..f
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - cui/qa cui/source include/svx svx/source
cui/qa/uitest/dialogs/chardlg.py |4 cui/source/tabpages/tpcolor.cxx|8 + include/svx/PaletteManager.hxx | 25 - include/svx/strings.hrc| 15 +-- svx/source/tbxctrls/PaletteManager.cxx | 155 +++-- svx/source/tbxctrls/tbcontrl.cxx | 14 +- 6 files changed, 174 insertions(+), 47 deletions(-) New commits: commit ab90ce6f21e6adef70d39f08749ce9fcf30bcbd6 Author: Tomaž Vajngerl AuthorDate: Thu May 25 00:53:22 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jun 4 15:38:12 2023 +0200 tdf#153361 improve theme color generation in color picker The theme color generator needs to take color luminocity into account, so that the very dark or very light colors are properly shaded. Otherwise a too dark color will generate a too dark (almost black) color variant, or a too light a too light (almost white) color variant. However those colors aren't useful. Change-Id: Id803a8f6f1a79cbc822ed2d7faca9bec228c0188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152237 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit e6215c7233c0fb437a81b51c8a8a30bb53eef65f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152517 Tested-by: Jenkins CollaboraOffice diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py index 4a756cf6c979..85e60f766238 100644 --- a/cui/qa/uitest/dialogs/chardlg.py +++ b/cui/qa/uitest/dialogs/chardlg.py @@ -115,8 +115,8 @@ class Test(UITestCase): # AssertionError: 1 != 2000 # i.e. the effects where not applied, luminance modulation was the default instead of a # custom value. -self.assertEqual(portion.CharColorLumMod, 2000) -self.assertEqual(portion.CharColorLumOff, 8000) +self.assertEqual(portion.CharColorLumMod, 5000) +self.assertEqual(portion.CharColorLumOff, 5000) def testSvxCharEffectsPageWriter(self): # Start Writer. diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index fd458ee9b08f..cf09baf45c06 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -523,7 +523,13 @@ IMPL_LINK(SvxColorTabPage, SelectValSetHdl_Impl, ValueSet*, pValSet, void) aNamedColor.m_aColor = aColor; if (bThemePaletteSelected) { -PaletteManager::GetThemeIndexLumModOff(nPos, aNamedColor.m_nThemeIndex, aNamedColor.m_nLumMod, aNamedColor.m_nLumOff); +sal_uInt16 nThemeIndex; +sal_uInt16 nEffectIndex; +if (PaletteManager::GetThemeAndEffectIndex(nPos, nThemeIndex, nEffectIndex)) +{ +aNamedColor.m_nThemeIndex = nThemeIndex; +maPaletteManager.GetLumModOff(nThemeIndex, nEffectIndex, aNamedColor.m_nLumMod, aNamedColor.m_nLumOff); +} } ChangeColor(aNamedColor, false); diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx index c6d1712a12f4..37d22b92ec64 100644 --- a/include/svx/PaletteManager.hxx +++ b/include/svx/PaletteManager.hxx @@ -32,6 +32,26 @@ namespace com::sun::star::uno { class XComponentContext; } namespace svx { class ToolboxButtonColorUpdaterBase; } namespace weld { class Window; } +enum class ThemePaletteColorType +{ +Black, +White, +Low, +High, +Normal +}; + +struct ThemePaletteData +{ +ThemePaletteColorType meType = ThemePaletteColorType::Normal; +Color maColor; +}; + +struct ThemePaletteCollection +{ +std::array maData; +}; + class SVXCORE_DLLPUBLIC PaletteManager { const sal_uInt16mnMaxRecentColors; @@ -49,6 +69,7 @@ class SVXCORE_DLLPUBLIC PaletteManager ColorSelectFunction maColorSelectFunction; std::unique_ptr m_pColorDlg; +std::optional moThemePaletteCollection; PaletteManager(const PaletteManager* pClone); public: @@ -79,8 +100,8 @@ public: PaletteManager* Clone() const; -static void GetThemeIndexLumModOff(sal_uInt16 nItemId, sal_Int16& rThemeIndex, - sal_Int16& rLumMod, sal_Int16& rLumOff); +static bool GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16& rThemeIndex, sal_uInt16& rEffectIndex); +bool GetLumModOff(sal_uInt16 nThemeIndex, sal_uInt16 nEffect, sal_Int16& rLumMod, sal_Int16& rLumOff); static void DispatchColorCommand(const OUString& aCommand, const NamedColor& rColor); }; diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 6f8a353a4204..86422a9a63a8 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1121,10 +1121,10 @@ #define RID_SVXSTR_DOC_COLORS NC_("RID_SVXSTR_DOC_COLORS", "Document colors") #define RID_SVXSTR_THEME_COLORS NC_("RID_SVXSTR_THEME_COLORS", "Theme colors") #define RID_SVXSTR_DOC_COLOR_PREFIX NC_("RID_SVXS
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/docmodel oox/qa schema/libreoffice xmloff/qa xmloff/source
include/docmodel/color/ComplexColor.hxx |2 + oox/qa/unit/data/ReferenceShapeFill.fodp| 14 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |3 + xmloff/qa/unit/data/theme.fodp | 20 ++-- xmloff/qa/unit/draw.cxx |6 +++ xmloff/source/text/XMLComplexColorContext.cxx |8 xmloff/source/text/XMLComplexColorExport.cxx|1 7 files changed, 37 insertions(+), 17 deletions(-) New commits: commit 433a2ced036b8522a60559d9ca6387e5b478e3a9 Author: Tomaž Vajngerl AuthorDate: Thu May 25 13:55:21 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jun 4 15:37:30 2023 +0200 xmloff: add color-type attribute to complex color We need to identify what the color type of the complex color is. For now we mostly use "theme", but in the future we can also have other types like "rgb",... when the infrastructure for that is built. Change-Id: I38c91d294a191ca3124be4e99050977c9815d23e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152253 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 38e0e78998153463caf9c3c72ef7f4549ddff0e8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152516 Tested-by: Jenkins CollaboraOffice diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx index 471c6b30e4d1..1cac6816bfa5 100644 --- a/include/docmodel/color/ComplexColor.hxx +++ b/include/docmodel/color/ComplexColor.hxx @@ -92,6 +92,8 @@ public: public: ColorType getType() const { return meType; } +void setType(ColorType eType) { meType = eType; } + ThemeColorType getSchemeType() const { return meSchemeType; } Color getRGBColor() const { return Color(mnComponent1, mnComponent2, mnComponent3); } diff --git a/oox/qa/unit/data/ReferenceShapeFill.fodp b/oox/qa/unit/data/ReferenceShapeFill.fodp index d3db08712ac9..432891b0d849 100644 --- a/oox/qa/unit/data/ReferenceShapeFill.fodp +++ b/oox/qa/unit/data/ReferenceShapeFill.fodp @@ -350,28 +350,28 @@ - + - + - + - + @@ -489,7 +489,7 @@ - + @@ -531,7 +531,7 @@ - + @@ -585,7 +585,7 @@ - + diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng index 50968cb1a62e..8160b6bbd845 100644 --- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng +++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng @@ -3411,6 +3411,9 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. + + + diff --git a/xmloff/qa/unit/data/theme.fodp b/xmloff/qa/unit/data/theme.fodp index b1e719d77959..dd6460281897 100644 --- a/xmloff/qa/unit/data/theme.fodp +++ b/xmloff/qa/unit/data/theme.fodp @@ -351,28 +351,28 @@ - + - + - + - + @@ -490,7 +490,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -625,19 +625,19 @@ - + - + - + @@ -994,4 +994,4 @@ - \ No newline at end of file + diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 5f6b46af1044..c46f70db3806 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -250,6 +250,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport) // Text color OString aStyle1( "//style:style[@style:name='T2']/style:text-properties/loext:char-complex-color"); +assertXPath(pXmlDoc, aStyle1, "color-type", "theme"); assertXPath(pXmlDoc, aStyle1, "theme-type", "accent3"); assertXPath(pXmlDoc, aStyle1 + "/loext:transformation[1]", "type", "lummod"); assertXPath(pXmlDoc, aStyle1 + "/loext:transformation[1]", "value", "2000"); @@ -258,6 +259,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport) OString aStyle2( "//style:style[@style:name='T3']/style:text-properties/loext:char-complex-color"); +assertXPath(pXmlDoc, aStyle1, "color-type", "theme"); assertXPath(pXmlDoc, aStyle2, "theme-type", "accent3"); assertXPath(pXmlDoc, aStyle2 + "/loext:transformation[1]", "type", "lummod"); assertXPath(pXmlDoc, aStyle2 + "/loext:transformation[1]", "value", "6000"); @@ -266,6 +268,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport) OString aStyle3( "//style:st
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/userlist.hxx |5 +- sc/source/core/tool/userlist.cxx | 67 ++- 2 files changed, 14 insertions(+), 58 deletions(-) New commits: commit 7bbec0dfaac7b4a579c963e0724f5355da2b8df8 Author: Mike Kaganski AuthorDate: Sun Jun 4 13:50:45 2023 +0200 Commit: Mike Kaganski CommitDate: Sun Jun 4 14:56:12 2023 +0200 Simplify a bit Change-Id: Iaea9a425fc93adc716bdb4944244a14175cf7538 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152540 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 80968361ceac..1cf759e463e7 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -39,8 +39,7 @@ public: }; private: -typedef std::vector SubStringsType; -SubStringsType maSubStrings; +std::vector maSubStrings; OUString aStr; SAL_DLLPRIVATE void InitTokens(); @@ -53,7 +52,7 @@ public: const OUString& GetString() const { return aStr; } void SetString(const OUString& rStr); -size_t GetSubCount() const; +size_t GetSubCount() const { return maSubStrings.size(); } bool GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bool& bMatchCase) const; OUString GetSubStr(sal_uInt16 nIndex) const; sal_Int32 Compare(const OUString& rSubStr1, const OUString& rSubStr2) const; diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index f38a16d98f12..984b51c1058e 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -29,22 +29,6 @@ #include #include -namespace { - -class FindByName -{ -const OUString& mrName; -bool mbUpper; -public: -FindByName(const OUString& rName, bool bUpper) : mrName(rName), mbUpper(bUpper) {} -bool operator() (const ScUserListData::SubStr& r) const -{ -return mbUpper ? r.maUpper == mrName : r.maReal == mrName; -} -}; - -} - ScUserListData::SubStr::SubStr(OUString aReal, OUString aUpper) : maReal(std::move(aReal)), maUpper(std::move(aUpper)) {} @@ -52,37 +36,16 @@ void ScUserListData::InitTokens() { sal_Unicode cSep = ScGlobal::cListDelimiter; maSubStrings.clear(); -const sal_Unicode* p = aStr.getStr(); -const sal_Unicode* p0 = p; -sal_Int32 nLen = 0; -bool bFirst = true; -for (sal_Int32 i = 0, n = aStr.getLength(); i < n; ++i, ++p, ++nLen) +sal_Int32 nIndex = 0; +do { -if (bFirst) +OUString aSub = aStr.getToken(0, cSep, nIndex); +if (!aSub.isEmpty()) { -// very first character, or the first character after a separator. -p0 = p; -nLen = 0; -bFirst = false; -} -if (*p == cSep) -{ -if (nLen) -{ -OUString aSub(p0, nLen); -OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); -maSubStrings.emplace_back(aSub, aUpStr); -} -bFirst = true; +OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); +maSubStrings.emplace_back(aSub, aUpStr); } -} - -if (nLen) -{ -OUString aSub(p0, nLen); -OUString aUpStr = ScGlobal::getCharClass().uppercase(aSub); -maSubStrings.emplace_back(aSub, aUpStr); -} +} while (nIndex >= 0); } ScUserListData::ScUserListData(OUString _aStr) : @@ -109,16 +72,11 @@ void ScUserListData::SetString( const OUString& rStr ) InitTokens(); } -size_t ScUserListData::GetSubCount() const -{ -return maSubStrings.size(); -} - bool ScUserListData::GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bool& bMatchCase) const { // First, case sensitive search. -SubStringsType::const_iterator itr = ::std::find_if( -maSubStrings.begin(), maSubStrings.end(), FindByName(rSubStr, false)); +auto itr = ::std::find_if(maSubStrings.begin(), maSubStrings.end(), + [&rSubStr](const SubStr& item) { return item.maReal == rSubStr; }); if (itr != maSubStrings.end()) { rIndex = ::std::distance(maSubStrings.begin(), itr); @@ -127,16 +85,15 @@ bool ScUserListData::GetSubIndex(const OUString& rSubStr, sal_uInt16& rIndex, bo } // When that fails, do a case insensitive search. +bMatchCase = false; OUString aUpStr = ScGlobal::getCharClass().uppercase(rSubStr); -itr = ::std::find_if( -maSubStrings.begin(), maSubStrings.end(), FindByName(aUpStr, true)); +itr = ::std::find_if(maSubStrings.begin(), maSubStrings.end(), + [&aUpStr](const SubStr& item) { return item.maUpper == aUpStr; }); if (itr != maSubStrings.end()) { rIndex = ::std::distance(maSubStrings.begin(), itr); -bMatchCase = false; return true; } -bMatchCase = false; return false; }
[Libreoffice-commits] core.git: scp2/source solenv/bin
scp2/source/calc/registryitem_calc.scp |1 + scp2/source/calc/registryitem_calc.ulf |3 +++ solenv/bin/modules/installer/windows/property.pm |1 + 3 files changed, 5 insertions(+) New commits: commit e7b1f93cd681e2d0094f5937f4132aa4e780ab9e Author: Julien Nabet AuthorDate: Sun May 28 20:36:40 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jun 4 14:31:23 2023 +0200 tdf#71096: xlr filetype not associated with Calc in Windows Change-Id: Ifb9f74f2bd1532ebf364a3d554d303c1209393cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152360 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/scp2/source/calc/registryitem_calc.scp b/scp2/source/calc/registryitem_calc.scp index 7e9dd8e8d488..b6cf9c3df5c3 100644 --- a/scp2/source/calc/registryitem_calc.scp +++ b/scp2/source/calc/registryitem_calc.scp @@ -1252,6 +1252,7 @@ REGISTER_PROPERTY_HANDLER_FOR_EXTENSION( stc ) // registering the mso file types +CONDITIONAL_REGISTER_DOC_EXTENSION( Xlr, gid_Module_Prg_Calc_MSO_Reg, xlr, XLR, MS_WORKS, 3, scalc.exe, open, Calc ) CONDITIONAL_REGISTER_DOC_EXTENSION( Xls, gid_Module_Prg_Calc_MSO_Reg, xls, XLS, MS_EXCEL_WORKSHEET_OLD, 3, scalc.exe, open, Calc ) CONDITIONAL_REGISTER_DOC_EXTENSION( Xlsx, gid_Module_Prg_Calc_MSO_Reg, xlsx, XLSX, MS_EXCEL_WORKSHEET, 3, scalc.exe, open, Calc ) CONDITIONAL_REGISTER_DOC_EXTENSION( Xlsm, gid_Module_Prg_Calc_MSO_Reg, xlsm, XLSM, MS_EXCEL_WORKSHEET, 3, scalc.exe, open, Calc ) diff --git a/scp2/source/calc/registryitem_calc.ulf b/scp2/source/calc/registryitem_calc.ulf index e12714de682d..d3f7efbb14aa 100644 --- a/scp2/source/calc/registryitem_calc.ulf +++ b/scp2/source/calc/registryitem_calc.ulf @@ -54,3 +54,6 @@ en-US = "Lotus Quattro Pro Spreadsheet" [STR_REG_VAL_NUMBERS_SPREADSHEET] en-US = "Apple Numbers" + +[STR_REG_VAL_MS_WORKS] +en-US = "Microsoft Works Spreadsheet with Excel format" diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm index 60300e49ff58..701086af3a66 100644 --- a/solenv/bin/modules/installer/windows/property.pm +++ b/solenv/bin/modules/installer/windows/property.pm @@ -375,6 +375,7 @@ sub set_ms_file_types_properties push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n"); push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n"); +push(@{$propertyfile}, "REGISTER_XLR" . "\t" . "0" . "\n"); push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n"); push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n"); push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n");
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/userlist.hxx |3 ++- sc/source/core/tool/appoptio.cxx | 12 +++- sc/source/core/tool/userlist.cxx | 21 + 3 files changed, 18 insertions(+), 18 deletions(-) New commits: commit 182974354e4536af568dfb05a7400e48a2fe1032 Author: Mike Kaganski AuthorDate: Sun Jun 4 12:58:46 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 14:17:35 2023 +0200 Optimize ScAppCfg::ReadSortListCfg Do not initialize defaults when using custom user list. Change-Id: I8428a20b65182011a25325f0b7298ea51998346b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152587 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index 7625ad15f5ee..80968361ceac 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -69,9 +69,10 @@ class SC_DLLPUBLIC ScUserList DataType maData; public: -ScUserList(); +explicit ScUserList(bool initDefault = true); ScUserList(const ScUserList& r) = default; +void AddDefaults(); void EraseData(size_t nIndex) { maData.erase(maData.cbegin() + nIndex); } const ScUserListData* GetData(const OUString& rSubStr) const; diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 16a0c4cb9174..9dbc85f310ae 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -407,16 +407,18 @@ void ScAppCfg::ReadSortListCfg() if (Sequence aSeq; aValues[SCSORTLISTOPT_LIST] >>= aSeq) { -ScUserList aList; +ScUserList aList(false); // Do not init defaults -// if setting is "default", keep default values from ScUserList ctor +// if setting is "default", keep default values //TODO: mark "default" in a safe way const bool bDefault = (aSeq.getLength() == 1 && aSeq[0] == "NULL"); -if (!bDefault) +if (bDefault) +{ +aList.AddDefaults(); +} +else { -aList.clear(); - for (const OUString& rStr : std::as_const(aSeq)) { aList.emplace_back(rStr); diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 4540ad3ea0f6..f38a16d98f12 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -200,20 +200,18 @@ sal_Int32 ScUserListData::ICompare(const OUString& rSubStr1, const OUString& rSu return ScGlobal::GetTransliteration().compareString( rSubStr1, rSubStr2 ); } -ScUserList::ScUserList() +ScUserList::ScUserList(bool initDefault) { -using namespace ::com::sun::star; +if (initDefault) +AddDefaults(); +} +void ScUserList::AddDefaults() +{ sal_Unicode cDelimiter = ScGlobal::cListDelimiter; -uno::Sequence< i18n::CalendarItem2 > xCal; - -const uno::Sequence< i18n::Calendar2 > xCalendars( -ScGlobal::getLocaleData().getAllCalendars() ); - -for ( const auto& rCalendar : xCalendars ) +for (const auto& rCalendar : ScGlobal::getLocaleData().getAllCalendars()) { -xCal = rCalendar.Days; -if ( xCal.hasElements() ) +if (const auto& xCal = rCalendar.Days; xCal.hasElements()) { OUStringBuffer aDayShortBuf(32), aDayLongBuf(64); sal_Int32 i; @@ -244,8 +242,7 @@ ScUserList::ScUserList() emplace_back(aDayLong); } -xCal = rCalendar.Months; -if ( xCal.hasElements() ) +if (const auto& xCal = rCalendar.Months; xCal.hasElements()) { OUStringBuffer aMonthShortBuf(128), aMonthLongBuf(128); sal_Int32 i;
[Libreoffice-commits] core.git: sc/inc sc/qa sc/source
sc/inc/userlist.hxx | 37 ++--- sc/qa/unit/copy_paste_test.cxx|3 - sc/source/core/tool/appoptio.cxx |3 - sc/source/core/tool/userlist.cxx | 80 +- sc/source/filter/oox/autofilterbuffer.cxx |2 sc/source/ui/optdlg/tpusrlst.cxx |8 --- sc/source/ui/unoobj/appluno.cxx |3 - 7 files changed, 38 insertions(+), 98 deletions(-) New commits: commit 1fa085f223761b8dcd7e7ac592eb70450a774543 Author: Mike Kaganski AuthorDate: Sun Jun 4 12:48:50 2023 +0300 Commit: Mike Kaganski CommitDate: Sun Jun 4 14:13:24 2023 +0200 Simplify ScUserList, don't use unique_ptr. Change-Id: Idd0ce7bfff115a3b762e963dd6cea7927c78e295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152586 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx index e91fbcc0164e..7625ad15f5ee 100644 --- a/sc/inc/userlist.hxx +++ b/sc/inc/userlist.hxx @@ -23,13 +23,12 @@ #include -#include #include /** * Stores individual user-defined sort list. */ -class SC_DLLPUBLIC ScUserListData +class SC_DLLPUBLIC ScUserListData final { public: struct SAL_DLLPRIVATE SubStr @@ -48,8 +47,9 @@ private: public: ScUserListData(OUString aStr); +// Copy ctor and assignment operator re-initialize tokens. Is this intended on copy? ScUserListData(const ScUserListData& rData); -~ScUserListData(); +ScUserListData& operator=(const ScUserListData& rData); const OUString& GetString() const { return aStr; } void SetString(const OUString& rStr); @@ -65,32 +65,31 @@ public: */ class SC_DLLPUBLIC ScUserList { -typedef std::vector> DataType; +typedef std::vector DataType; DataType maData; public: -typedef DataType::iterator iterator; -typedef DataType::const_iterator const_iterator; - ScUserList(); -ScUserList(const ScUserList& r); +ScUserList(const ScUserList& r) = default; + +void EraseData(size_t nIndex) { maData.erase(maData.cbegin() + nIndex); } const ScUserListData* GetData(const OUString& rSubStr) const; /// If the list in rStr is already inserted bool HasEntry(std::u16string_view rStr) const; -const ScUserListData& operator[](size_t nIndex) const; -ScUserListData& operator[](size_t nIndex); -ScUserList& operator=(const ScUserList& r); +const ScUserListData& operator[](size_t nIndex) const { return maData[nIndex]; } +ScUserListData& operator[](size_t nIndex) { return maData[nIndex]; } +ScUserList& operator=(const ScUserList& r) = default; bool operator==(const ScUserList& r) const; -bool operator!=(const ScUserList& r) const; - -iterator begin(); -const_iterator begin() const; -void clear(); -size_t size() const; -void push_back(ScUserListData* p); -void erase(const iterator& itr); +bool operator!=(const ScUserList& r) const { return !operator==(r); } + +void clear() { maData.clear(); } +size_t size() const { return maData.size(); } +template void emplace_back(Args&&... args) +{ +maData.emplace_back(std::forward(args)...); +} }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx index b91dee89dea2..879c01844ba3 100644 --- a/sc/qa/unit/copy_paste_test.cxx +++ b/sc/qa/unit/copy_paste_test.cxx @@ -613,8 +613,7 @@ void ScCopyPasteTest::tdf137205_autofillDatesInMergedCells() void ScCopyPasteTest::addToUserList(const OUString& rStr) { -ScUserListData* aListData = new ScUserListData(rStr); -ScGlobal::GetUserList()->push_back(aListData); +ScGlobal::GetUserList()->emplace_back(rStr); } void ScCopyPasteTest::tdf137653_137654_autofillUserlist() diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 3b19fbed2204..16a0c4cb9174 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -419,8 +419,7 @@ void ScAppCfg::ReadSortListCfg() for (const OUString& rStr : std::as_const(aSeq)) { -ScUserListData* pNew = new ScUserListData(rStr); -aList.push_back(pNew); +aList.emplace_back(rStr); } } diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 6e0a4647a094..4540ad3ea0f6 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -97,8 +97,10 @@ ScUserListData::ScUserListData(const ScUserListData& rData) : InitTokens(); } -ScUserListData::~ScUserListData() +ScUserListData& ScUserListData::operator=(const ScUserListData& rData) { +SetString(rData.aStr); +return *this; } void ScUserListData::SetString( const OUString& rStr ) @@ -237,9 +239,9 @@ ScUserList::ScUserList() OUString aDayLong = aDayLongBuf.makeStringAndClear(
[Libreoffice-commits] core.git: compilerplugins/clang starmath/inc starmath/source
compilerplugins/clang/unusedmethods.results |2 -- starmath/inc/mathml/starmathdatabase.hxx|8 starmath/source/mathml/starmathdatabase.cxx | 11 --- 3 files changed, 21 deletions(-) New commits: commit ca595a7d7e35ca814e4eb6cb5d7afbc88f85c850 Author: Julien Nabet AuthorDate: Sun Jun 4 09:36:02 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jun 4 11:02:34 2023 +0200 Remove unused starmathdatabase::Identify_Color_HTML Seems to be unused since 88c343b50a1de197394e3e22bf82ff455386a80b "Corrected my previous mess on mathml export with color export 2. Now only exports HTML4 colors and others are treated as #RRGGBB. Now mathml can import #RGB colors. " in 2020 Change-Id: Iac006383146afaa62775e6e76fa203925dce51d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152585 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/compilerplugins/clang/unusedmethods.results b/compilerplugins/clang/unusedmethods.results index 8c0beae1aa23..fcda4538fe36 100644 --- a/compilerplugins/clang/unusedmethods.results +++ b/compilerplugins/clang/unusedmethods.results @@ -3026,8 +3026,6 @@ starmath/inc/mathml/mathmlMo.hxx:88 enum moOpDF operator&(enum moOpDF,enum moOpDF) starmath/inc/mathml/mathmlMo.hxx:98 enum moOpDP operator&(enum moOpDP,enum moOpDP) -starmath/inc/mathml/starmathdatabase.hxx:274 -struct SmColorTokenTableEntry starmathdatabase::Identify_Color_HTML(unsigned int) starmath/inc/mathml/starmathdatabase.hxx:294 struct SmColorTokenTableEntry starmathdatabase::Identify_Color_DVIPSNAMES(unsigned int) starmath/inc/node.hxx:508 diff --git a/starmath/inc/mathml/starmathdatabase.hxx b/starmath/inc/mathml/starmathdatabase.hxx index b4d3d6d3f8b5..cd5fe8ecdbdd 100644 --- a/starmath/inc/mathml/starmathdatabase.hxx +++ b/starmath/inc/mathml/starmathdatabase.hxx @@ -265,14 +265,6 @@ SmToken Identify_Postfix_SmXMLOperatorContext_Impl(sal_Unicode cChar); */ SmColorTokenTableEntry Identify_Color_Parser(sal_uInt32 cColor); -/** - * Identifies color from color code cColor. - * It will be returned with the HTML syntax. - * @param cColor - * @param parser color - */ -SmColorTokenTableEntry Identify_Color_HTML(sal_uInt32 cColor); - /** * Identifies color from color code cColor. * It will be returned with the MATHML syntax. diff --git a/starmath/source/mathml/starmathdatabase.cxx b/starmath/source/mathml/starmathdatabase.cxx index 66bdf3f3400c..cc6614cee4f1 100644 --- a/starmath/source/mathml/starmathdatabase.cxx +++ b/starmath/source/mathml/starmathdatabase.cxx @@ -710,17 +710,6 @@ SmColorTokenTableEntry starmathdatabase::Identify_Color_Parser(sal_uInt32 cColor return SmColorTokenTableEntry("", TRGBA, cColor); } -SmColorTokenTableEntry starmathdatabase::Identify_Color_HTML(sal_uInt32 cColor) -{ -for (auto i = std::begin(aColorTokenTableHTML); i < std::end(aColorTokenTableHTML); ++i) -if (i->equals(cColor)) -return i; -if ((cColor & 0x00FF) == cColor) -return SmColorTokenTableEntry("", TRGB, cColor); -else -return SmColorTokenTableEntry("", TRGBA, cColor); -} - SmColorTokenTableEntry starmathdatabase::Identify_Color_MATHML(sal_uInt32 cColor) { for (auto i = std::begin(aColorTokenTableMATHML); i < std::end(aColorTokenTableMATHML); ++i)
[Libreoffice-commits] core.git: starmath/source
starmath/source/mathtype.cxx | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) New commits: commit 97710bbf1df975e896839cd78a34bdab7be7622a Author: Julien Nabet AuthorDate: Sun Jun 4 09:18:16 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jun 4 11:02:01 2023 +0200 MathType::HandleNodes: SmNodeType::Expression does the same as default one Change-Id: I0b7b17bf93470ac07f53c656f91f12b1cec4cd7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152584 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index a3199c06c686..56a666b969f3 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -1976,16 +1976,6 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel) case SmNodeType::SubSup: HandleSubSupScript(pNode,nLevel); break; -case SmNodeType::Expression: -{ -size_t nSize = pNode->GetNumSubNodes(); -for (size_t i = 0; i < nSize; ++i) -{ -if (SmNode *pTemp = pNode->GetSubNode(i)) -HandleNodes(pTemp,nLevel+1); -} -break; -} case SmNodeType::Table: //Root Node, PILE equivalent, i.e. vertical stack HandleTable(pNode,nLevel); @@ -2017,6 +2007,7 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel) else pS->WriteUInt16( 0xEB05 ); break; +case SmNodeType::Expression: // same treatment as the default one default: { size_t nSize = pNode->GetNumSubNodes();
[Libreoffice-commits] core.git: starmath/source
starmath/source/visitors.cxx | 76 +++ 1 file changed, 13 insertions(+), 63 deletions(-) New commits: commit 7932427a39e684d78f2108d14660288a46f42df9 Author: Julien Nabet AuthorDate: Sun Jun 4 09:12:04 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jun 4 09:58:57 2023 +0200 Related tdf#155630: deduplicate in starmath/visitors (2) Change-Id: I86e629260c5f25a67627589f5b33edc939aa1dff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152583 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 92c1ef3413ec..a15a62a4b048 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -954,70 +954,20 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode ) SmSubSupNode* pSubSup = pOper->GetType( ) == SmNodeType::SubSup ? static_cast(pOper) : nullptr; if( pSubSup ) { -SmNode* pChild = pSubSup->GetSubSup( LSUP ); -if( pChild ) { -//Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); -} - -pChild = pSubSup->GetSubSup( LSUB ); -if( pChild ) { -//Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); -} - -pChild = pSubSup->GetSubSup( CSUP ); -if ( pChild ) {//TO -//Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); -} - -pChild = pSubSup->GetSubSup( CSUB ); -if( pChild ) { //FROM -//Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); -} - -pChild = pSubSup->GetSubSup( RSUP ); -if ( pChild ) { -//Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); -} - -pChild = pSubSup->GetSubSup( RSUB ); -if ( pChild ) { +SmNode* pChild; +for (SmSubSup const nodeType : { LSUP, LSUB, CSUP, CSUB, RSUP, RSUB }) +{ +pChild = pSubSup->GetSubSup(nodeType); +if( pChild ) +{ //Create position in front of pChild -SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); -//Visit pChild -mpRightMost = childLeft; -pChild->Accept( this ); -//Set right on mpRightMost from pChild -mpRightMost->SetRight( bodyLeft ); +SmCaretPosGraphEntry *childLeft = mpGraph->Add( SmCaretPos( pChild, 0 ), left ); +//Visit pChild +mpRightMost = childLeft; +pChild->Accept( this ); +//Set right on mpRightMost from pChild +mpRightMost->SetRight( bodyLeft ); +} } }