[Libreoffice-commits] core.git: oox/source
oox/source/shape/WpgContext.cxx | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) New commits: commit c74d97f1218a3592226a4fae4d4c1941dabe4f7a Author: Miklos Vajna AuthorDate: Wed Sep 28 23:40:14 2022 +0200 Commit: Miklos Vajna CommitDate: Thu Sep 29 07:47:59 2022 +0200 oox: avoid else after return in WpgContext It's less code and does the same. Change-Id: I9b08f5b5c982bbf3740d7d5d04156ae01d878705 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140718 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx index 8d83758b7316..339e7a70eac5 100644 --- a/oox/source/shape/WpgContext.cxx +++ b/oox/source/shape/WpgContext.cxx @@ -50,15 +50,13 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken return new oox::shape::WpsContext(*this, uno::Reference(), mpShape, pShape); } -else -{ -// Don't set default character height, Writer has its own way to set -// the default, and if we don't set it here, editeng properly inherits -// it. -oox::drawingml::ShapePtr pShape = std::make_shared( -"com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false); -return new oox::drawingml::ShapeContext(*this, mpShape, pShape); -} + +// Don't set default character height, Writer has its own way to set +// the default, and if we don't set it here, editeng properly inherits +// it. +oox::drawingml::ShapePtr pShape = std::make_shared( +"com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false); +return new oox::drawingml::ShapeContext(*this, mpShape, pShape); } case XML_pic: return new oox::drawingml::GraphicShapeContext( @@ -72,12 +70,10 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken pWPGShape->setFullWPGSupport(m_bFullWPGSupport); return pWPGShape; } -else -{ -return new oox::drawingml::ShapeGroupContext( -*this, mpShape, - std::make_shared("com.sun.star.drawing.GroupShape")); -} + +return new oox::drawingml::ShapeGroupContext( +*this, mpShape, + std::make_shared("com.sun.star.drawing.GroupShape")); } case XML_graphicFrame: {
[Libreoffice-commits] core.git: icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg
icon-themes/sifr/cmd/32/dataconsolidate.png|binary icon-themes/sifr/cmd/32/datasubtotals.png |binary icon-themes/sifr/cmd/32/deletecolumns.png |binary icon-themes/sifr/cmd/32/deleterows.png |binary icon-themes/sifr/cmd/32/diagramdata.png|binary icon-themes/sifr/cmd/32/hidecolumn.png |binary icon-themes/sifr/cmd/32/hiderow.png|binary icon-themes/sifr/cmd/32/insertcolumns.png |binary icon-themes/sifr/cmd/32/insertcolumnsafter.png |binary icon-themes/sifr/cmd/32/insertcolumnsbefore.png|binary icon-themes/sifr/cmd/32/insertrows.png |binary icon-themes/sifr/cmd/32/insertrowsafter.png|binary icon-themes/sifr/cmd/32/insertrowsbefore.png |binary icon-themes/sifr/cmd/32/selectdata.png |binary icon-themes/sifr/cmd/32/showcolumn.png |binary icon-themes/sifr/cmd/32/showrow.png|binary icon-themes/sifr/cmd/32/viewdatasourcebrowser.png |binary icon-themes/sifr/cmd/lc_dataconsolidate.png|binary icon-themes/sifr/cmd/lc_datasubtotals.png |binary icon-themes/sifr/cmd/lc_deletecolumns.png |binary icon-themes/sifr/cmd/lc_deleterows.png |binary icon-themes/sifr/cmd/lc_diagramdata.png|binary icon-themes/sifr/cmd/lc_hidecolumn.png |binary icon-themes/sifr/cmd/lc_hiderow.png|binary icon-themes/sifr/cmd/lc_insertcolumns.png |binary icon-themes/sifr/cmd/lc_insertcolumnsafter.png |binary icon-themes/sifr/cmd/lc_insertcolumnsbefore.png|binary icon-themes/sifr/cmd/lc_insertrows.png |binary icon-themes/sifr/cmd/lc_insertrowsafter.png|binary icon-themes/sifr/cmd/lc_insertrowsbefore.png |binary icon-themes/sifr/cmd/lc_selectdata.png |binary icon-themes/sifr/cmd/lc_showcolumn.png |binary icon-themes/sifr/cmd/lc_showrow.png|binary icon-themes/sifr/cmd/lc_viewdatasourcebrowser.png |binary icon-themes/sifr/cmd/sc_dataconsolidate.png|binary icon-themes/sifr/cmd/sc_datasubtotals.png |binary icon-themes/sifr/cmd/sc_deletecolumns.png |binary icon-themes/sifr/cmd/sc_deleterows.png |binary icon-themes/sifr/cmd/sc_diagramdata.png|binary icon-themes/sifr/cmd/sc_hidecolumn.png |binary icon-themes/sifr/cmd/sc_hiderow.png|binary icon-themes/sifr/cmd/sc_insertcolumndialog.png |binary icon-themes/sifr/cmd/sc_insertcolumns.png |binary icon-themes/sifr/cmd/sc_insertcolumnsafter.png |binary icon-themes/sifr/cmd/sc_insertcolumnsbefore.png|binary icon-themes/sifr/cmd/sc_insertrowdialog.png|binary icon-themes/sifr/cmd/sc_insertrows.png |binary icon-themes/sifr/cmd/sc_insertrowsafter.png|binary icon-themes/sifr/cmd/sc_insertrowsbefore.png |binary icon-themes/sifr/cmd/sc_optimizetable.png |binary icon-themes/sifr/cmd/sc_selectdata.png |binary icon-themes/sifr/cmd/sc_showcolumn.png |binary icon-themes/sifr/cmd/sc_showrow.png|binary icon-themes/sifr/cmd/sc_viewdatasourcebrowser.png |binary icon-themes/sifr_dark/cmd/32/dataconsolidate.png |binary icon-themes/sifr_dark/cmd/32/datasubtotals.png |binary icon-themes/sifr_dark/cmd/32/deletecolumns.png |binary icon-themes/sifr_dark/cmd/32/deleterows.png|binary icon-themes/sifr_dark/cmd/32/diagramdata.png |binary icon-themes/sifr_dark/cmd/32/hidecolumn.png|binary icon-themes/sifr_dark/cmd/32/hiderow.png |binary icon-themes/sifr_dark/cmd/32/insertcolumns.png |binary icon-themes/sifr_dark/cmd/32/insertcolumnsafter.png|binary icon-themes/sifr_dark/cmd/32/insertcolumnsbefore.png |binary icon-themes/sifr_dark/cmd/32/insertrows.png|binary icon-themes/sifr_dark/cmd/32/insertrowsafter.png |binary icon-themes/sifr_dark/cmd/32/insertrowsbefore.png |binary icon-themes/sifr_dark/cmd/32/selectdata.png|binary icon-themes/sifr_dark/cmd/32/showcolumn.png|binary icon-themes/sifr_dark/cmd/32/showrow.png |binary icon-themes/sifr_dark/cmd/32/viewdatasourcebrowser.png |binary icon-themes/sifr_dark/cmd/lc_dataconsolidate.png |binary icon-themes/sifr_dark/cmd/lc_datasubtotals.png |binary icon-themes/sifr_dark/cmd/lc_delet
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/dbdata.cxx | 58 - 1 file changed, 40 insertions(+), 18 deletions(-) New commits: commit 48b9cbc742de3f6120986cb6cafc92eb5009da82 Author: Eike Rathke AuthorDate: Wed Sep 28 20:51:05 2022 +0200 Commit: Eike Rathke CommitDate: Thu Sep 29 00:42:12 2022 +0200 Fix incrementing number in dbrange names during copying, tdf#145054 follow-up lcl_IncrementNumberInNamedRange() during copying a sheet didn't do what it was supposed to do, it could generate names that would had been cell references, and the loop it was called from could had prematurely ended because it inserted into the set it was iterating over; also the loop ended as soon as it encountered just one dbrange that wasn't on the sheet that was copied. That never worked as intended with more than just a very few names only on the same sheet. Additionally after the actual change loplugin:stringviewparam forced me to pass a std::u16string_view parameter, for that some adaptions had to be made. Change-Id: Ib83d317c69d821e8e8a2f1cd6791da9616ed188d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140717 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 0b54c6504371..cf518d0e2890 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -1007,31 +1007,47 @@ public: }; OUString lcl_IncrementNumberInNamedRange(ScDBCollection::NamedDBs& namedDBs, - const OUString& sOldName) -{ -sal_Int32 nLastIndex = sOldName.lastIndexOf('_'); + std::u16string_view rOldName) +{ +// Append or increment a numeric suffix and do not generate names that +// could result in a cell reference by ensuring at least one underscore is +// present. +// "aa" => "aa_2" +// "1" => "1_2" +// "aa_a" => "aa_a_2" +// "aa_a_" => "aa_a__2" +// "aa_a1" => "aa_a1_2" +// "aa_1a" => "aa_1a_2" +// "aa_1" => "aa_2" +// "aa_2" => "aa_3" + +size_t nLastIndex = rOldName.rfind('_'); sal_Int32 nOldNumber = 1; -if (nLastIndex >= 0) +OUString aPrefix; +if (nLastIndex != std::u16string_view::npos) { ++nLastIndex; -std::u16string_view sLastPart(sOldName.subView(nLastIndex)); +std::u16string_view sLastPart(rOldName.substr(nLastIndex)); nOldNumber = o3tl::toInt32(sLastPart); -// When no number found, add number at the end. -// When there is a literal "0" at the end, keep the "lastIndex" from above -// (OUString::toInt32() also returns 0 on failure) -if (nOldNumber == 0 && sLastPart != u"0") +// If that number is exactly at the end then increment the number; else +// append "_" and number. +// toInt32() returns 0 on failure and also stops at trailing non-digit +// characters (toInt32("1a")==1). +if (OUString::number(nOldNumber) == sLastPart) +aPrefix = rOldName.substr(0, nLastIndex); +else { +aPrefix = OUString::Concat(rOldName) + "_"; nOldNumber = 1; -nLastIndex = sOldName.getLength(); } } -else // No "_" found, add number at the end -nLastIndex = sOldName.getLength(); +else // No "_" found, append "_" and number. +aPrefix = OUString::Concat(rOldName) + "_"; OUString sNewName; do { -sNewName = sOldName.subView(0, nLastIndex) + OUString::number(++nOldNumber); +sNewName = aPrefix + OUString::number(++nOldNumber); } while (namedDBs.findByName(sNewName) != nullptr); return sNewName; } @@ -1544,17 +1560,23 @@ void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) void ScDBCollection::CopyToTable(SCTAB nOldPos, SCTAB nNewPos) { +// Create temporary copy of pointers to not insert in a set we are +// iterating over. +std::vector aTemp; +aTemp.reserve( maNamedDBs.size()); for (const auto& rxNamedDB : maNamedDBs) { if (rxNamedDB->GetTab() != nOldPos) -return; - -OUString newName -= lcl_IncrementNumberInNamedRange(getNamedDBs(), rxNamedDB->GetName()); +continue; +aTemp.emplace_back( rxNamedDB.get()); +} +for (const auto& rxNamedDB : aTemp) +{ +const OUString newName( lcl_IncrementNumberInNamedRange( maNamedDBs, rxNamedDB->GetName())); std::unique_ptr pDataCopy = std::make_unique(newName, *rxNamedDB); pDataCopy->UpdateMoveTab(nOldPos, nNewPos); pDataCopy->SetIndex(0); -getNamedDBs().insert(std::move(pDataCopy)); +maNamedDBs.insert(std::move(pDataCopy)); } }
[Libreoffice-commits] core.git: icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg
dev/null |binary icon-themes/sifr/cmd/32/actionmode.png |binary icon-themes/sifr/cmd/32/animationeffects.png |binary icon-themes/sifr/cmd/32/animationmode.png |binary icon-themes/sifr/cmd/32/cleararrows.png|binary icon-themes/sifr/cmd/32/closemasterview.png|binary icon-themes/sifr/cmd/32/dataimport.png |binary icon-themes/sifr/cmd/32/dbdistinctvalues.png |binary icon-themes/sifr/cmd/32/displaymasterbackground.png|binary icon-themes/sifr/cmd/32/displaymode.png|binary icon-themes/sifr/cmd/32/documentation.png |binary icon-themes/sifr/cmd/32/grafattrcrop.png |binary icon-themes/sifr/cmd/32/insertplugin.png |binary icon-themes/sifr/cmd/32/selectbackground.png |binary icon-themes/sifr/cmd/32/viewvaluehighlighting.png |binary icon-themes/sifr/cmd/lc_actionmode.png |binary icon-themes/sifr/cmd/lc_animationeffects.png |binary icon-themes/sifr/cmd/lc_animationmode.png |binary icon-themes/sifr/cmd/lc_cleararrows.png|binary icon-themes/sifr/cmd/lc_closemasterview.png|binary icon-themes/sifr/cmd/lc_dataimport.png |binary icon-themes/sifr/cmd/lc_dbdistinctvalues.png |binary icon-themes/sifr/cmd/lc_displaymasterbackground.png|binary icon-themes/sifr/cmd/lc_displaymasterobjects.png |binary icon-themes/sifr/cmd/lc_displaymode.png|binary icon-themes/sifr/cmd/lc_documentation.png |binary icon-themes/sifr/cmd/lc_grafattrcrop.png |binary icon-themes/sifr/cmd/lc_insertplugin.png |binary icon-themes/sifr/cmd/lc_mediaplay.png |binary icon-themes/sifr/cmd/lc_selectbackground.png |binary icon-themes/sifr/cmd/lc_viewvaluehighlighting.png |binary icon-themes/sifr/cmd/sc_actionmode.png |binary icon-themes/sifr/cmd/sc_animationeffects.png |binary icon-themes/sifr/cmd/sc_animationmode.png |binary icon-themes/sifr/cmd/sc_cleararrows.png|binary icon-themes/sifr/cmd/sc_closemasterview.png|binary icon-themes/sifr/cmd/sc_dataimport.png |binary icon-themes/sifr/cmd/sc_dbdistinctvalues.png |binary icon-themes/sifr/cmd/sc_displaymasterbackground.png|binary icon-themes/sifr/cmd/sc_displaymode.png|binary icon-themes/sifr/cmd/sc_documentation.png |binary icon-themes/sifr/cmd/sc_grafattrcrop.png |binary icon-themes/sifr/cmd/sc_insertplugin.png |binary icon-themes/sifr/cmd/sc_selectbackground.png |binary icon-themes/sifr/cmd/sc_viewvaluehighlighting.png |binary icon-themes/sifr/dbaccess/res/exwarning.png|binary icon-themes/sifr/links.txt |7 +++ icon-themes/sifr/sd/res/placeholder_image_large.png|binary icon-themes/sifr/sd/res/placeholder_image_large_hover.png |binary icon-themes/sifr/sd/res/placeholder_image_small.png|binary icon-themes/sifr/sd/res/placeholder_image_small_hover.png |binary icon-themes/sifr/sd/res/placeholder_table_large.png|binary icon-themes/sifr/sd/res/placeholder_table_large_hover.png |binary icon-themes/sifr/sd/res/placeholder_table_small.png|binary icon-themes/sifr/sd/res/placeholder_table_small_hover.png |binary icon-themes/sifr_dark/cmd/32/actionmode.png|binary icon-themes/sifr_dark/cmd/32/animationeffects.png |binary icon-themes/sifr_dark/cmd/32/animationmode.png |binary icon-themes/sifr_dark/cmd/32/cleararrows.png |binary icon-themes/sifr_dark/cmd/32/closemasterview.png |binary icon-themes/sifr_dark/cmd/32/dataimport.png|binary icon-themes/sifr_dark/cmd/32/dbdistinctvalues.png |binary icon-themes/sifr_dark/cmd/32/displaymasterbackground.png |binary icon-themes/sifr_dark/cmd/32/displaymode.png |binary icon-themes/sifr_dark/cmd/32/documentation.png |binary icon-themes/sifr_dark/cmd/32/grafattrcrop.png
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - starmath/source
starmath/source/SmElementsPanel.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit 04684eff465ba4287613294eaa34dd2659fbafcf Author: Mike Kaganski AuthorDate: Tue Sep 27 14:05:19 2022 +0300 Commit: Mike Kaganski CommitDate: Wed Sep 28 20:22:33 2022 +0200 lok: find active SmViewShell reliably in Elements panel It is needed in 22.05, unlike master Change-Id: I76265888e7814f47b09c405dc1e907aa0dfbc743 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140646 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski diff --git a/starmath/source/SmElementsPanel.cxx b/starmath/source/SmElementsPanel.cxx index 08ff6af95ab9..51c07356be1a 100644 --- a/starmath/source/SmElementsPanel.cxx +++ b/starmath/source/SmElementsPanel.cxx @@ -19,7 +19,9 @@ #include +#include #include +#include #include #include "SmElementsPanel.hxx" @@ -84,7 +86,14 @@ IMPL_LINK(SmElementsPanel, ElementClickHandler, OUString, ElementSource, void) SmViewShell* SmElementsPanel::GetView() const { SfxViewShell* pView = mrBindings.GetDispatcher()->GetFrame()->GetViewShell(); -return dynamic_cast(pView); +SmViewShell* pSmViewShell = dynamic_cast(pView); +if (!pSmViewShell && comphelper::LibreOfficeKit::isActive()) +{ +auto* pWindow = static_cast(LokStarMathHelper(pView).GetGraphicWindow()); +if (pWindow) +pSmViewShell = &pWindow->GetGraphicWidget().GetView(); +} +return pSmViewShell; } } // end of namespace sm::sidebar
[Libreoffice-commits] core.git: sfx2/inc sfx2/source
sfx2/inc/doctempl.hrc|3 ++- sfx2/source/doc/doctemplates.cxx |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 03809a4338f4a1e9e5ad5088fdeedc4c3fe0f7b5 Author: Rafael Lima AuthorDate: Sun Sep 25 21:12:08 2022 +0200 Commit: Rafael Lima CommitDate: Wed Sep 28 18:51:32 2022 +0200 Related tdf#132576 Fix "draw" string in Template Manager and make it translatable The Templates Manager has a category name "draw" which cannot be translated. It also looks weird because all other categories have full names whereas this one is a lowercase string. The reason the word "draw" is used is because it is the name of the folder where the template is located. This patch maps a string "Drawings" to give a proper translatable name for this category. For this patch to take effect, the user needs to be on a fresh profile (or at least reset the user UI modifications). Change-Id: I2223dfe8761a5687b02e843957ebf7fb07f4a626 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140506 Tested-by: Jenkins Reviewed-by: Laurent Balland diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc index d6b98a0e2a6b..10a10d0de0c6 100644 --- a/sfx2/inc/doctempl.hrc +++ b/sfx2/inc/doctempl.hrc @@ -37,7 +37,8 @@ const TranslateId TEMPLATE_LONG_NAMES_ARY[] = NC_("TEMPLATE_LONG_NAMES_ARY", "Presentation Backgrounds"), NC_("TEMPLATE_LONG_NAMES_ARY", "Presentations"), NC_("TEMPLATE_LONG_NAMES_ARY", "Miscellaneous"), -NC_("TEMPLATE_LONG_NAMES_ARY", "Labels") +NC_("TEMPLATE_LONG_NAMES_ARY", "Labels"), +NC_("TEMPLATE_LONG_NAMES_ARY", "Drawings") }; #endif diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 858e37a32812..45d7d1015a97 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -493,7 +493,8 @@ const char* TEMPLATE_SHORT_NAMES_ARY[] = "layout", "presnt", "misc", -"labels" +"labels", +"draw" }; void SfxDocTplService_Impl::readFolderList()
[Libreoffice-commits] core.git: sw/source
sw/source/core/fields/postithelper.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 124d786e68dd5838b814ec8a453769ff7ba76f23 Author: Noel Grandin AuthorDate: Wed Sep 28 16:07:30 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 17:45:40 2022 +0200 use more SwPosition::AdjustContent part of the process of hiding the internals of SwPosition Change-Id: Ic2a13b4bcdc820f3604179ee391b8a0df962226b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140709 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 558b65fcbcbb..a3f27be6f533 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -59,13 +59,13 @@ bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark, // This can be the as-char case: the comment placeholder character is exactly between the // annotation mark start and end. SwPosition aPosition(rMarkStart); -++aPosition.nContent; +aPosition.AdjustContent(+1); if (aPosition != rAnchorPos) { return false; } -++aPosition.nContent; +aPosition.AdjustContent(+1); if (aPosition != rMarkEnd) { return false; @@ -74,7 +74,7 @@ bool AnnotationMarkCoversCommentAnchor(const sw::mark::IMark* pAnnotationMark, return true; } -if (rMarkStart.nNode != rMarkEnd.nNode) +if (rMarkStart.GetNode() != rMarkEnd.GetNode()) { return false; } @@ -253,8 +253,7 @@ SwPosition SwAnnotationItem::GetAnchorPosition() const SwTextField* pTextField = mrFormatField.GetTextField(); SwTextNode* pTextNode = pTextField->GetpTextNode(); -SwPosition aPos( *pTextNode ); -aPos.nContent.Assign( pTextNode, pTextField->GetStart() ); +SwPosition aPos( *pTextNode, pTextField->GetStart() ); return aPos; }
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) New commits: commit 589cfd3ef33ddb42ea265e2ab2b87d32f1f1f67d Author: Jim Raykowski AuthorDate: Sun Sep 25 22:18:39 2022 -0800 Commit: Jim Raykowski CommitDate: Wed Sep 28 16:40:27 2022 +0200 tdf#140892 Account for list bullets and numbering when placing outline folding button Change-Id: I2cdd9916c0f1327d9a48443d00205490bfb04f31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140585 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx index 33d0b72ffd41..998548550274 100644 --- a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx +++ b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx @@ -131,13 +131,19 @@ void SwOutlineContentVisibilityWin::Set() SetQuickHelpText(sQuickHelp); // Set the position of the window -SwRect aFrameAreaRect = GetFrame()->getFrameArea(); -aFrameAreaRect.AddTop(GetFrame()->GetTopMargin()); +SwRect aFrameAreaRect = pTextFrame->getFrameArea(); +aFrameAreaRect.AddTop(pTextFrame->GetTopMargin()); +SwSpecialPos aSpecialPos; +aSpecialPos.nExtendRange = pTextNode->HasVisibleNumberingOrBullet() ? SwSPExtendRange::BEFORE +: SwSPExtendRange::NONE; +SwCursorMoveState aMoveState; +aMoveState.m_pSpecialPos = &aSpecialPos; SwRect aCharRect; -GetFrame()->GetCharRect(aCharRect, SwPosition(*pTextNode)); +pTextFrame->GetCharRect(aCharRect, SwPosition(*(pTextFrame->GetTextNodeForParaProps())), +&aMoveState); Point aPxPt(GetEditWin()->GetOutDev()->LogicToPixel( Point(aCharRect.Left(), aFrameAreaRect.Center().getY(; -if (GetFrame()->IsRightToLeft()) +if (pTextFrame->IsRightToLeft()) aPxPt.AdjustX(2); else aPxPt.AdjustX(-(GetSizePixel().getWidth() + 2));
[Libreoffice-commits] core.git: svgio/inc svgio/source
svgio/inc/svgcharacternode.hxx|2 svgio/inc/svgnode.hxx |2 svgio/inc/svgstyleattributes.hxx |2 svgio/inc/svgstylenode.hxx|6 +- svgio/inc/svgtools.hxx| 14 ++--- svgio/source/svgreader/svgcharacternode.cxx | 14 ++--- svgio/source/svgreader/svgnode.cxx|2 svgio/source/svgreader/svgstyleattributes.cxx |4 - svgio/source/svgreader/svgstylenode.cxx | 16 +++--- svgio/source/svgreader/svgtools.cxx | 66 +- 10 files changed, 64 insertions(+), 64 deletions(-) New commits: commit a63fcd0916ebe51d866ed1113babd1a521c175c6 Author: Noel Grandin AuthorDate: Wed Sep 28 15:00:44 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 16:04:46 2022 +0200 use more string_view in svgio Change-Id: I30d2f02941673ce33febc4e0f563e77b80a585fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140707 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx index 9558e7b752b9..50ecda7e3a89 100644 --- a/svgio/inc/svgcharacternode.hxx +++ b/svgio/inc/svgcharacternode.hxx @@ -45,7 +45,7 @@ namespace svgio::svgreader public: SvgTextPositions(); -void parseTextPositionAttributes(SVGToken aSVGToken, const OUString& aContent); +void parseTextPositionAttributes(SVGToken aSVGToken, std::u16string_view aContent); /// X content const SvgNumberVector& getX() const { return maX; } diff --git a/svgio/inc/svgnode.hxx b/svgio/inc/svgnode.hxx index 54016aa34e99..4bdbd3046d75 100644 --- a/svgio/inc/svgnode.hxx +++ b/svgio/inc/svgnode.hxx @@ -137,7 +137,7 @@ namespace svgio::svgreader void accept(Visitor& rVisitor); /// scan helper to read and interpret a local CssStyle to mpLocalCssStyle -void readLocalCssStyle(const OUString& aContent); +void readLocalCssStyle(std::u16string_view aContent); /// style helpers void parseAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs); diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx index 529e91b75b8e..4455f2311b69 100644 --- a/svgio/inc/svgstyleattributes.hxx +++ b/svgio/inc/svgstyleattributes.hxx @@ -297,7 +297,7 @@ namespace svgio::svgreader const SvgStyleAttributes* getCssStyleParent() const { return mpCssStyleParent; } /// scan helpers -void readCssStyle(const OUString& rCandidate); +void readCssStyle(std::u16string_view rCandidate); const SvgStyleAttributes* getParentStyle() const; SvgStyleAttributes(SvgNode& rOwner); diff --git a/svgio/inc/svgstylenode.hxx b/svgio/inc/svgstylenode.hxx index 1a5a43ca858c..8a70d0ec4767 100644 --- a/svgio/inc/svgstylenode.hxx +++ b/svgio/inc/svgstylenode.hxx @@ -44,9 +44,9 @@ namespace svgio::svgreader virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; /// CssStyleSheet add helpers -void addCssStyleSheet(const OUString& aSelectors, const SvgStyleAttributes& rNewStyle); -void addCssStyleSheet(const OUString& aSelectors, const OUString& aContent); -void addCssStyleSheet(const OUString& aSelectorsAndContent); +void addCssStyleSheet(std::u16string_view aSelectors, const SvgStyleAttributes& rNewStyle); +void addCssStyleSheet(std::u16string_view aSelectors, std::u16string_view aContent); +void addCssStyleSheet(std::u16string_view aSelectorsAndContent); /// textCss access bool isTextCss() const { return mbTextCss; } diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx index 4147344b4640..fd9bdd396d9d 100644 --- a/svgio/inc/svgtools.hxx +++ b/svgio/inc/svgtools.hxx @@ -108,20 +108,20 @@ namespace svgio::svgreader sal_Int32 read_hex(sal_Unicode aChar); bool match_colorKeyword(basegfx::BColor& rColor, const OUString& rName); bool read_color(const OUString& rCandidate, basegfx::BColor& rColor, SvgNumber& rOpacity); -basegfx::B2DRange readViewBox(const OUString& rCandidate, InfoProvider const & rInfoProvider); -basegfx::B2DHomMatrix readTransform(const OUString& rCandidate, InfoProvider const & rInfoProvider); -bool readSingleNumber(const OUString& rCandidate, SvgNumber& aNum); -bool readLocalLink(const OUString& rCandidate, OUString& rURL); +basegfx::B2DRange readViewBox(std::u16string_view rCandidate, InfoProvider const & rInfoProvider); +basegfx::B2DHomMatrix readTransform(std::u16string_view rCandidate, InfoProvider const & rInfoProvider); +bool readSingleNumber(std::u16string_view rCandidate, SvgNumber& aNum);
[Libreoffice-commits] core.git: ucb/source
ucb/source/core/ucb.cxx | 12 ++-- ucb/source/core/ucb.hxx |4 ++-- ucb/source/core/ucbstore.cxx |6 +++--- ucb/source/ucp/ext/ucpext_content.cxx|8 ucb/source/ucp/ext/ucpext_content.hxx|2 +- ucb/source/ucp/file/filglob.cxx | 15 --- ucb/source/ucp/file/filglob.hxx |8 ucb/source/ucp/hierarchy/hierarchydata.cxx |6 +++--- ucb/source/ucp/webdav-curl/CurlSession.cxx | 14 -- ucb/source/ucp/webdav-curl/CurlUri.cxx | 19 ++- ucb/source/ucp/webdav-curl/CurlUri.hxx |2 +- ucb/source/ucp/webdav-curl/DAVProperties.cxx | 26 ++ ucb/source/ucp/webdav-curl/DAVProperties.hxx |2 +- 13 files changed, 65 insertions(+), 59 deletions(-) New commits: commit aa770d615ec5722411cc4ab1f88de89d4cad5809 Author: Noel Grandin AuthorDate: Wed Sep 28 15:00:28 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 16:04:31 2022 +0200 use more string_view in ucb Change-Id: Id1d35aca0c8f62b3eb03eca9850a3f3c9799df98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140706 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index e0e6953a63a7..26476a90562b 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -136,10 +136,10 @@ bool fillPlaceholders(OUString const & rInput, } void makeAndAppendXMLName( -OUStringBuffer & rBuffer, const OUString & rIn ) +OUStringBuffer & rBuffer, std::u16string_view rIn ) { -sal_Int32 nCount = rIn.getLength(); -for ( sal_Int32 n = 0; n < nCount; ++n ) +size_t nCount = rIn.size(); +for ( size_t n = 0; n < nCount; ++n ) { const sal_Unicode c = rIn[ n ]; switch ( c ) @@ -767,11 +767,11 @@ void UniversalContentBroker::prepareAndRegister( bool UniversalContentBroker::getContentProviderData( -const OUString & rKey1, -const OUString & rKey2, +std::u16string_view rKey1, +std::u16string_view rKey2, ContentProviderDataList & rListToFill ) { -if ( !m_xContext.is() || rKey1.isEmpty() || rKey2.isEmpty() ) +if ( !m_xContext.is() || rKey1.empty() || rKey2.empty() ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - Invalid argument!" ); return false; diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx index 49c6e0b37d8d..001987ed54c4 100644 --- a/ucb/source/core/ucb.hxx +++ b/ucb/source/core/ucb.hxx @@ -136,8 +136,8 @@ private: void configureUcb(); bool getContentProviderData( -const OUString & rKey1, -const OUString & rKey2, +std::u16string_view rKey1, +std::u16string_view rKey2, ucbhelper::ContentProviderDataList & rListToFill); void prepareAndRegister( const ucbhelper::ContentProviderDataList& rData); diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index be97f81f636f..5757f8369f40 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -59,13 +59,13 @@ using namespace com::sun::star::util; using namespace comphelper; using namespace cppu; -static OUString makeHierarchalNameSegment( const OUString & rIn ) +static OUString makeHierarchalNameSegment( std::u16string_view rIn ) { OUStringBuffer aBuffer; aBuffer.append( "['" ); -sal_Int32 nCount = rIn.getLength(); -for ( sal_Int32 n = 0; n < nCount; ++n ) +size_t nCount = rIn.size(); +for ( size_t n = 0; n < nCount; ++n ) { const sal_Unicode c = rIn[ n ]; switch ( c ) diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx index a04da9a96ecd..a1d2df55a092 100644 --- a/ucb/source/ucp/ext/ucpext_content.cxx +++ b/ucb/source/ucp/ext/ucpext_content.cxx @@ -279,16 +279,16 @@ namespace ucb::ucp::ext } -bool Content::denotesRootContent( const OUString& i_rContentIdentifier ) +bool Content::denotesRootContent( std::u16string_view i_rContentIdentifier ) { const OUString sRootURL( ContentProvider::getRootURL() ); if ( i_rContentIdentifier == sRootURL ) return true; // the root URL contains only two trailing /, but we also recognize 3 of them as denoting the root URL -if ( i_rContentIdentifier.match( sRootURL ) -&& ( i_rContentIdentifier.getLength() == sRootURL.getLength() + 1 ) -&& ( i_rContentIdentifier[ i_rContentIdentifier.getLength() - 1 ] == '/' ) +if ( o3tl::starts_with(i_rContentIdentifier, sRootURL ) +&& ( sal_Int32(i_rContentIdentifier.size()) == sRootURL.getLength() + 1 ) +&& ( i_rContentIdentifier[ i_rContentIdentifier.size() - 1 ] == '/' ) )
[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - configure.ac
configure.ac |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eae1a20eee24d7fbeb19ff1fe91a658206f3f25b Author: Andras Timar AuthorDate: Wed Sep 28 14:34:54 2022 +0200 Commit: Andras Timar CommitDate: Wed Sep 28 14:34:54 2022 +0200 Bump version to 7.2.7.2.M7 Change-Id: I9726c831a25b95f4a512b44aa09ea9af015181f8 diff --git a/configure.ac b/configure.ac index 01b91e7f2274..3b9ff0ab49e4 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([LibreOffice],[7.2.7.2.M6],[],[],[http://documentfoundation.org/]) +AC_INIT([LibreOffice],[7.2.7.2.M7],[],[],[http://documentfoundation.org/]) 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: desktop/inc desktop/source
desktop/inc/dp_misc.h |4 +- desktop/source/deployment/inc/dp_ucb.h|2 - desktop/source/deployment/inc/dp_update.hxx |4 +- desktop/source/deployment/inc/dp_version.hxx |2 - desktop/source/deployment/manager/dp_manager.cxx |4 +- desktop/source/deployment/misc/dp_dependencies.cxx|4 +- desktop/source/deployment/misc/dp_misc.cxx| 17 desktop/source/deployment/misc/dp_ucb.cxx |4 +- desktop/source/deployment/misc/dp_update.cxx |6 +-- desktop/source/deployment/misc/dp_version.cxx | 19 +- desktop/source/deployment/registry/component/dp_component.cxx | 14 +++ desktop/source/deployment/registry/configuration/dp_configuration.cxx | 12 +++--- 12 files changed, 47 insertions(+), 45 deletions(-) New commits: commit 42a73e2259d5937ffb8896f7cd24991f83b1ad82 Author: Noel Grandin AuthorDate: Wed Sep 28 13:39:18 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 14:18:52 2022 +0200 use more string_view in desktop Change-Id: I16dbc8cb027f51703bc016e095096c868f6e2881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140705 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/inc/dp_misc.h b/desktop/inc/dp_misc.h index f4c222a943a7..f9ac5687e46a 100644 --- a/desktop/inc/dp_misc.h +++ b/desktop/inc/dp_misc.h @@ -64,7 +64,7 @@ OUString expandUnoRcUrl( OUString const & url ); be again encoded for use in an "expand" URL. */ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString makeURL( -OUString const & baseURL, OUString const & relPath ); +std::u16string_view baseURL, OUString const & relPath ); /** appends a relative path to a url. @@ -73,7 +73,7 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString makeURL( of an system path. */ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString makeURLAppendSysPathSegment( -OUString const & baseURL, OUString const & relPath ); +std::u16string_view baseURL, OUString const & relPath ); DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString generateRandomPipeId(); diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h index 291b28b9b972..e72a2cce9332 100644 --- a/desktop/source/deployment/inc/dp_ucb.h +++ b/desktop/source/deployment/inc/dp_ucb.h @@ -80,7 +80,7 @@ std::vector readFile( ::ucbhelper::Content & ucb_content ); DESKTOP_DEPLOYMENTMISC_DLLPUBLIC -bool readLine( OUString * res, OUString const & startingWith, +bool readLine( OUString * res, std::u16string_view startingWith, ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc ); DESKTOP_DEPLOYMENTMISC_DLLPUBLIC diff --git a/desktop/source/deployment/inc/dp_update.hxx b/desktop/source/deployment/inc/dp_update.hxx index 8dce9b583729..f673d2f66a95 100644 --- a/desktop/source/deployment/inc/dp_update.hxx +++ b/desktop/source/deployment/inc/dp_update.hxx @@ -60,7 +60,7 @@ UPDATE_SOURCE isUpdateUserExtension( OUString const & userVersion, OUString const & sharedVersion, OUString const & bundledVersion, -OUString const & onlineVersion); +std::u16string_view onlineVersion); /* determine if an update is available which is installed in the shared repository. @@ -74,7 +74,7 @@ UPDATE_SOURCE isUpdateSharedExtension( bool bReadOnlyShared, OUString const & sharedVersion, OUString const & bundledVersion, -OUString const & onlineVersion); +std::u16string_view onlineVersion); /* determines the extension with the highest identifier and returns it diff --git a/desktop/source/deployment/inc/dp_version.hxx b/desktop/source/deployment/inc/dp_version.hxx index 342e2bf8c737..f088b6861a2f 100644 --- a/desktop/source/deployment/inc/dp_version.hxx +++ b/desktop/source/deployment/inc/dp_version.hxx @@ -30,7 +30,7 @@ namespace dp_misc { enum Order { LESS, EQUAL, GREATER }; DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Order compareVersions( -OUString const & version1, OUString const & version2); +std::u16string_view version1, std::u16string_view version2); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 3e7802e01935..2c52741c2acb 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1203,7 +1203,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions( //shared repository including the temporary name OUString url = makeURL(m_activePackages, elem.second.temporaryName); if (bShared) -url = makeURLAppendSysPathSegment( url + "_", elem.second.fileName); +url = makeUR
[Libreoffice-commits] core.git: oox/qa oox/source sd/qa
oox/qa/unit/vml.cxx | 15 +-- oox/source/drawingml/graphicshapecontext.cxx |3 ++- oox/source/drawingml/shape.cxx | 17 + sd/qa/unit/data/pptx/ole.pptx|binary sd/qa/unit/export-tests-ooxml3.cxx | 21 + 5 files changed, 45 insertions(+), 11 deletions(-) New commits: commit adc042f95d3dbd65b778260025d59283146916e5 Author: Tünde Tóth AuthorDate: Tue Sep 13 10:29:03 2022 +0200 Commit: László Németh CommitDate: Wed Sep 28 14:16:50 2022 +0200 tdf#124333 PPTX import: fix Z-order of embedded OLE objects Choose mc:Choice in a:graphicData element if the selected p:oleObj element has a shape id to avoid of shape duplication which created also bad layout/overlapping because of the different Z-order of the duplicated shape. Change-Id: Idecff4903c2d637bc82353f13352cac72413cec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140041 Tested-by: László Németh Reviewed-by: László Németh diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx index 9dcaaef83cc4..61730c744220 100644 --- a/oox/qa/unit/vml.cxx +++ b/oox/qa/unit/vml.cxx @@ -192,18 +192,13 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testGraphicStroke) uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); -uno::Reference xShape; -for (sal_Int32 i = 0; i < xDrawPage->getCount(); ++i) -{ -uno::Reference xInfo(xDrawPage->getByIndex(i), uno::UNO_QUERY); -if (!xInfo->supportsService("com.sun.star.drawing.GraphicObjectShape")) -{ -continue; -} +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); +uno::Reference xShape; +uno::Reference xInfo(xDrawPage->getByIndex(0), uno::UNO_QUERY); +if (xInfo->supportsService("com.sun.star.drawing.OLE2Shape")) xShape.set(xInfo, uno::UNO_QUERY); -break; -} + CPPUNIT_ASSERT(xShape.is()); drawing::LineStyle eLineStyle{}; diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 6e4379c2e1ed..0f96d0a92d63 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -256,7 +256,8 @@ void OleObjectGraphicDataContext::onEndElement() { if( getCurrentElement() == PPT_TOKEN( oleObj ) && !isMCEStateEmpty() ) { -if( getMCEState() == MCE_STATE::FoundChoice && !mrOleObjectInfo.mbHasPicture ) +if (getMCEState() == MCE_STATE::FoundChoice && !mrOleObjectInfo.mbHasPicture +&& mrOleObjectInfo.maShapeId.isEmpty()) setMCEState( MCE_STATE::Started ); } } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 2a46f93a440e..0369f5ff732c 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1868,6 +1868,23 @@ Reference< XShape > const & Shape::createAndInsert( propertySet->setPropertyValue( "SoftEdgeRadius", Any(convertEmuToHmm(aEffectProperties.maSoftEdge.moRad.value(; } + +// Set the stroke and fill-color properties of the OLE shape +if (aServiceName == "com.sun.star.drawing.OLE2Shape" && mxOleObjectInfo +&& !mxOleObjectInfo->maShapeId.isEmpty()) +if (::oox::vml::Drawing* pVmlDrawing = rFilterBase.getVmlDrawing()) +if (const ::oox::vml::ShapeBase* pVmlShape += pVmlDrawing->getShapes().getShapeById(mxOleObjectInfo->maShapeId)) +{ +// Apply stroke props from the type model of the related VML shape. +ShapePropertyMap aPropMap(rFilterBase.getModelObjectHelper()); +pVmlShape->getTypeModel().maStrokeModel.pushToPropMap( +aPropMap, rFilterBase.getGraphicHelper()); +// And, fill-color properties as well... +pVmlShape->getTypeModel().maFillModel.pushToPropMap( +aPropMap, rFilterBase.getGraphicHelper()); +PropertySet(xSet).setProperties(aPropMap); +} } if (mxShape.is()) diff --git a/sd/qa/unit/data/pptx/ole.pptx b/sd/qa/unit/data/pptx/ole.pptx new file mode 100644 index ..b998e79e0d66 Binary files /dev/null and b/sd/qa/unit/data/pptx/ole.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index c12a1f0ec4bd..e2ef6928104f 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -122,6 +122,7 @@ public: void testTdf149551_tbrl90(); void testTdf149551_btlr(); void testTdf94122_autoColor(); +void testTdf124333(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -209,6 +210,7 @@ public: CPPUNIT_TEST(testTdf149551_tbr
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/dbdata.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 36003e7644014cde9330bf45fee3815278a74035 Author: Noel Grandin AuthorDate: Wed Sep 28 11:19:25 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 13:57:39 2022 +0200 fix bug in lcl_IncrementNumberInNamedRange from commit 690e4852809ea21b5fd909298c5fa2a053fa0458 Date: Mon Jan 31 09:02:33 2022 +0100 Fix copying range when it doesn't contain a number OUString::lastIndexOf() eithers returns an index or -1, so adding 1 to it, means that nLastIndex is __always__ >= 0. Change-Id: I197f8c856a52534690d7a0d28e49cecf296dccb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140704 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 5a2fa75684de..0b54c6504371 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -1009,10 +1009,11 @@ public: OUString lcl_IncrementNumberInNamedRange(ScDBCollection::NamedDBs& namedDBs, const OUString& sOldName) { -sal_Int32 nLastIndex = sOldName.lastIndexOf('_') + 1; +sal_Int32 nLastIndex = sOldName.lastIndexOf('_'); sal_Int32 nOldNumber = 1; if (nLastIndex >= 0) { +++nLastIndex; std::u16string_view sLastPart(sOldName.subView(nLastIndex)); nOldNumber = o3tl::toInt32(sLastPart);
[Libreoffice-commits] core.git: sw/source
sw/source/core/edit/edlingu.cxx | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) New commits: commit c4c3d1b575ba46f181a15d5c4b66c52a3020194d Author: Noel Grandin AuthorDate: Tue Sep 27 20:39:43 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 13:52:57 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: Ia5d84c6b9905355f0b04cb64c18b628120c3c9b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140671 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 94d691b9ac87..294d6ffede72 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -529,7 +529,7 @@ void SwHyphIter::Ignore() DelSoftHyph( *pCursor ); // and continue -pCursor->Start()->nContent = pCursor->End()->nContent; +pCursor->Start()->SetContent( pCursor->End()->GetContentIndex() ); pCursor->SetMark(); } @@ -568,7 +568,7 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos ) { SwDoc *pDoc = pMySh->GetDoc(); DelSoftHyph( *pCursor ); -pSttPos->nContent += nHyphPos; +pSttPos->AdjustContent( +nHyphPos ); SwPaM aRg( *pSttPos ); pDoc->getIDocumentContentOperations().InsertString( aRg, OUString(CHAR_SOFTHYPHEN) ); } @@ -863,7 +863,7 @@ void SwEditShell::HandleCorrectionError(const OUString& aText, SwPosition aPos, while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; -aPos.nContent = nBegin + nLeft; +aPos.SetContent( nBegin + nLeft ); SwPaM* pCursor = GetCursor(); *pCursor->GetPoint() = aPos; pCursor->SetMark(); @@ -875,8 +875,8 @@ void SwEditShell::HandleCorrectionError(const OUString& aText, SwPosition aPos, ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); pCursor->DeleteMark(); -SwContentIndex& rContent = GetCursor()->GetPoint()->nContent; -rContent = nWordStart; +SwPosition& rPtPos = *GetCursor()->GetPoint(); +rPtPos.SetContent(nWordStart); SwRect aStartRect; SwCursorMoveState aState; aState.m_bRealWidth = true; @@ -890,7 +890,7 @@ void SwEditShell::HandleCorrectionError(const OUString& aText, SwPosition aPos, SwContentFrame *const pContentFrame = pContentNode->getLayoutFrame(GetLayout(), pCursor->GetPoint(), pPt ? &tmp : nullptr); pContentFrame->GetCharRect( aStartRect, *pCursor->GetPoint(), &aState ); -rContent = nWordEnd - 1; +rPtPos.SetContent(nWordEnd - 1); SwRect aEndRect; pContentFrame->GetCharRect( aEndRect, *pCursor->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); @@ -1149,8 +1149,8 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b } if ( !pCursor->HasMark() ) pCursor->SetMark(); -pCursor->GetPoint()->nContent = aCurrentOldPosition->nLeft; -pCursor->GetMark()->nContent = aCurrentOldPosition->nRight; +pCursor->GetPoint()->SetContent( aCurrentOldPosition->nLeft ); +pCursor->GetMark()->SetContent( aCurrentOldPosition->nRight ); sal_uInt16 nScriptType = SvtLanguageOptions::GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE; switch(nScriptType) @@ -1188,8 +1188,8 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end(); --aCurrentEndPosition; SpellContentPositions::const_iterator aCurrentStartPosition = rLastPositions.begin(); -pCursor->GetPoint()->nContent = aCurrentStartPosition->nLeft; -pCursor->GetMark()->nContent = aCurrentEndPosition->nRight; +pCursor->GetPoint()->SetContent( aCurrentStartPosition->nLeft ); +pCursor->GetMark()->SetContent( aCurrentEndPosition->nRight ); // delete the sentence completely mxDoc->getIDocumentContentOperations().DeleteAndJoin(*pCursor); @@ -1417,8 +1417,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh --nSentenceEnd; if( pCursor->End()->GetContentIndex() < nSentenceEnd ) { -pCursor->End()->nContent.Assign( -pCursor->End()->GetNode().GetContentNode(), nSentenceEnd); +pCursor->End()->SetContent(nSentenceEnd); } } @@ -1606,7 +1605,7 @@ voidSwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > const & xAl // select until the end of the current redline const sal_Int32 nEnd = aEnd.GetContentIndex() < aNextRedline.nRight ? aEnd.GetContentIndex() : aNextRedline.nRight; -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source
sw/qa/core/draw/data/sdt-textbox-header.docx |binary sw/qa/core/draw/draw.cxx | 11 +++ sw/source/core/draw/dcontact.cxx | 41 +++ sw/source/core/draw/dflyobj.cxx | 13 sw/source/core/inc/dflyobj.hxx |1 5 files changed, 66 insertions(+) New commits: commit b44e92c0d1cc36bb30100d719626873dc9e1bcdf Author: Miklos Vajna AuthorDate: Wed Sep 28 08:54:06 2022 +0200 Commit: Miklos Vajna CommitDate: Wed Sep 28 13:23:28 2022 +0200 crashtesting: fix PDF export of fdo83057-2.docx Loading this document and laying it out resulted in an assertion failure since commit de90c192cb8f1f03a4028493d8bfe9a127a76b2a (sw content controls, plain text: enable DOCX filter with data binding, 2022-09-19). Writer has two relevant invariants: First, if a draw shape is anchored into a header, then the "master" shape (typically on the first page) and its "virtual" shapes (on other pages) have their indexes / ZOrders set so that the master shape has the highest index. The second is that in case a draw+fly format is paired into a "textbox", then the fly index is always the draw index + 1. The assert fails because in this case the virtual draw shape's index is not smaller than the master one. What seems to happen here is that first SwDrawContact::ConnectToLayout() iterates the frames of the text node in the header, and happens to first visit page 1 and then page 2. So the master SdrObjects go to the first page, the virtual ones go to the second page. Then later SwDrawContact::ConnectToLayout() is called again, which removes the master and the virtual draw SdrObject from the layout and the virtual draw SdrObject from the model. Then it visits the text frames of the header text node again, but this time it happens to find the second page, and only then the first page (for reasons unclear to me, this didn't happen before the above commit). The result is that both invariants are failing: the master draw+fly is no longer on the same page and the indexes are also out of order, so one of the pages don't show shape text for the shape from the header. Fix the problem by two tweaks: - Improve SwDrawContact::ConnectToLayout(), so that in case it just appends the draw object to the layout for the master, then it adjusts its ZOrder so the matching fly will be the draw one + 1. This was working in the virtual case already, since there we call AddVirtObj() already, which calls SwDrawVirtObj::AddToDrawingPage(), which already knows how to maintain this invariant. This fixes master draw SdrObjects to be directly before their fly counterparts, even if the page order changes. - Improve SwDrawVirtObj::AddToDrawingPage(), so that in case the virtual draw SdrObject finds its fly, but that fly has an incorrect index (due to the changed page visit order), then we first fix up the fly and only then set the index of the virtual draw SdrObject. The result is a doc model like this: I.e. each draw SdrObject is followed by its fly and the masters have the highest indexes. This all stems from the behavior that 1) re-connecting a draw contact to the layout removes the draw shapes but not the flys from the layout, 2) the order of frames in an SwIterator visiting is not something we can depend on and 3) textboxes are implemented using a pair of draw+fly formats. (cherry picked from commit 914d246e0edcbdfa5969b7f3eea7c67e1a5b7522) Change-Id: Ia03f0ec70cf67626660349accc63770fe2afef5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140703 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/qa/core/draw/data/sdt-textbox-header.docx b/sw/qa/core/draw/data/sdt-textbox-header.docx new file mode 100644 index ..a8b2d9625fbe Binary files /dev/null and b/sw/qa/core/draw/data/sdt-textbox-header.docx differ diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index c2514808f8e4..feb347adc8d4 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -141,6 +141,17 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) CPPUNIT_ASSERT_EQUAL(Color(0xff), Color(ColorTransparency, aBorder.Color)); } +CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testSdtTextboxHeader) +{ +// Given a 2 page document, same header on both pages, content control in the header and +// shape+fly pair (textbox) anchored in the same header: +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "sdt-textbox-header.docx"; + +// When loading that document, then make sure that layout doesn't fail with an assertion because +// the "master SdrObj should have the highest
[Libreoffice-commits] core.git: sw/source
sw/source/core/edit/autofmt.cxx | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) New commits: commit 75502b3e837071389579787b8d0db6f47db7851b Author: Noel Grandin AuthorDate: Tue Sep 27 20:35:12 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 13:09:05 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: I5328dcf01d3fc2c8e61265667512f8bdcd739509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140670 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index b4812c3030db..955cfdc3bee3 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -560,7 +560,6 @@ bool SwAutoFormat::DoUnderline() // WARNING: rText may be deleted now, m_pCurTextFrame may be nullptr m_aDelPam.SetMark(); // apply to last node & rely on InsertItemSet to apply it to props-node -m_aDelPam.GetMark()->nContent = 0; editeng::SvxBorderLine aLine; switch( eState ) @@ -680,7 +679,7 @@ bool SwAutoFormat::DoTable() m_pDoc->InsertTable( SwInsertTableOptions( SwInsertTableFlags::All , 1 ), *m_aDelPam.GetPoint(), 1, nColCnt, eHori, nullptr, &aPosArr ); -m_aDelPam.GetPoint()->nNode = aIdx; +m_aDelPam.GetPoint()->Assign(aIdx); } return 1 < aPosArr.size(); } @@ -1246,22 +1245,21 @@ void SwAutoFormat::DelEmptyLine( bool bTstNextPara ) TextFrameIndex(0)); m_aDelPam.SetMark(); -m_aDelPam.GetMark()->nNode = m_pCurTextFrame->GetTextNodeFirst()->GetIndex() - 1; +m_aDelPam.GetMark()->Assign( m_pCurTextFrame->GetTextNodeFirst()->GetIndex() - 1 ); SwTextNode* pTNd = m_aDelPam.GetMarkNode().GetTextNode(); if( pTNd ) // first use the previous text node -m_aDelPam.GetMark()->nContent.Assign(pTNd, pTNd->GetText().getLength()); +m_aDelPam.GetMark()->SetContent(pTNd->GetText().getLength()); else if( bTstNextPara ) { // then try the next (at the beginning of a Doc, table cells, frames, ...) -m_aDelPam.GetMark()->nNode = (m_pCurTextFrame->GetMergedPara() +const SwTextNode* pNext = m_pCurTextFrame->GetMergedPara() ? m_pCurTextFrame->GetMergedPara()->pLastNode -: m_pCurTextNd -)->GetIndex() + 1; +: m_pCurTextNd; +m_aDelPam.GetMark()->Assign(pNext->GetIndex() + 1); pTNd = m_aDelPam.GetMarkNode().GetTextNode(); if( pTNd ) { -m_aDelPam.GetMark()->nContent.Assign( pTNd, 0 ); *m_aDelPam.GetPoint() = m_pCurTextFrame->MapViewToModelPos( TextFrameIndex(m_pCurTextFrame->GetText().getLength())); } @@ -1332,12 +1330,12 @@ void SwAutoFormat::JoinPrevPara() m_aDelPam.GetPoint()->Assign( *m_pCurTextFrame->GetTextNodeFirst() ); m_aDelPam.SetMark(); ---m_aDelPam.GetPoint()->nNode; +m_aDelPam.GetPoint()->Adjust(SwNodeOffset(-1)); SwTextNode* pTNd = m_aDelPam.GetPointNode().GetTextNode(); if( pTNd ) { // use the previous text node first -m_aDelPam.GetPoint()->nContent.Assign(pTNd, pTNd->GetText().getLength()); +m_aDelPam.GetPoint()->SetContent(pTNd->GetText().getLength()); DeleteSel( m_aDelPam ); } m_aDelPam.DeleteMark(); @@ -1685,7 +1683,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if ( bChgEnum || bChgBullet ) { m_aDelPam.DeleteMark(); -m_aDelPam.GetPoint()->nNode = *m_pCurTextFrame->GetTextNodeForParaProps(); +m_aDelPam.GetPoint()->Assign( *m_pCurTextFrame->GetTextNodeForParaProps() ); if( m_aFlags.bSetNumRule ) { @@ -1694,7 +1692,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) m_aDelPam.SetMark(); SwTextFrame const*const pNextFrame = GetNextNode(false); assert(pNextFrame); -m_aDelPam.GetMark()->nNode = *pNextFrame->GetTextNodeForParaProps(); +m_aDelPam.GetMark()->Assign( *pNextFrame->GetTextNodeForParaProps() ); m_aDelPam.GetMarkNode().GetTextNode()->SetAttrListLevel( nLvl ); } @@ -1968,7 +1966,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos) sal_Int32(nPos), cChar, true )); m_aDelPam.SetMark(); -m_aDelPam.GetPoint()->nContent = m_aDelPam.GetMark()->GetContentIndex() + 1; +m_aDelPam.GetPoint()->SetContent( m_aDelPam.GetMark()->GetContentIndex() + 1 ); if( 2 == sReplace.getLength() && ' ' == sReplace[ 1 ]) { sReplace = sReplace.copy( 0, 1 ); @@ -2027,7 +2025
[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source
sw/inc/calc.hxx | 12 sw/inc/ccoll.hxx |2 +- sw/inc/fmtcol.hxx|8 sw/source/core/bastyp/calc.cxx |4 ++-- sw/source/core/doc/DocumentFieldsManager.cxx | 10 +- sw/source/core/doc/docfld.cxx|4 ++-- sw/source/core/doc/fmtcol.cxx|4 ++-- 7 files changed, 24 insertions(+), 20 deletions(-) New commits: commit 50bd2ca20618ba9c9f512716d8de7521a9fde0f6 Author: Noel Grandin AuthorDate: Wed Sep 28 11:12:32 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 13:08:28 2022 +0200 sal_uLong->sal_uInt32 in CommandStruct we are already using sal_uInt32 for this in some places Change-Id: I69ed8f6c29215fcedcafc403861cdd0e06c034ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140701 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx index 978b8c698a83..4052d4f0afdd 100644 --- a/sw/inc/ccoll.hxx +++ b/sw/inc/ccoll.hxx @@ -31,7 +31,7 @@ enum class Master_CollCondition; struct CommandStruct { Master_CollCondition nCnd; -sal_uLong nSubCond; +sal_uInt32 nSubCond; }; sal_Int16 GetCommandContextIndex( std::u16string_view rContextName ); diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 1b1bd7d2e46d..b5706dc0761b 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -207,12 +207,12 @@ enum class Master_CollCondition class SW_DLLPUBLIC SwCollCondition final : public SwClient { Master_CollCondition m_nCondition; -sal_uLong m_nSubCondition; +sal_uInt32 m_nSubCondition; public: SwCollCondition( SwTextFormatColl* pColl, Master_CollCondition nMasterCond, -sal_uLong nSubCond ); +sal_uInt32 nSubCond ); virtual ~SwCollCondition() override; /// @@@ public copy ctor, but no copy assignment? @@ -225,9 +225,9 @@ public: bool operator==( const SwCollCondition& rCmp ) const; Master_CollCondition GetCondition() const { return m_nCondition; } -sal_uLong GetSubCondition() const { return m_nSubCondition; } +sal_uInt32 GetSubCondition() const { return m_nSubCondition; } -void SetCondition( Master_CollCondition nCond, sal_uLong nSubCond ); +void SetCondition( Master_CollCondition nCond, sal_uInt32 nSubCond ); SwTextFormatColl* GetTextFormatColl() const { return const_cast(static_cast(GetRegisteredIn())); } void RegisterToFormat( SwFormat& ); }; diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 9cc951b52a0c..b2e66b7c4d31 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -495,7 +495,7 @@ void SwTextFormatColls::dumpAsXml(xmlTextWriterPtr pWriter) const //FEATURE::CONDCOLL SwCollCondition::SwCollCondition( SwTextFormatColl* pColl, Master_CollCondition nMasterCond, -sal_uLong nSubCond ) +sal_uInt32 nSubCond ) : SwClient( pColl ), m_nCondition( nMasterCond ), m_nSubCondition( nSubCond ) { @@ -523,7 +523,7 @@ bool SwCollCondition::operator==( const SwCollCondition& rCmp ) const && ( m_nSubCondition == rCmp.m_nSubCondition ); } -void SwCollCondition::SetCondition( Master_CollCondition nCond, sal_uLong nSubCond ) +void SwCollCondition::SetCondition( Master_CollCondition nCond, sal_uInt32 nSubCond ) { m_nCondition = nCond; m_nSubCondition = nSubCond; commit 913ed3e5673c2d70e2c4e519eb65368b0606d7f0 Author: Noel Grandin AuthorDate: Wed Sep 28 11:01:22 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 13:08:15 2022 +0200 sal_uLong->sal_uInt32 in SwHashTable Also (*) increase the number of items this table supports from SAL_MAX_UINT16 to SAL_MAX_UINT32 (*) add some asserts to document and verify the above limit Change-Id: I53f83303af04a9ac4f3786b221e338a7684fa1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140700 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx index 2a770dc447cd..f88fe8582f6c 100644 --- a/sw/inc/calc.hxx +++ b/sw/inc/calc.hxx @@ -154,15 +154,19 @@ class SwHashTable { std::vector> m_aData; public: -SwHashTable(size_t nSize) : m_aData(nSize) {} +SwHashTable(size_t nSize) : m_aData(nSize) +{ +assert(nSize < SAL_MAX_UINT32); +} std::unique_ptr & operator[](size_t idx) { return m_aData[idx]; } std::unique_ptr const & operator[](size_t idx) const { return m_aData[idx]; } void resize(size_t nSize) { m_aData.resize(nSize); } -T* Find( const OUString& rStr, sal_uInt16* pPos = nullptr ) const +T* Find( const OUString& rStr, sal_uInt32* pPos = nullptr ) const { size_t nTableSize = m_aData.size(); -sal_uLong ii = 0; +assert(nTableSize < SAL_MAX_UINT3
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ww8import/ww8import.cxx |2 +- sw/source/ui/uno/swdetect.cxx| 25 ++--- 2 files changed, 19 insertions(+), 8 deletions(-) New commits: commit 6cec8ba33a28de7248861b2eecfc5034cbde9d37 Author: Justin Luth AuthorDate: Tue Sep 27 22:08:48 2022 -0400 Commit: Justin Luth CommitDate: Wed Sep 28 12:10:36 2022 +0200 tdf#125216 import filter: allow .doc renamed as .dot A LO 6.2.2 regression prevented .doc-as-.dot files to load, giving a "Read Error. This is not a valid WinWord6 file." Well, it is not a valid .dot file (because of some bit differences), but it is a valid .doc file. Since it was renamed to be treated as a template (requiring a save-as), we should treat it as that. Change-Id: I308375797e9dae3ca6d203fab520e91ee788325e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140687 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sw/qa/extras/ww8import/data/tdf120761_zOrder.doc b/sw/qa/extras/ww8import/data/tdf120761_zOrder.dot similarity index 100% rename from sw/qa/extras/ww8import/data/tdf120761_zOrder.doc rename to sw/qa/extras/ww8import/data/tdf120761_zOrder.dot diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index c41b86d2f8e2..0687138654f1 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf110987) CPPUNIT_TEST_FIXTURE(Test, testTdf120761_zOrder) { -load(mpTestDocumentPath, "tdf120761_zOrder.doc"); +load(mpTestDocumentPath, "tdf120761_zOrder.dot"); //The blue shape was covering everything (highest zorder = 2) instead of the lowest(0) uno::Reference xShape(getShapeByName(u"Picture 2"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty(xShape, "ZOrder")); diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index 9e354dedaf6b..83b7162ae2a0 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include using namespace ::com::sun::star; @@ -102,19 +103,29 @@ OUString SAL_CALL SwFilterDetect::detect( Sequence< PropertyValue >& lDescriptor // mis-detect it. if ( bIsDetected && aTypeName == "writer_MS_Word_97_Vorlage" ) { +// It is common practice to rename a .doc to .dot to make it a template. +// Since we have detected a.doc-ish format, always accept .dot-named-files +// as valid templates to avoid flagging this as an invalid .dot format.. +INetURLObject aParser(aMediaDesc.getUnpackedValueOrDefault( +utl::MediaDescriptor::PROP_URL, OUString())); + // Super ugly hack, but we don't want to use the whole WW8Fib thing here in // the swd library, apparently. We know (do we?) that the "aBits1" byte, as // the variable is called in WW8Fib::WW8Fib(SvStream&,sal_uInt8,sal_uInt32), // is at offset 10 in the WordDocument stream. The fDot bit is bit 0x01 of // that byte. -tools::SvRef xWordDocument = aStorage->OpenSotStream("WordDocument", StreamMode::STD_READ); -xWordDocument->Seek( 10 ); -if ( xWordDocument->Tell() == 10 ) +if (aParser.getExtension().toAsciiLowerCase() != "dot") { -sal_uInt8 aBits1; -xWordDocument->ReadUChar( aBits1 ); -// Check fDot bit -bIsDetected = ((aBits1 & 0x01) == 0x01); +tools::SvRef xWordDocument += aStorage->OpenSotStream("WordDocument", StreamMode::STD_READ); +xWordDocument->Seek(10); +if (xWordDocument->Tell() == 10) +{ +sal_uInt8 aBits1; +xWordDocument->ReadUChar(aBits1); +// Check fDot bit +bIsDetected = ((aBits1 & 0x01) == 0x01); +} } } }
[Libreoffice-commits] core.git: cui/source
cui/source/dialogs/SpellDialog.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 9be24f694d42fc9cae55ed911e0dff7f729803f1 Author: Miklos Vajna AuthorDate: Wed Sep 28 09:09:03 2022 +0200 Commit: Miklos Vajna CommitDate: Wed Sep 28 11:31:49 2022 +0200 cui: fix crash in SpellDialog::SpellContinue_Impl Crashreport signature: Fatal signal received: SIGSEGV code: 128 for address: 0x0 program/libcuilo.so svx::SpellDialog::GetNextSentence_Impl(std::unique_ptr >*, bool, bool) include/com/sun/star/uno/Reference.hxx:114 program/libcuilo.so svx::SpellDialog::SpellContinue_Impl(std::unique_ptr >*, bool, bool) cui/source/dialogs/SpellDialog.cxx:355 program/libcuilo.so svx::SpellDialog::ChangeHdl(weld::Button&) include/rtl/ustring.hxx:527 program/libmergedlo.so Control::ImplCallEventListenersAndHandler(VclEventId, std::function const&) include/rtl/ref.hxx:208 program/libmergedlo.so Button::Click() /opt/rh/devtoolset-10/root/usr/include/c++/10/bits/std_function.h:244 Change-Id: I2c7267118213ea7d915a28d77badf93f8ff75683 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140586 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140689 Tested-by: Jenkins diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 5fb079395eb9..49e1415e744e 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -352,6 +352,11 @@ void SpellDialog::SpellContinue_Impl(std::unique_ptr* pGua //then GetNextSentence() has to be called followed again by MarkNextError() //MarkNextError is not initially called if the UndoEdit mode is active bool bNextSentence = false; +if (!m_xSentenceED) +{ +return; +} + if(!((!m_xSentenceED->IsUndoEditMode() && m_xSentenceED->MarkNextError( bIgnoreCurrentError, xSpell )) || ( bNextSentence = GetNextSentence_Impl(pGuard, bUseSavedSentence, m_xSentenceED->IsUndoEditMode()) && m_xSentenceED->MarkNextError( false, xSpell return;
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/xmlcelli.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8d07dd1b5c9a81ac95407706ab93fdb3f1d82c13 Author: Noel Grandin AuthorDate: Wed Sep 28 09:30:37 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 11:29:44 2022 +0200 elide some ref-counting Change-Id: I9fb70d1612dda3c20a683a050f550d1830dd1fc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140693 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 29450409e608..89994f2e61e5 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1337,7 +1337,7 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos ) ScDocument* pDoc = rXMLImport.GetDocument(); ScDocumentImport& rDocImport = rXMLImport.GetDoc(); -OUString aText = maFormula->first; +const OUString & aText = maFormula->first; ScExternalRefManager::ApiGuard aExtRefGuard(*pDoc);
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/formulacell.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 217dab1c2c197bbaff8d9948ccb8e7cb4b959fcf Author: Noel Grandin AuthorDate: Wed Sep 28 09:24:44 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 11:29:07 2022 +0200 no need to convert this OUStringBuffer to OUString can save some cycles by treating it as a std::u16string_view Change-Id: I704118b26cbfbebcc8a7f19ce11079ef5a544a84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140692 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 9754ab340188..023a4214bd93 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1290,9 +1290,8 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr // The initial '=' is optional in ODFF. const sal_Int32 nLeadingEqual = (aFormula.getLength() > 0 && aFormula[0] == '=') ? 1 : 0; -OUString aShouldBe = aShouldBeBuf.makeStringAndClear(); -if (aFormula.getLength() == aShouldBe.getLength() + nLeadingEqual && -aFormula.match( aShouldBe, nLeadingEqual)) +if (aFormula.getLength() == aShouldBeBuf.getLength() + nLeadingEqual && +aFormula.match( aShouldBeBuf, nLeadingEqual)) { // Put them in the same formula group. ScFormulaCellGroupRef xGroup = pPreviousCell->GetCellGroup();
[Libreoffice-commits] core.git: 2 commits - formula/source include/formula include/sax
formula/source/ui/dlg/FormulaHelper.cxx | 16 include/formula/formulahelper.hxx |8 include/sax/fastattribs.hxx |5 - 3 files changed, 16 insertions(+), 13 deletions(-) New commits: commit 01c9e8808bdee7ee355a037fda2889150f21f6fe Author: Noel Grandin AuthorDate: Wed Sep 28 10:30:43 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 11:28:53 2022 +0200 use more string_view in formula Change-Id: I3d9feafb0e2010f284a1700becbe9b701edc9849 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140697 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 15d3b411a4a2..85799c40ecc2 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -131,7 +131,7 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula, } -void FormulaHelper::FillArgStrings( const OUString& rFormula, +void FormulaHelper::FillArgStrings( std::u16string_view rFormula, sal_Int32 nFuncPos, sal_uInt16nArgs, ::std::vector< OUString >& _rArgs ) const @@ -150,7 +150,7 @@ void FormulaHelper::FillArgStrings( const OUString& rFormula, nEnd = GetArgStart( rFormula, nFuncPos, i+1 ); if ( nEnd != nStart ) -_rArgs.push_back(rFormula.copy( nStart, nEnd-1-nStart )); +_rArgs.push_back(OUString(rFormula.substr( nStart, nEnd-1-nStart ))); else { _rArgs.emplace_back(); @@ -161,7 +161,7 @@ void FormulaHelper::FillArgStrings( const OUString& rFormula, { nEnd = GetFunctionEnd( rFormula, nFuncPos )-1; if ( nStart < nEnd ) -_rArgs.push_back( rFormula.copy( nStart, nEnd-nStart ) ); +_rArgs.push_back( OUString(rFormula.substr( nStart, nEnd-nStart )) ); else _rArgs.emplace_back(); } @@ -174,7 +174,7 @@ void FormulaHelper::FillArgStrings( const OUString& rFormula, void FormulaHelper::GetArgStrings( ::std::vector< OUString >& _rArgs, - const OUString& rFormula, + std::u16string_view rFormula, sal_Int32 nFuncPos, sal_uInt16 nArgs ) const { @@ -299,9 +299,9 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula, } -sal_Int32 FormulaHelper::GetFunctionEnd( const OUString& rStr, sal_Int32 nStart ) const +sal_Int32 FormulaHelper::GetFunctionEnd( std::u16string_view rStr, sal_Int32 nStart ) const { -sal_Int32 nStrLen = rStr.getLength(); +sal_Int32 nStrLen = rStr.size(); if ( nStrLen < nStart ) return nStart; @@ -358,9 +358,9 @@ sal_Int32 FormulaHelper::GetFunctionEnd( const OUString& rStr, sal_Int32 nStart } -sal_Int32 FormulaHelper::GetArgStart( const OUString& rStr, sal_Int32 nStart, sal_uInt16 nArg ) const +sal_Int32 FormulaHelper::GetArgStart( std::u16string_view rStr, sal_Int32 nStart, sal_uInt16 nArg ) const { -sal_Int32 nStrLen = rStr.getLength(); +sal_Int32 nStrLen = rStr.size(); if ( nStrLen < nStart ) return nStart; diff --git a/include/formula/formulahelper.hxx b/include/formula/formulahelper.hxx index 02f757dc3726..f57a276fb178 100644 --- a/include/formula/formulahelper.hxx +++ b/include/formula/formulahelper.hxx @@ -62,17 +62,17 @@ namespace formula sal_Int32 GetFunctionStart( const OUString& rFormula, sal_Int32 nStart, bool bBack, OUString* pFuncName = nullptr ) const; -sal_Int32 GetFunctionEnd ( const OUString& rFormula, sal_Int32 nStart ) const; +sal_Int32 GetFunctionEnd ( std::u16string_view rFormula, sal_Int32 nStart ) const; -sal_Int32 GetArgStart ( const OUString& rFormula, sal_Int32 nStart, +sal_Int32 GetArgStart ( std::u16string_view rFormula, sal_Int32 nStart, sal_uInt16 nArg ) const; voidGetArgStrings ( ::std::vector< OUString >& _rArgs, - const OUString& rFormula, + std::u16string_view rFormula, sal_Int32 nFuncPos, sal_uInt16nArgs ) const; -voidFillArgStrings ( const OUString& rFormula, +voidFillArgStrings ( std::u16string_view rFormula, sal_Int32
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4-2' - translations
translations |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 32dbc524e039682de88039885750357af7582046 Author: Martin Srebotnjak AuthorDate: Wed Sep 28 11:06:35 2022 +0200 Commit: Gerrit Code Review CommitDate: Wed Sep 28 11:06:35 2022 +0200 Update git submodules * Update translations from branch 'libreoffice-7-4-2' to 0abf95d0ff36afa188a530411b0acdb8c2267188 - Updated Slovenian translation Change-Id: Ib30d3f707b02ca1ffbf1dd16287fb5cb275ceccd diff --git a/translations b/translations index 9cb1c441427c..0abf95d0ff36 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 9cb1c441427ca7e2a126e563413c64c6b4177f8c +Subproject commit 0abf95d0ff36afa188a530411b0acdb8c2267188
[Libreoffice-commits] translations.git: Branch 'libreoffice-7-4-2' - source/sl
source/sl/cui/messages.po | 10 +- source/sl/helpcontent2/source/text/sbasic/shared/03.po |2 +- source/sl/helpcontent2/source/text/swriter/01.po | 10 +- source/sl/sw/messages.po |6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) New commits: commit 0abf95d0ff36afa188a530411b0acdb8c2267188 Author: Martin Srebotnjak AuthorDate: Wed Sep 28 11:05:52 2022 +0200 Commit: Andras Timar CommitDate: Wed Sep 28 11:06:29 2022 +0200 Updated Slovenian translation Change-Id: Ib30d3f707b02ca1ffbf1dd16287fb5cb275ceccd diff --git a/source/sl/cui/messages.po b/source/sl/cui/messages.po index 97be9a3e88e..4921e2e511c 100644 --- a/source/sl/cui/messages.po +++ b/source/sl/cui/messages.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-14 22:43+0200\n" -"PO-Revision-Date: 2022-07-15 08:09+0200\n" +"PO-Revision-Date: 2022-08-10 14:01+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" "Language: sl\n" @@ -9989,12 +9989,12 @@ msgstr "Uporabite osnovni URL, t.j. brez »/check« na koncu." #: cui/uiconfig/ui/langtoolconfigpage.ui:174 msgctxt "langtoolconfigpage|usernamedesc" msgid "Your LanguageTool account’s username for premium usage." -msgstr "Uporabniško ime vašega računa LanguageTool za rabo naprednih storitev." +msgstr "Uporabniško ime vašega računa LanguageTool za uporabo storitev Premium." #: cui/uiconfig/ui/langtoolconfigpage.ui:189 msgctxt "langtoolconfigpage|apikeydesc" msgid "Your LanguageTool account’s API key for premium usage." -msgstr "Ključ API vašega računa LanguageTool za rabo naprednih storitev." +msgstr "Ključ API vašega računa LanguageTool za uporabo storitev Premium." #: cui/uiconfig/ui/langtoolconfigpage.ui:215 msgctxt "langtoolconfigpage|apisettingsheader" @@ -17660,7 +17660,7 @@ msgstr "Samodejno vstavi vezaje, kjer so v odstavku potrebni." #: cui/uiconfig/ui/textflowpage.ui:111 msgctxt "textflowpage|extended_tip|spinMinLen" msgid "Enter the minimum word length in characters that can be hyphenated." -msgstr "Vnesite najmanjšo dolžino besed v znakih, ki so še lahko deljene." +msgstr "Vnesite najmanjše število znakov v besedi, da jo je še možno deliti." #: cui/uiconfig/ui/textflowpage.ui:131 msgctxt "textflowpage|extended_tip|spinMaxNum" @@ -17695,7 +17695,7 @@ msgstr "_Največje število zaporednih deljenih vrstic" #: cui/uiconfig/ui/textflowpage.ui:227 msgctxt "textflowpage|labelMinLen" msgid "_Minimum word length in characters" -msgstr "Najmanjša _dolžina besed v znakih" +msgstr "Najmanjše _število znakov v besedi" #: cui/uiconfig/ui/textflowpage.ui:238 msgctxt "textflowpage|checkNoCaps" diff --git a/source/sl/helpcontent2/source/text/sbasic/shared/03.po b/source/sl/helpcontent2/source/text/sbasic/shared/03.po index 84de65e6cf9..f12b33e153b 100644 --- a/source/sl/helpcontent2/source/text/sbasic/shared/03.po +++ b/source/sl/helpcontent2/source/text/sbasic/shared/03.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-06 10:49+0200\n" -"PO-Revision-Date: 2022-07-16 02:47+0200\n" +"PO-Revision-Date: 2022-08-10 13:37+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" "Language: sl\n" diff --git a/source/sl/helpcontent2/source/text/swriter/01.po b/source/sl/helpcontent2/source/text/swriter/01.po index 093d9de7350..ab4ece6e0c2 100644 --- a/source/sl/helpcontent2/source/text/swriter/01.po +++ b/source/sl/helpcontent2/source/text/swriter/01.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-06 10:49+0200\n" -"PO-Revision-Date: 2022-07-02 19:35+0200\n" +"PO-Revision-Date: 2022-08-10 14:02+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: sl\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" "X-Generator: Virtaal 0.7.1\n" "X-Accelerator-Marker: ~\n" @@ -13359,7 +13359,7 @@ msgctxt "" "par_idN10758\n" "help.text" msgid "Select the number of rows that you want to use for the heading. The spinbox accepts values up to one less than the number of rows being inserted." -msgstr "Določite število vrstic, ki jih želite uporabiti za naslov. Vrtilno polje sprejme vrednosti do največ ene manj od števila vstavljenih vrstic." +msgstr "Določite število
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - translations
translations |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 901297a0361c0b0508e5c9fa413e1002560cb49a Author: Martin Srebotnjak AuthorDate: Wed Sep 28 11:05:59 2022 +0200 Commit: Gerrit Code Review CommitDate: Wed Sep 28 11:05:59 2022 +0200 Update git submodules * Update translations from branch 'libreoffice-7-4' to 63fc89f66c6f7849fda89ef96f90d9676b086db3 - Updated Slovenian translation Change-Id: Ib30d3f707b02ca1ffbf1dd16287fb5cb275ceccd diff --git a/translations b/translations index 26e09adb675a..63fc89f66c6f 16 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 26e09adb675a8fab61dec7817832b94ce23d9fb6 +Subproject commit 63fc89f66c6f7849fda89ef96f90d9676b086db3
[Libreoffice-commits] translations.git: Branch 'libreoffice-7-4' - source/sl
source/sl/cui/messages.po | 10 +- source/sl/helpcontent2/source/text/sbasic/shared/03.po |2 +- source/sl/helpcontent2/source/text/swriter/01.po | 10 +- source/sl/sw/messages.po |6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) New commits: commit 63fc89f66c6f7849fda89ef96f90d9676b086db3 Author: Martin Srebotnjak AuthorDate: Wed Sep 28 11:05:52 2022 +0200 Commit: Andras Timar CommitDate: Wed Sep 28 11:05:52 2022 +0200 Updated Slovenian translation Change-Id: Ib30d3f707b02ca1ffbf1dd16287fb5cb275ceccd diff --git a/source/sl/cui/messages.po b/source/sl/cui/messages.po index 97be9a3e88e..4921e2e511c 100644 --- a/source/sl/cui/messages.po +++ b/source/sl/cui/messages.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-14 22:43+0200\n" -"PO-Revision-Date: 2022-07-15 08:09+0200\n" +"PO-Revision-Date: 2022-08-10 14:01+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" "Language: sl\n" @@ -9989,12 +9989,12 @@ msgstr "Uporabite osnovni URL, t.j. brez »/check« na koncu." #: cui/uiconfig/ui/langtoolconfigpage.ui:174 msgctxt "langtoolconfigpage|usernamedesc" msgid "Your LanguageTool account’s username for premium usage." -msgstr "Uporabniško ime vašega računa LanguageTool za rabo naprednih storitev." +msgstr "Uporabniško ime vašega računa LanguageTool za uporabo storitev Premium." #: cui/uiconfig/ui/langtoolconfigpage.ui:189 msgctxt "langtoolconfigpage|apikeydesc" msgid "Your LanguageTool account’s API key for premium usage." -msgstr "Ključ API vašega računa LanguageTool za rabo naprednih storitev." +msgstr "Ključ API vašega računa LanguageTool za uporabo storitev Premium." #: cui/uiconfig/ui/langtoolconfigpage.ui:215 msgctxt "langtoolconfigpage|apisettingsheader" @@ -17660,7 +17660,7 @@ msgstr "Samodejno vstavi vezaje, kjer so v odstavku potrebni." #: cui/uiconfig/ui/textflowpage.ui:111 msgctxt "textflowpage|extended_tip|spinMinLen" msgid "Enter the minimum word length in characters that can be hyphenated." -msgstr "Vnesite najmanjšo dolžino besed v znakih, ki so še lahko deljene." +msgstr "Vnesite najmanjše število znakov v besedi, da jo je še možno deliti." #: cui/uiconfig/ui/textflowpage.ui:131 msgctxt "textflowpage|extended_tip|spinMaxNum" @@ -17695,7 +17695,7 @@ msgstr "_Največje število zaporednih deljenih vrstic" #: cui/uiconfig/ui/textflowpage.ui:227 msgctxt "textflowpage|labelMinLen" msgid "_Minimum word length in characters" -msgstr "Najmanjša _dolžina besed v znakih" +msgstr "Najmanjše _število znakov v besedi" #: cui/uiconfig/ui/textflowpage.ui:238 msgctxt "textflowpage|checkNoCaps" diff --git a/source/sl/helpcontent2/source/text/sbasic/shared/03.po b/source/sl/helpcontent2/source/text/sbasic/shared/03.po index 84de65e6cf9..f12b33e153b 100644 --- a/source/sl/helpcontent2/source/text/sbasic/shared/03.po +++ b/source/sl/helpcontent2/source/text/sbasic/shared/03.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-06 10:49+0200\n" -"PO-Revision-Date: 2022-07-16 02:47+0200\n" +"PO-Revision-Date: 2022-08-10 13:37+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" "Language: sl\n" diff --git a/source/sl/helpcontent2/source/text/swriter/01.po b/source/sl/helpcontent2/source/text/swriter/01.po index 093d9de7350..ab4ece6e0c2 100644 --- a/source/sl/helpcontent2/source/text/swriter/01.po +++ b/source/sl/helpcontent2/source/text/swriter/01.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: LibreOffice 7.4\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"; "POT-Creation-Date: 2022-07-06 10:49+0200\n" -"PO-Revision-Date: 2022-07-02 19:35+0200\n" +"PO-Revision-Date: 2022-08-10 14:02+0200\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: sl.libreoffice.org\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: sl\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" "X-Generator: Virtaal 0.7.1\n" "X-Accelerator-Marker: ~\n" @@ -13359,7 +13359,7 @@ msgctxt "" "par_idN10758\n" "help.text" msgid "Select the number of rows that you want to use for the heading. The spinbox accepts values up to one less than the number of rows being inserted." -msgstr "Določite število vrstic, ki jih želite uporabiti za naslov. Vrtilno polje sprejme vrednosti do največ ene manj od števila vstavljenih vrstic." +msgstr "Določite število
[Libreoffice-commits] core.git: sax/source
sax/source/fastparser/fastparser.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b47733e5f0a16f3fc1bdaad5c3ec171f2fc35d02 Author: Noel Grandin AuthorDate: Wed Sep 28 08:54:35 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 11:03:09 2022 +0200 avoid some ref-counting in a hot path Change-Id: Ibae87fc4e2fbe11d52cd89134a253ac2215134a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140690 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 155cf656a00d..daf51f4ea1ee 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -435,7 +435,7 @@ void Entity::startElement( Event const *pEvent ) try { -Reference< XFastAttributeList > xAttr( pEvent->mxAttributes ); +const Reference< XFastAttributeList > & xAttr( pEvent->mxAttributes ); Reference< XFastContextHandler > xContext; if ( mxNamespaceHandler.is() )
[Libreoffice-commits] core.git: sw/source
sw/source/core/edit/acorrect.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 4b697b15a4985160fbe5b384411aa6b9c0b11b60 Author: Noel Grandin AuthorDate: Wed Sep 28 09:30:13 2022 +0200 Commit: Noel Grandin CommitDate: Wed Sep 28 10:47:16 2022 +0200 use more SwPosition::SetContent part of the process of hiding the internals of SwPosition Change-Id: Iede060702cefc3c2b0a5c5268ece07affa1e3a83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140669 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 130e9aa4f580..9359420785b8 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -206,7 +206,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const SwPaM* pPam = &m_rCursor; if (pPam->GetPoint()->GetNode() != *pos.first -|| pPam->GetPoint()->nContent != pos.second) +|| pPam->GetPoint()->GetContentIndex() != pos.second) { pPam = new SwPaM(*pos.first, pos.second); } @@ -250,8 +250,8 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const PaMIntoCursorShellRing aTmp( m_rEditSh, m_rCursor, *pPam ); pPam->SetMark(); -pPam->GetPoint()->nContent = std::min( -pos.first->GetText().getLength(), pos.second + nSourceLength); +pPam->GetPoint()->SetContent( std::min( +pos.first->GetText().getLength(), pos.second + nSourceLength) ); pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); pPam->Exchange(); pPam->DeleteMark(); @@ -260,8 +260,8 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const else { pPam->SetMark(); -pPam->GetPoint()->nContent = std::min( -pos.first->GetText().getLength(), pos.second + nSourceLength); +pPam->GetPoint()->SetContent( std::min( +pos.first->GetText().getLength(), pos.second + nSourceLength) ); pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); pPam->Exchange(); pPam->DeleteMark(); @@ -476,10 +476,10 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, aCpyPam.SetMark(); // then until the end of the Nodes Array -aCpyPam.GetPoint()->nNode.Assign( pAutoDoc->GetNodes().GetEndOfContent(), -1 ); +aCpyPam.GetPoint()->Assign( pAutoDoc->GetNodes().GetEndOfContent(), SwNodeOffset(-1) ); pContentNd = aCpyPam.GetPointContentNode(); -aCpyPam.GetPoint()->nContent.Assign( - pContentNd, pContentNd ? pContentNd->Len() : 0); +if (pContentNd) +aCpyPam.GetPoint()->SetContent( pContentNd->Len() ); SwDontExpandItem aExpItem; aExpItem.SaveDontExpandItems( *aPam.GetPoint() );
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf147724.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport18.cxx | 13 + writerfilter/source/dmapper/SdtHelper.cxx| 64 ++- writerfilter/source/dmapper/SdtHelper.hxx|3 - 4 files changed, 69 insertions(+), 11 deletions(-) New commits: commit da100343e5416e1040f8f6d83fd73d8d0577112e Author: Vasily Melenchuk AuthorDate: Sun Sep 11 15:46:09 2022 +0300 Commit: Vasily Melenchuk CommitDate: Wed Sep 28 09:58:00 2022 +0200 tdf#147724: DOCX STD import: use storeid to indetify custom XML We need to identify XML document to use by storeid in sdt block and in properties of external XML file. Otherwise are possible content collisions when same xpath can evaluate successfully absolutely unrelated custom XML. Change-Id: I6d201a539130b110046deb1818340513cc47a061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139771 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/sw/qa/extras/ooxmlexport/data/tdf147724.docx b/sw/qa/extras/ooxmlexport/data/tdf147724.docx new file mode 100644 index ..97f05c921b89 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf147724.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx index 6c4eaa09fa34..b9932f7c199d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx @@ -104,6 +104,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149551_mongolianVert) assertXPath(pXmlDoc, "//wps:bodyPr", "vert", "mongolianVert"); } +DECLARE_OOXMLEXPORT_TEST(testTdf147724, "tdf147724.docx") +{ +const auto& pLayout = parseLayoutDump(); + +// Ensure we load field value from external XML correctly (it was "HERUNTERLADEN") +assertXPathContent(pLayout, "/root/page[1]/body/txt[1]", "Placeholder -> *ABC*"); + +// This SDT has no storage id, it is not an error, but content can be taken from any suitable XML +// There 2 variants possible, both are acceptable +OUString sFieldResult = getXPathContent(pLayout, "/root/page[1]/body/txt[2]"); +CPPUNIT_ASSERT(sFieldResult == "Placeholder -> *HERUNTERLADEN*" || sFieldResult == "Placeholder -> *ABC*"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 50ddf4b99b21..8225a6a04bca 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -104,13 +104,13 @@ void SdtHelper::loadPropertiesXMLs() if (!xDomBuilder.is()) return; -std::vector> aPropDocs; - // Load core properties try { auto xCorePropsStream = xImporter->getCorePropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xCorePropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"), // hardcoded id for core props + xDomBuilder->parse(xCorePropsStream) }); } catch (const uno::Exception&) { @@ -123,7 +123,9 @@ void SdtHelper::loadPropertiesXMLs() { auto xExtPropsStream = xImporter->getExtendedPropertiesStream(m_rDM_Impl.m_xDocumentStorage); -aPropDocs.push_back(xDomBuilder->parse(xExtPropsStream)); +m_xPropertiesXMLs.insert( +{ OUString("{6668398D-A668-4E3E-A5EB-62B293D839F1}"), // hardcoded id for extended props + xDomBuilder->parse(xExtPropsStream) }); } catch (const uno::Exception&) { @@ -136,12 +138,40 @@ void SdtHelper::loadPropertiesXMLs() // Add custom XMLs uno::Sequence> aCustomXmls = m_rDM_Impl.getDocumentReference()->getCustomXmlDomList(); -for (const auto& xDoc : aCustomXmls) +uno::Sequence> aCustomXmlProps += m_rDM_Impl.getDocumentReference()->getCustomXmlDomPropsList(); +if (aCustomXmls.getLength()) { -aPropDocs.push_back(xDoc); +uno::Reference xXpathAPI = XPathAPI::create(m_xComponentContext); +xXpathAPI->registerNS("ds", + "http://schemas.openxmlformats.org/officeDocument/2006/customXml";); +sal_Int32 nItem = 0; +// Hereby we assume that items from getCustomXmlDomList() and getCustomXmlDomPropsList() +// are matching each other: +// item1.xml -> itemProps1.xml, item2.xml -> itemProps2.xml +// This does works practically, but is it true in general? +for (const auto& xDoc : aCustomXmls) +{ +// Retrieve storeid from properties xml +OUString aStoreId; +uno::Reference xResult += xXpathAPI->eval(aCustomXmlProps[nItem], "string(/ds:datastoreItem/@ds:itemID)"); + +if (xResult.is() && xResult->getString().getLength()) +{ +a
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/draw/data/sdt-textbox-header.docx |binary sw/qa/core/draw/draw.cxx | 11 +++ sw/source/core/draw/dcontact.cxx | 41 +++ sw/source/core/draw/dflyobj.cxx | 13 sw/source/core/inc/dflyobj.hxx |1 5 files changed, 66 insertions(+) New commits: commit 914d246e0edcbdfa5969b7f3eea7c67e1a5b7522 Author: Miklos Vajna AuthorDate: Wed Sep 28 08:54:06 2022 +0200 Commit: Miklos Vajna CommitDate: Wed Sep 28 09:46:30 2022 +0200 crashtesting: fix PDF export of fdo83057-2.docx Loading this document and laying it out resulted in an assertion failure since commit de90c192cb8f1f03a4028493d8bfe9a127a76b2a (sw content controls, plain text: enable DOCX filter with data binding, 2022-09-19). Writer has two relevant invariants: First, if a draw shape is anchored into a header, then the "master" shape (typically on the first page) and its "virtual" shapes (on other pages) have their indexes / ZOrders set so that the master shape has the highest index. The second is that in case a draw+fly format is paired into a "textbox", then the fly index is always the draw index + 1. The assert fails because in this case the virtual draw shape's index is not smaller than the master one. What seems to happen here is that first SwDrawContact::ConnectToLayout() iterates the frames of the text node in the header, and happens to first visit page 1 and then page 2. So the master SdrObjects go to the first page, the virtual ones go to the second page. Then later SwDrawContact::ConnectToLayout() is called again, which removes the master and the virtual draw SdrObject from the layout and the virtual draw SdrObject from the model. Then it visits the text frames of the header text node again, but this time it happens to find the second page, and only then the first page (for reasons unclear to me, this didn't happen before the above commit). The result is that both invariants are failing: the master draw+fly is no longer on the same page and the indexes are also out of order, so one of the pages don't show shape text for the shape from the header. Fix the problem by two tweaks: - Improve SwDrawContact::ConnectToLayout(), so that in case it just appends the draw object to the layout for the master, then it adjusts its ZOrder so the matching fly will be the draw one + 1. This was working in the virtual case already, since there we call AddVirtObj() already, which calls SwDrawVirtObj::AddToDrawingPage(), which already knows how to maintain this invariant. This fixes master draw SdrObjects to be directly before their fly counterparts, even if the page order changes. - Improve SwDrawVirtObj::AddToDrawingPage(), so that in case the virtual draw SdrObject finds its fly, but that fly has an incorrect index (due to the changed page visit order), then we first fix up the fly and only then set the index of the virtual draw SdrObject. The result is a doc model like this: I.e. each draw SdrObject is followed by its fly and the masters have the highest indexes. This all stems from the behavior that 1) re-connecting a draw contact to the layout removes the draw shapes but not the flys from the layout, 2) the order of frames in an SwIterator visiting is not something we can depend on and 3) textboxes are implemented using a pair of draw+fly formats. Change-Id: Ia03f0ec70cf67626660349accc63770fe2afef5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140688 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/sw/qa/core/draw/data/sdt-textbox-header.docx b/sw/qa/core/draw/data/sdt-textbox-header.docx new file mode 100644 index ..a8b2d9625fbe Binary files /dev/null and b/sw/qa/core/draw/data/sdt-textbox-header.docx differ diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index c2514808f8e4..feb347adc8d4 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -141,6 +141,17 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) CPPUNIT_ASSERT_EQUAL(Color(0xff), Color(ColorTransparency, aBorder.Color)); } +CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testSdtTextboxHeader) +{ +// Given a 2 page document, same header on both pages, content control in the header and +// shape+fly pair (textbox) anchored in the same header: +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "sdt-textbox-header.docx"; + +// When loading that document, then make sure that layout doesn't fail with an assertion because +// the "master SdrObj should have the highest index" invariant doesn't hold: +mxComponent = loadFromDesktop(aURL, "com.sun.star.text.Te