From eb358d77291eba677141bab113dc27d7aabb0f3e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:04 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- sw/source/uibase/dochdl/swdtflvr.cxx | 3 ++- sw/source/uibase/docvw/AnnotationWin2.cxx | 2 +- sw/source/uibase/docvw/SidebarWinAcc.cxx | 10 ++++------ sw/source/uibase/index/toxmgr.cxx | 3 ++- sw/source/uibase/shells/textsh.cxx | 15 ++++++++++++++- sw/source/uibase/sidebar/PageSizeControl.cxx | 1 - sw/source/uibase/uiview/view2.cxx | 13 ++++++++++--- sw/source/uibase/utlui/uitool.cxx | 1 + sw/source/uibase/wrtsh/wrtsh1.cxx | 5 +++++ 9 files changed, 39 insertions(+), 14 deletions(-) (limited to 'sw/source/uibase') diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index cb96c08527..ea419d2326 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -382,7 +382,8 @@ const Graphic* SwTransferable::FindOLEReplacementGraphic() const void SwTransferable::RemoveDDELinkFormat(vcl::Window& rWin) { RemoveFormat( SotClipboardFormatId::LINK ); - CopyToClipboard(&rWin); + if (rWin.GetClipboard()->getContents().get() == this) + CopyToClipboard(&rWin); } void SwTransferable::DisconnectDDE() diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index a1780f9132..6b8895f1d9 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -504,7 +504,7 @@ void SwAnnotationWin::SetMenuButtonColors() const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000; aSymbolRect.AdjustBottom( -nBorderDistanceBottom ); DecorationView aDecoView(xVirDev.get()); - aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, GetTextColor(), + aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, COL_BLACK, DrawSymbolFlags::NONE); mxMenuButton->set_image(xVirDev); mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height() + 4); diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx index f489bc140b..3b2b4c758e 100644 --- a/sw/source/uibase/docvw/SidebarWinAcc.cxx +++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx @@ -23,9 +23,9 @@ #include #include #include +#include #include -#include namespace sw::sidebarwindows { @@ -47,7 +47,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent void ChangeAnchor( const SwFrame* pAnchorFrame ) { - std::scoped_lock aGuard(maMutex); + SolarMutexGuard aGuard; mpAnchorFrame = pAnchorFrame; } @@ -55,7 +55,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override { - std::scoped_lock aGuard(maMutex); + SolarMutexGuard aGuard; css::uno::Reference< css::accessibility::XAccessible > xAccParent; @@ -70,7 +70,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override { - std::scoped_lock aGuard(maMutex); + SolarMutexGuard aGuard; sal_Int64 nIndex( -1 ); @@ -87,8 +87,6 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent private: SwViewShell& mrViewShell; const SwFrame* mpAnchorFrame; - - std::mutex maMutex; }; } diff --git a/sw/source/uibase/index/toxmgr.cxx b/sw/source/uibase/index/toxmgr.cxx index 8b8ff6dbd8..c7cd813eb4 100644 --- a/sw/source/uibase/index/toxmgr.cxx +++ b/sw/source/uibase/index/toxmgr.cxx @@ -47,7 +47,8 @@ void SwTOXMgr::DeleteTOXMark() if( m_pCurTOXMark ) { pNext = const_cast(&m_pSh->GotoTOXMark( *m_pCurTOXMark, TOX_NXT )); - if (SfxPoolItem::areSame( pNext, m_pCurTOXMark )) + // tdf#158783 ptr compare OK for SwTOXMark (more below) + if (areSfxPoolItemPtrsEqual( pNext, m_pCurTOXMark )) pNext = nullptr; m_pSh->DeleteTOXMark( m_pCurTOXMark ); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 0924935b3d..97de985401 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -877,7 +877,20 @@ void SwTextShell::ExecTransliteration( SfxRequest const & rReq ) void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) { if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE ) - GetShell().TransliterateText( m_aRotateCase.getNextMode() ); + { + SwWrtShell& rSh = GetShell(); + if (rSh.HasSelection()) + { + rSh.TransliterateText(m_aRotateCase.getNextMode()); + } + else + { + rSh.Push(); // save cur cursor + if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd()) + rSh.TransliterateText(m_aRotateCase.getNextMode()); + rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); + } + } } SwTextShell::SwTextShell(SwView &_rView) : diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 4ea5995c09..a2dbe406f3 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -168,7 +168,6 @@ PageSizeControl::PageSizeControl(PageSizePopup* pControl, weld::Widget* pParent) } mxSizeValueSet->SetNoSelection(); mxSizeValueSet->SetSelectHdl( LINK(this, PageSizeControl, ImplSizeHdl ) ); - mxSizeValueSet->SetOptimalDrawingAreaHeight(); mxSizeValueSet->Show(); mxSizeValueSet->Resize(); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index cc6faf78a3..f7a10a49f7 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -286,14 +286,21 @@ OUString SwView::GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr ? SwResId(STR_PAGE_COUNT_PRINTED) : (extra.isEmpty() ? SwResId(STR_PAGE_COUNT) : SwResId(STR_PAGE_COUNT_CUSTOM))); aStr = aStr.replaceFirst("%1", OUString::number(nPhyNum)); - aStr = aStr.replaceFirst("%2", OUString::number(nPageCount)); if (nPageCount != nPrintedPageCount) { + aStr = aStr.replaceFirst("%2", OUString::number(nPageCount)); aStr = aStr.replaceFirst("%3", OUString::number(nPrintedPhyNum)); aStr = aStr.replaceFirst("%4", OUString::number(nPrintedPageCount)); } - else - aStr = aStr.replaceFirst("%3", extra); + else { + if (extra.isEmpty()) + aStr = aStr.replaceFirst("%2", OUString::number(nPageCount)); + else + { + aStr = aStr.replaceFirst("%2", extra); + aStr = aStr.replaceFirst("%3", OUString::number(nPageCount)); + } + } return aStr; } diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index fd50bf6678..dfaffe3480 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -392,6 +392,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) if(rMaster.GetFooter().IsActive()) { rMaster.SetFormatAttr(SwFormatFooter(false)); + // why reset this? but not doing it causes testTdf112694 to fail rPageDesc.ChgFooterShare(false); } } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 4b2402fc93..0054eca4cb 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -115,6 +115,7 @@ #include #include +#include #include #include #include @@ -1177,8 +1178,12 @@ void SwWrtShell::InsertContentControl(SwContentControlType eType) Left(SwCursorSkipMode::Chars, /*bSelect=*/true, aPlaceholder.getLength(), /*bBasicCall=*/false); } + + const RedlineFlags oldRedlineFlags = getIDocumentRedlineAccess().GetRedlineFlags(); + getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::Ignore); SwFormatContentControl aContentControl(pContentControl, RES_TXTATR_CONTENTCONTROL); SetAttrItem(aContentControl); + getIDocumentRedlineAccess().SetRedlineFlags(oldRedlineFlags); } // Insert footnote -- cgit v1.2.3