[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-12-06 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/frmtool.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 96f7681117e12974964f60e272241bef236c0147
Author: Michael Stahl 
AuthorDate: Wed Aug 23 15:49:44 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Dec 6 15:41:21 2023 +0100

tdf#137523 sw: layout: fix text below tables in footer differently

This fix is better than commit 027f8328eef1e149b6c99b478ed5df870291dc2d
because it turns out the last text frame had a height of 219 in 6.1.

One of the following commits would break this, so a different fix is
needed.

In SwFrameNotify::ImplDestroy(), if the frame changes its position the
next frame's position is invalidated; if the next frame is undersized
then also invalidate its size so that it will be formatted again, with
more space.

(cherry picked from commit 492ddef596c99a9c24d2778276025aafc612a7cb)

Conflicts:
sw/qa/extras/layout/layout3.cxx

Change-Id: I8e6a3fe3127ebfa2246c440d2a3455b217476475
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160386
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 4fc6286d32e4..7059b8472be8 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -202,7 +202,14 @@ void SwFrameNotify::ImplDestroy()
 }
 
 if ( pNxt )
+{
 pNxt->InvalidatePos();
+if (pNxt->IsTextFrame() && 
static_cast(pNxt)->IsUndersized())
+{   // tdf#137523 it could have more space at new pos
+pNxt->InvalidateSize();
+pNxt->Prepare(PrepareHint::AdjustSizeWithoutFormatting);
+}
+}
 else
 {
 // #104100# - correct condition for setting retouche


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-12-04 Thread Julien Nabet (via logerrit)
 sw/source/ui/frmdlg/column.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4b6a1c05b03f2108ff48018606fde070d0b019bd
Author: Julien Nabet 
AuthorDate: Thu Nov 30 17:46:08 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Dec 5 08:41:10 2023 +0100

tdf#158450: fix crash when picking custom colour for column separator line

bt:
0x7ffeed9c4a2b in SwColumnPage::SwColumnPage(weld::Container*, 
weld::DialogController*, SfxItemSet const&)::$_0::operator()() const 
(this=0x574a8e38) at 
/home/julien/lo/libreoffice/sw/source/ui/frmdlg/column.cxx:396
396 [this]{ return GetDialogController()->getDialog(); 
}))
0  0x7ffeed9c4a2b in SwColumnPage::SwColumnPage(weld::Container*, 
weld::DialogController*, SfxItemSet const&)::$_0::operator()() const 
(this=0x574a8e38) at 
/home/julien/lo/libreoffice/sw/source/ui/frmdlg/column.cxx:396
1  0x7ffeed9c4a05 in std::__invoke_impl(std::__invoke_other, 
SwColumnPage::SwColumnPage(weld::Container*, weld::DialogController*, 
SfxItemSet const&)::$_0&) (__f=...) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
2  0x7ffeed9c4985 in std::__invoke_r(SwColumnPage::SwColumnPage(weld::Container*, 
weld::DialogController*, SfxItemSet const&)::$_0&) (__fn=...) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114
3  0x7ffeed9c489d in std::_Function_handler::_M_invoke(std::_Any_data const&) (__functor=...) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290
4  0x71cb89e5 in std::function::operator()() 
const (this=0x574a8e38) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591
5  0x71c94604 in ColorWindow::OpenPickerClickHdl(weld::Button&) 
(this=0x574a8db0) at 
/home/julien/lo/libreoffice/svx/source/tbxctrls/tbcontrl.cxx:2283
6  0x71c9356d in ColorWindow::LinkStubOpenPickerClickHdl(void*, 
weld::Button&) (instance=0x574a8db0, data=...) at 
/home/julien/lo/libreoffice/svx/source/tbxctrls/tbcontrl.cxx:2279

See complete bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=191146

Regression from:
862fd2fa19b64972247bde9b171ec828a30e1676
defer getting toplevel for color picker until we need it

Change-Id: I2932281cb3b1cb510013a19f6bcf3d9f9c6cdb7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160164
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 4f8bb267489b14aa1dab360786d8f99c763f03b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160178
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index c2a24ad18ef6..a64b6fe94eb5 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -393,7 +393,7 @@ SwColumnPage::SwColumnPage(weld::Container* pPage, 
weld::DialogController* pCont
 , m_xTextDirectionFT(m_xBuilder->weld_label("textdirectionft"))
 , m_xTextDirectionLB(new 
svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("textdirectionlb")))
 , m_xLineColorDLB(new ColorListBox(m_xBuilder->weld_menu_button("colorlb"),
-[this]{ return GetDialogController()->getDialog(); }))
+[this]{ return GetFrameWeld(); }))
 , m_xLineTypeDLB(new 
SvtLineListBox(m_xBuilder->weld_menu_button("linestylelb")))
 , m_xEd1(new 
SwPercentField(m_xBuilder->weld_metric_spin_button("width1mf", FieldUnit::CM)))
 , m_xEd2(new 
SwPercentField(m_xBuilder->weld_metric_spin_button("width2mf", FieldUnit::CM)))


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-12-04 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/txtnum.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit f384dc0476e4730d3ccb7a7f56eae8452bce133a
Author: Justin Luth 
AuthorDate: Thu Nov 23 20:50:09 2023 -0500
Commit: Andras Timar 
CommitDate: Mon Dec 4 16:27:58 2023 +0100

related tdf#56258 sw sidebar SetOutline: do something without dropdown

The sidebar gained SetOutline in 7.6
with commit 3fd0b4053763aa91b0004c523e96e7d390c7b58e.

In the TOOLBAR, there is special code that tells the main button
to show the locale list outline choices - just like the dropdown does.
However, none of that code comes into play in the sidebar,
so add a special case to handle that situation.

It is easy to launch the dialog, focused on the outlinenum page.
Better yet would be to figure out how to launch the popup window
that the dropdown opens - so they do the same thing...

Change-Id: I3d6eeafaa8bdb45cfacc42e221820d664419e0e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159934
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Justin Luth 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/txtnum.cxx 
b/sw/source/uibase/shells/txtnum.cxx
index 34a95d13ee8e..ae353ed0aa55 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -310,6 +310,14 @@ void SwTextShell::ExecSetNumber(SfxRequest const )
 GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
 }
 }
+else if (nSlot == FN_SVX_SET_OUTLINE)
+{
+// no outline provided: launch dialog to request a specific 
outline
+SfxBindings& rBindings = 
GetView().GetViewFrame()->GetBindings();
+const SfxStringItem aPage(FN_PARAM_1, "outlinenum");
+const SfxPoolItem* aItems[] = { , nullptr };
+rBindings.Execute(SID_OUTLINE_BULLET, aItems);
+}
 }
 break;
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-28 Thread Paris Oplopoios (via logerrit)
 sw/source/uibase/app/apphdl.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit b58317e2fee41ae8dbe28604d4674cae84a7e4de
Author: Paris Oplopoios 
AuthorDate: Mon Jun 12 00:49:27 2023 +0300
Commit: Miklos Vajna 
CommitDate: Tue Nov 28 11:01:03 2023 +0100

Fix unchecked dynamic cast

Change-Id: If662e24bb864690ead959b2599a6448d84da0de9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152866
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159991
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 030a5b73c14e..ba92304518f2 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -984,17 +984,15 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
 {
 if(pViewShell->GetWindow())
 {
-auto pSwView = dynamic_cast( pViewShell );
-if(pSwView !=  nullptr ||
-   dynamic_cast< const SwPagePreview *>( pViewShell ) !=  
nullptr ||
-   dynamic_cast< const SwSrcView *>( pViewShell ) !=  nullptr)
+auto pSwView = dynamic_cast(pViewShell);
+if (pSwView)
 {
 SwViewOption aNewOptions = 
*pSwView->GetWrtShell().GetViewOptions();
 
aNewOptions.SetThemeName(m_pColorConfig->GetCurrentSchemeName());
 SwViewColors aViewColors(*m_pColorConfig);
 aNewOptions.SetColorConfig(aViewColors);
 pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
-pViewShell->GetWindow()->Invalidate();
+
 if (bOnlyInvalidateCurrentView)
 {
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
@@ -1003,6 +1001,12 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
 
aViewColors.m_aDocColor.AsRGBHexString().toUtf8().getStr());
 }
 }
+if(pSwView !=  nullptr ||
+   dynamic_cast< const SwPagePreview *>( pViewShell ) !=  
nullptr ||
+   dynamic_cast< const SwSrcView *>( pViewShell ) !=  nullptr)
+{
+pViewShell->GetWindow()->Invalidate();
+}
 }
 if (bOnlyInvalidateCurrentView)
 break;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-22 Thread Gökay Şatır (via logerrit)
 sw/source/core/edit/edlingu.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4c6c60d44b0056cbe08b6e75baacbc0df0cd1742
Author: Gökay Şatır 
AuthorDate: Thu Nov 2 13:37:46 2023 +0300
Commit: Gökay ŞATIR 
CommitDate: Thu Nov 23 07:29:38 2023 +0100

Proof reading suggestions:

* When user right clicks an underlined part of the sentence, we are 
checking if there is a suggestion list.
* Then we show the suggestions.

Sometimes spell checker algorithms send 2 lists for the same part of the 
sentence.
And we saw that one of these lists can be empty (no suggestions).
But since we check if there is a list, the empty list is shown to the user.

I updated the checks here and added a new condition:
Now we take the list if the list is not empty.
This way, we can find the not-empty list which may come after an empty list 
(for the same part of the sentence).

Signed-off-by: Gökay Şatır 
Change-Id: Ib3b498b98a8d44f8a7ead99593a71adcefa87a82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158832
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index ab89fc5b7241..923a70c3cb72 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1031,7 +1031,8 @@ bool SwEditShell::GetGrammarCorrection(
 auto pError = std::find_if(std::cbegin(rResult.aErrors), 
std::cend(rResult.aErrors),
 [rErrorPosInText, nLen](const 
linguistic2::SingleProofreadingError ) {
 return rError.nErrorStart <= rErrorPosInText
-&& rErrorPosInText + nLen <= rError.nErrorStart + 
rError.nErrorLength; });
+&& rErrorPosInText + nLen <= rError.nErrorStart + 
rError.nErrorLength
+&& rError.aSuggestions.size() > 0; });
 if (pError != std::cend(rResult.aErrors))
 {
 rSuggestions = pError->aSuggestions;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-22 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   15 ++-
 sw/source/uibase/inc/swdtflvr.hxx|2 ++
 sw/source/uibase/inc/uivwimp.hxx |2 ++
 sw/source/uibase/uiview/uivwimp.cxx  |   13 +
 4 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 445a0945e4d263c6bda37c58a7f6283ada5e2e36
Author: Szymon Kłos 
AuthorDate: Thu Nov 16 17:13:37 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Nov 22 09:02:22 2023 +0100

lok: disconnect clipboard leftovers in Writer to avoid crash

When we closed one view which previously copied some larger selection
in the Writer and other session after that modified content of that 
selection
we got a crash. It was caused by old clipboard data still beeing used.
On copy there is created SwTransferDdeLink which creates "Server" - 
SvLinkSource
which is notified in SwTransferDdeLink::DataChanged when someone is
editing
previously copied selection. Let's disconnect that server on view close
as it is no longer needed.

some characteristic trace pieces for crash:

libsofficeapp.so!LOKClipboard::setContents(LOKClipboard * this, const 
com::sun::star::uno::Reference & 
xTrans, const 
com::sun::star::uno::Reference
 & xClipboardOwner)
...
libswlo.so!SwTransferable::RemoveDDELinkFormat(SwTransferable * this, 
vcl::Window & rWin)
...
libsfxlo.so!sfx2::SvLinkSource::NotifyDataChanged(sfx2::SvLinkSource * this)
...
libswlo.so!SwDataChanged::~SwDataChanged(SwDataChanged * this)

Change-Id: I2ebab3db8bc42e20781874802563352ef263fdaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159563
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 6c747df13c3f..3c0baabb3410 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -283,11 +283,7 @@ SwTransferable::~SwTransferable()
 SolarMutexGuard aSolarGuard;
 
 // the DDELink still needs the WrtShell!
-if( m_xDdeLink.is() )
-{
-static_cast( m_xDdeLink.get() )->Disconnect( true 
);
-m_xDdeLink.clear();
-}
+DisconnectDDE();
 
 m_pWrtShell = nullptr;
 
@@ -393,6 +389,15 @@ void SwTransferable::RemoveDDELinkFormat(vcl::Window& rWin)
 CopyToClipboard();
 }
 
+void SwTransferable::DisconnectDDE()
+{
+if( m_xDdeLink.is() )
+{
+static_cast( m_xDdeLink.get() )->Disconnect( true 
);
+m_xDdeLink.clear();
+}
+}
+
 namespace
 {
 //Resolves: fdo#40717 surely when we create a clipboard document we should
diff --git a/sw/source/uibase/inc/swdtflvr.hxx 
b/sw/source/uibase/inc/swdtflvr.hxx
index df16e3a8bd56..ac0579a3a9f0 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -185,6 +185,8 @@ public:
 
 // remove the DDE-Link format promise
 void RemoveDDELinkFormat(vcl::Window& rWin);
+// disconnect to not receive DataChanged listener notifications
+void DisconnectDDE();
 
 // paste - methods and helper methods for the paste
 static bool IsPaste( const SwWrtShell&, const TransferableDataHelper& );
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx
index 1cb5fd6590ed..3600ddc2258a 100644
--- a/sw/source/uibase/inc/uivwimp.hxx
+++ b/sw/source/uibase/inc/uivwimp.hxx
@@ -110,6 +110,8 @@ class SwView_Impl
 boolm_bSelectObject;
 boolm_bEditingPositionSet;
 
+voidDisconnectTransferableDDE();
+
 public:
 /// Redline author that's specific to this view.
 OUString m_sRedlineAuthor;
diff --git a/sw/source/uibase/uiview/uivwimp.cxx 
b/sw/source/uibase/uiview/uivwimp.cxx
index cea09ed3b5ba..7729c01c22f1 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -67,6 +67,7 @@ SwView_Impl::~SwView_Impl()
 view::XSelectionSupplier* pTextView = mxXTextView.get();
 static_cast(pTextView)->Invalidate();
 mxXTextView.clear();
+
 if( mxScanEvtLstnr.is() )
mxScanEvtLstnr->ViewDestroyed();
 if( mxClipEvtLstnr.is() )
@@ -74,6 +75,8 @@ SwView_Impl::~SwView_Impl()
 mxClipEvtLstnr->AddRemoveListener( false );
 mxClipEvtLstnr->ViewDestroyed();
 }
+DisconnectTransferableDDE();
+
 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
 m_xConfigItem.reset();
 #endif
@@ -218,6 +221,16 @@ void SwView_Impl::Invalidate()
 }
 }
 
+void SwView_Impl::DisconnectTransferableDDE()
+{
+for (const auto& xTransferable: mxTransferables)
+{
+auto pTransferable = 
comphelper::getFromUnoTunnel(xTransferable.get());
+if(pTransferable)
+pTransferable->DisconnectDDE();
+}
+}
+
 void SwView_Impl::AddTransferable(SwTransferable& rTransferable)
 {
 //prevent removing of the non-referenced SwTransferable


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-17 Thread Miklos Vajna (via logerrit)
 sw/source/core/layout/fly.cxx |4 ++--
 sw/source/uibase/docvw/UnfloatTableButton.cxx |5 -
 sw/source/uibase/inc/FrameControl.hxx |1 +
 sw/source/uibase/inc/UnfloatTableButton.hxx   |4 ++--
 4 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit c879d43af18c3b4318d5299d3179c8bd741ac80e
Author: Miklos Vajna 
AuthorDate: Thu Nov 16 08:29:26 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Nov 17 11:35:07 2023 +0100

sw floattable, delete UI: fix unfloat button for cant-split frames

Open sw/qa/extras/uiwriter/data/unfloatable_floating_table.odt, select
the TextFrame, click on the "unfloat" button that appears, then nothing
happens.

This is a problem since commit 51379fb3d46e5891bdaea0122bd62b0753663da3
(weld writer's FrameControl MenuButtons, 2020-12-03), the old
MouseButtonDown() callback is never invoked.

Fix the problem similar to what SwHeaderFooterWin does, which works:
instead of overriding the dead MouseButtonDown(), explicitly connect the
click handler to the weld::Button widget.

Also adjust SwFlyFrame::ActiveUnfloatButton() to use the welded
callback, this way CppunitTest_sw_uiwriter2's testUnfloating covers the
fix.

(cherry picked from commit 2f42d8acd2d06f848c9e680c42a0f7834a9a641f)

Change-Id: I1180fc6a0ae2df7c01c273a5ef92dd8915ca70a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159552
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index e0b9d1837e67..bfc36bcef62b 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2106,9 +2106,9 @@ void SwFlyFrame::ActiveUnfloatButton(SwWrtShell* pWrtSh)
 SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
 SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
 SwFrameControlPtr pControl = 
rMngr.GetControl(FrameControlType::FloatingTable, this);
-if (pControl && pControl->GetWindow())
+if (pControl && pControl->GetIFacePtr())
 {
-pControl->GetWindow()->MouseButtonDown(MouseEvent());
+pControl->GetIFacePtr()->GetButton()->clicked();
 }
 }
 
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx 
b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index a52194e39a62..3673d82e312f 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -53,9 +53,12 @@ UnfloatTableButton::UnfloatTableButton(SwEditWin* pEditWin, 
const SwFrame* pFram
 {
 m_xPushButton->set_accessible_name(m_sLabel);
 m_xVirDev = m_xPushButton->create_virtual_device();
+m_xPushButton->connect_clicked(LINK(this, UnfloatTableButton, ClickHdl));
 SetVirDevFont();
 }
 
+weld::Button* UnfloatTableButton::GetButton() { return m_xPushButton.get(); }
+
 UnfloatTableButton::~UnfloatTableButton() { disposeOnce(); }
 
 void UnfloatTableButton::dispose()
@@ -89,7 +92,7 @@ void UnfloatTableButton::SetOffset(Point aTopRightPixel)
 PaintButton();
 }
 
-void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/)
+IMPL_LINK_NOARG(UnfloatTableButton, ClickHdl, weld::Button&, void)
 {
 assert(GetFrame()->IsFlyFrame());
 // const_cast is needed because of bad design of ISwFrameControl and 
derived classes
diff --git a/sw/source/uibase/inc/FrameControl.hxx 
b/sw/source/uibase/inc/FrameControl.hxx
index 4ab1d61b0303..4dd61c1494eb 100644
--- a/sw/source/uibase/inc/FrameControl.hxx
+++ b/sw/source/uibase/inc/FrameControl.hxx
@@ -32,6 +32,7 @@ public:
 
 virtual const SwFrame* GetFrame() = 0;
 virtual SwEditWin*   GetEditWin() = 0;
+virtual weld::Button* GetButton() { return nullptr; };
 };
 
 class SwFrameControl final
diff --git a/sw/source/uibase/inc/UnfloatTableButton.hxx 
b/sw/source/uibase/inc/UnfloatTableButton.hxx
index 164b240f28b1..8803b5169173 100644
--- a/sw/source/uibase/inc/UnfloatTableButton.hxx
+++ b/sw/source/uibase/inc/UnfloatTableButton.hxx
@@ -34,14 +34,14 @@ public:
 
 void SetOffset(Point aTopRightPixel);
 
-virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
-
 virtual void ShowAll(bool bShow) override;
 virtual bool Contains(const Point& rDocPt) const override;
 
 virtual void SetReadonly(bool bReadonly) override;
+weld::Button* GetButton() override;
 
 private:
+DECL_LINK(ClickHdl, weld::Button&, void);
 void PaintButton();
 };
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-13 Thread Julien Nabet (via logerrit)
 sw/source/ui/misc/translatelangselect.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7cde7927fa19a9a79daecf93694426d271a7c2af
Author: Julien Nabet 
AuthorDate: Sat Nov 11 16:00:58 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Nov 13 12:22:17 2023 +0100

tdf#158171: fix crash when double-clicking DeepL translation dialog OK 
button

Change-Id: I4954357c59c7134d882fb19e9949ecbd5d60345a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159322
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 87b0196d595d1b78ba38bccc49e2a57d6047bc37)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159244
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/ui/misc/translatelangselect.cxx 
b/sw/source/ui/misc/translatelangselect.cxx
index b8fd0718e7d3..2df2e98e364c 100644
--- a/sw/source/ui/misc/translatelangselect.cxx
+++ b/sw/source/ui/misc/translatelangselect.cxx
@@ -122,6 +122,8 @@ IMPL_LINK_NOARG(SwTranslateLangSelectDlg, 
LangSelectCancelHdl, weld::Button&, vo
 
 IMPL_LINK_NOARG(SwTranslateLangSelectDlg, LangSelectTranslateHdl, 
weld::Button&, void)
 {
+if (m_bTranslationStarted)
+return;
 if (SwTranslateLangSelectDlg::selectedLangIdx == -1)
 {
 m_xDialog->response(RET_CANCEL);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-11 Thread Mike Kaganski (via logerrit)
 sw/source/core/txtnode/fntcache.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8b1aa9a5f5cd6f866cda03b6f17f87684c061ab6
Author: Mike Kaganski 
AuthorDate: Thu Oct 12 10:48:38 2023 +0300
Commit: Aron Budea 
CommitDate: Sat Nov 11 12:10:15 2023 +0100

Fix Windows x64 build

...after 6f45c0cf86b21772740bb0cafb3d462b058523f3 "cool#7318 Calc rendering
acceleration" caused

> sw/source/core/txtnode/fntcache.cxx(540): error C2672: 'std::min': no 
matching overloaded function found
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1438~1.331\Include\utility(108):
 note: could be '_Ty std::min(std::initializer_list<_Elem>)'
> sw/source/core/txtnode/fntcache.cxx(540): note: '_Ty 
std::min(std::initializer_list<_Elem>)': expects 1 arguments - 2 provided
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1438~1.331\Include\utility(105):
 note: or   '_Ty std::min(std::initializer_list<_Elem>,_Pr)'
> sw/source/core/txtnode/fntcache.cxx(540): note: '_Ty 
std::min(std::initializer_list<_Elem>,_Pr)': could not deduce template argument 
for 'std::initializer_list<_Elem>' from 'sal_Int32'
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1438~1.331\Include\utility(98): 
note: or   'const _Ty ::min(const _Ty &,const _Ty &) noexcept()'
> sw/source/core/txtnode/fntcache.cxx(540): note: 'const _Ty 
::min(const _Ty &,const _Ty &) noexcept()': template parameter '_Ty' 
is ambiguous
> sw/source/core/txtnode/fntcache.cxx(540): note: could be 'tools::Long'
> sw/source/core/txtnode/fntcache.cxx(540): note: or   'sal_Int32'
> sw/source/core/txtnode/fntcache.cxx(540): note: 'const _Ty 
::min(const _Ty &,const _Ty &) noexcept()': could not deduce template 
argument for 'const _Ty &' from 'tools::Long'
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1438~1.331\Include\utility(88): 
note: or   'const _Ty ::min(const _Ty &,const _Ty &,_Pr) 
noexcept()'
> sw/source/core/txtnode/fntcache.cxx(540): note: 'const _Ty 
::min(const _Ty &,const _Ty &,_Pr) noexcept()': expects 3 arguments - 
2 provided

Change-Id: I9af33041a81190998303aec2795fe03da7e2f119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157858
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit a0b003257aa87d34a4403531798d0074e19a18ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159240
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index bc5dd603a433..4e9f2a1c1dc7 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -516,7 +516,7 @@ void SwFntObj::GuessLeading( const SwViewShell&
 {
 // If the Leading on the Window is also 0, then it has to stay
 // that way (see also StarMath).
-tools::Long nTmpLeading = aWinMet.GetInternalLeading();
+sal_Int32 nTmpLeading = aWinMet.GetInternalLeading();
 if( nTmpLeading <= 0 )
 {
 pWin->SetFont( rMet );
@@ -537,7 +537,7 @@ void SwFntObj::GuessLeading( const SwViewShell&
 // Those who lie about their Leading, may lie about their
 // Ascent/Descent as well, hence the Font will be lowered a
 // little without changing its height.
-tools::Long nDiff = std::min( rMet.GetDescent() - 
aWinMet.GetDescent(),
+sal_Int32 nDiff = std::min( rMet.GetDescent() - 
aWinMet.GetDescent(),
 aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading );
 if( nDiff > 0 )
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source xmloff/source

2023-11-09 Thread Skyler Grey (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |3 +++
 xmloff/source/text/txtfldi.cxx  |3 +++
 2 files changed, 6 insertions(+)

New commits:
commit 7471de2849e076304b6e59f4d78b83a272f46607
Author: Skyler Grey 
AuthorDate: Thu Nov 9 16:57:50 2023 +
Commit: Miklos Vajna 
CommitDate: Fri Nov 10 08:13:11 2023 +0100

Fix STYLEREF crashes and forwards-compatibility

This commit fixes a crash in STYLEREF caused by a dereferenced nullptr
when serializing chapter fields for .doc export. Along with the STYLEREF
changes, I also changed the chapter export logic to allow exporting
chapter fields when they were in document text, and to use the style of
the thing they pointed to. Unfortunately, in some cases that would be
null. This commit makes us fall back to previous behavior in those
cases.

This commit also adds import logic for styleref on the TEXT namespace in
addition to LO_EXT. This is important as if/when the STYLEREF field is
no longer LO_EXT we want to be able to open new documents in old
versions of libreoffice. This was erroneously missed when we changed
TEXT references to LO_EXT in our export logic.

Change-Id: I383828c9409afc8545af379307f528cee2e1a960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159230
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 62ae243168ec..6e73e9255495 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3430,6 +3430,9 @@ void AttributeOutputBase::TextField( const SwFormatField& 
rField )
 // Otherwise, get the style of the text and use it as the 
style name
 const SwTextNode* pOutlineNd = 
pTextNd->FindOutlineNodeOfLevel(aCopy.GetLevel());
 
+if (!pOutlineNd) break;
+// Sometimes we can't find the outline node, in that case 
let's just fallback to exporting the text
+
 sStr = FieldString(ww::eSTYLEREF)
  + 
GetExport().GetStyleRefName(pOutlineNd->GetFormatColl()->GetName());
 }
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 4b43240878af..07496cb74c05 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -408,6 +408,7 @@ XMLTextFieldImportContext::CreateTextFieldImportContext(
 case XML_ELEMENT(TEXT, XML_BOOKMARK_REF):
 case XML_ELEMENT(TEXT, XML_NOTE_REF):
 case XML_ELEMENT(TEXT, XML_SEQUENCE_REF):
+case XML_ELEMENT(TEXT, XML_STYLE_REF):
 case XML_ELEMENT(LO_EXT, XML_STYLE_REF):
 pContext = new XMLReferenceFieldImportContext( rImport, rHlp, 
nToken );
 break;
@@ -2512,6 +2513,7 @@ void XMLReferenceFieldImportContext::startFastElement(
 case XML_ELEMENT(TEXT, XML_SEQUENCE_REF):
 nSource = ReferenceFieldSource::SEQUENCE_FIELD;
 break;
+case XML_ELEMENT(TEXT, XML_STYLE_REF):
 case XML_ELEMENT(LO_EXT, XML_STYLE_REF):
 nSource = ReferenceFieldSource::STYLE;
 break;
@@ -2593,6 +2595,7 @@ void XMLReferenceFieldImportContext::PrepareField(
 {
 case XML_ELEMENT(TEXT, XML_REFERENCE_REF):
 case XML_ELEMENT(TEXT, XML_BOOKMARK_REF):
+case XML_ELEMENT(TEXT, XML_STYLE_REF):
 case XML_ELEMENT(LO_EXT, XML_STYLE_REF):
 xPropertySet->setPropertyValue("SourceName", Any(sName));
 xPropertySet->setPropertyValue("ReferenceFieldFlags", Any(nFlags));


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source tools/source xmloff/source

2023-11-07 Thread Caolán McNamara (via logerrit)
 sw/source/filter/html/htmlplug.cxx |2 +-
 sw/source/filter/xml/xmltexti.cxx  |2 +-
 tools/source/fsys/urlobj.cxx   |3 ++-
 xmloff/source/draw/ximpshap.cxx|2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 1f5371361875629065a22560e39b9253eb87a23b
Author: Caolán McNamara 
AuthorDate: Sat Nov 4 19:57:51 2023 +
Commit: Miklos Vajna 
CommitDate: Tue Nov 7 14:26:47 2023 +0100

warn about exotic protocols as well

Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158902
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index 1aec184d8a6c..1c1f5f49f13e 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1121,7 +1121,7 @@ void SwHTMLParser::InsertFloatingFrame()
 
 OUString sHRef = aFrameDesc.GetURL().GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
 
-if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro)
+if (INetURLObject(sHRef).IsExoticProtocol())
 NotifyMacroEventRead();
 
 xSet->setPropertyValue("FrameURL", uno::Any( sHRef ) );
diff --git a/sw/source/filter/xml/xmltexti.cxx 
b/sw/source/filter/xml/xmltexti.cxx
index 84fc817c09cd..deef0d9954c4 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -826,7 +826,7 @@ uno::Reference< XPropertySet > 
SwXMLTextImportHelper::createAndInsertFloatingFra
 OUString sHRef = URIHelper::SmartRel2Abs(
 INetURLObject( GetXMLImport().GetBaseURL() ), 
rHRef );
 
-if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro)
+if (INetURLObject(sHRef).IsExoticProtocol())
 GetXMLImport().NotifyMacroEventRead();
 
 xSet->setPropertyValue("FrameURL",
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 2a9f7bc3d7dc..36a8af31a0fb 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -4834,7 +4834,8 @@ bool INetURLObject::IsExoticProtocol() const
 return m_eScheme == INetProtocol::Slot ||
m_eScheme == INetProtocol::Macro ||
m_eScheme == INetProtocol::Uno ||
-   isSchemeEqualTo(u"vnd.sun.star.script");
+   isSchemeEqualTo(u"vnd.sun.star.script") ||
+   isSchemeEqualTo(u"service");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 7f35c67f713b..59eab5ed7fbc 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3181,7 +3181,7 @@ void SdXMLFloatingFrameShapeContext::startFastElement 
(sal_Int32 /*nElement*/,
 
 if( !maHref.isEmpty() )
 {
-if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro)
+if (INetURLObject(maHref).IsExoticProtocol())
 GetImport().NotifyMacroEventRead();
 
 xProps->setPropertyValue("FrameURL", Any(maHref) );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source vcl/jsdialog

2023-11-07 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/shells/textsh.cxx |   71 +++--
 vcl/jsdialog/enabled.cxx   |1 
 2 files changed, 39 insertions(+), 33 deletions(-)

New commits:
commit 355681eead2411d70caf4f52f1b802cf8c61a981
Author: Miklos Vajna 
AuthorDate: Mon Nov 6 14:45:39 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Nov 7 12:58:37 2023 +0100

sw floattable: make Insert Frame dialog async and mark it as a jsdialog

- with this, once a LOK client dispatches .uno:InsertFrame, we don't
  open two dialogs (one tunelled, one jsdialog)

- all the tabpages were already allowed as jsdialogs, the tabpages don't
  open any unwanted file picker (hyperlink browse button, area -> image
  -> import button)

- switching to async means we can't work with the original SfxRequest
  (which is no longer there by the time the callback is invoked), but
  057eca05f23d9d15465e591bd0da671735d62d50 (sc: convert optimal
  width/height and normal width/height dialog to async, 2022-04-12) shows
  we can re-create the SfxRequest after the fact, do the same here

- similar problem with SwFlyFrameAttrMgr, but looks like the
  SwFlyFrameAttrMgr before launching the dialog doesn't share state with
  the SwFlyFrameAttrMgr after the dialog is gone, so work with two
  instances here

(cherry picked from commit 35925357f86e01612df28a092d71b6e216195636)

Change-Id: I97aad336b613d105f380012f8c79e92d89c583ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159053
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index 807ee76859e9..a8d24351cdbf 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -526,51 +526,56 @@ void SwTextShell::ExecInsert(SfxRequest )
 FieldUnit eMetric = ::GetDfltMetric(dynamic_cast( 
GetView().GetDocShell()) != nullptr );
 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< 
sal_uInt16 >(eMetric)));
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateFrameTabDialog("FrameDialog",
+VclPtr 
pDlg(pFact->CreateFrameTabDialog("FrameDialog",
   GetView().GetViewFrame(),
   GetView().GetFrameWeld(),
   aSet));
-if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
-{
-//local variable necessary at least after call of 
.AutoCaption() because this could be deleted at this point
-SwWrtShell& rShell = GetShell();
-rShell.LockPaint(LockPaintReason::InsertFrame);
-rShell.StartAllAction();
-rShell.StartUndo(SwUndoId::INSERT);
+pDlg->StartExecuteAsync([pDlg, nSlot, this](sal_Int32 nResult) {
+if (nResult == RET_OK && pDlg->GetOutputItemSet())
+{
+SwFlyFrameAttrMgr aAttrMgr( true, GetShellPtr(), 
Frmmgr_Type::TEXT, nullptr );
+//local variable necessary at least after call of 
.AutoCaption() because this could be deleted at this point
+SwWrtShell& rShell = GetShell();
+rShell.LockPaint(LockPaintReason::InsertFrame);
+rShell.StartAllAction();
+rShell.StartUndo(SwUndoId::INSERT);
 
-const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
-aMgr.SetAttrSet(*pOutSet);
+const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+aAttrMgr.SetAttrSet(*pOutSet);
 
-// At first delete the selection at the ClickToEditField.
-if( rShell.IsInClickToEdit() )
-rShell.DelRight();
+// At first delete the selection at the ClickToEditField.
+if( rShell.IsInClickToEdit() )
+rShell.DelRight();
 
-aMgr.InsertFlyFrame();
+aAttrMgr.InsertFlyFrame();
 
-uno::Reference< frame::XDispatchRecorder > xRecorder =
-GetView().GetViewFrame()->GetBindings().GetRecorder();
-if ( xRecorder.is() )
-{
-//FN_INSERT_FRAME
-sal_uInt16 nAnchor = 
static_cast(aMgr.GetAnchor());
-rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
-rReq.AppendItem(SfxPointItem(FN_PARAM_1, 
rShell.GetObjAbsPos()));
-rReq.AppendItem(SvxSizeItem(FN_PARAM_2, 
rShell.GetObjSize()));
-rReq.Done();
-}
+uno::Reference< frame::XDispatchRecorder > xRecorder =
+ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-11-07 Thread Miklos Vajna (via logerrit)
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx |7 
+++
 1 file changed, 7 insertions(+)

New commits:
commit 3f44126b00ca7f93c496d863c840004e8beb4945
Author: Miklos Vajna 
AuthorDate: Fri Oct 27 08:11:05 2023 +0200
Commit: Caolán McNamara 
CommitDate: Tue Nov 7 12:37:38 2023 +0100

tdf#99822 sw floattable: allow nomimal overlap of objects from different 
cells

The bugdoc had a table with a single row and 2 columns, both cells had
too wide content. The first column had a too wide chart and the second
column had a too wide (multi-page) floating table.

What happened is that SwTabFrame::Split() wanted to recalc the split
row, and there the overlap detection code pushed down the 2nd shape to
the next page, but that next page only contained the 2nd shape, so the
shifted down shape wanted to go up to its original position and this way
the "format all content lowers" iteration in
SwContentFrame::CalcLowers() never returned.

Fix the problem by limiting the overlap detection to the same uppers,
i.e. in case two floating tables are anchored in the same cell (the
anchors have the same upper) to avoid the overlap, but in case the
anchors have different uppers, then don't worry about this. This seems
to match what Word does.

Regression from commit 5127b1961b762643d47a26704556fd9b8664c6fc (sw
floattable, nesting: add DOCX import, 2023-09-13), the original problem
was already solved by 63007619da7e6c4a6d0c466a8fe54324252be14b
(tdf#144798 DOCX import: handle ZOrder of chart objects, 2021-10-18), it
seems.

(cherry picked from commit 435f1aadf7dd8087a8997924bedfccff0f496ba2)

Change-Id: I21b9f0ae53bbc69d54a9a9f6870580e3a748ba7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159052
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 69951ba08a2c..31802ee4c184 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -1204,6 +1204,7 @@ void SwToContentAnchoredObjectPosition::CalcOverlap(const 
SwTextFrame* pAnchorFr
 
 // Get the list of objects.
 auto pSortedObjs = pAnchorFrameForVertPos->GetDrawObjs();
+const SwLayoutFrame* pAnchorUpper = pAnchorFrameForVertPos->GetUpper();
 
 bool bSplitFly = false;
 SwFlyFrame* pFlyFrame = GetAnchoredObj().DynCastFlyFrame();
@@ -1267,6 +1268,12 @@ void 
SwToContentAnchoredObjectPosition::CalcOverlap(const SwTextFrame* pAnchorFr
 // An inner fly overlapping with its outer fly is fine.
 continue;
 }
+
+if (pAnchoredObjFlyAnchor && pAnchoredObjFlyAnchor->GetUpper() != 
pAnchorUpper)
+{
+// A fly overlapping with a fly from an other upper is fine.
+continue;
+}
 }
 
 css::text::WrapTextMode eWrap = 
pAnchoredObj->GetFrameFormat().GetSurround().GetSurround();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-10-27 Thread Miklos Vajna (via logerrit)
 sw/source/core/layout/tabfrm.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dd5ec1cc8252fba9646cbfbab60b8ef6ef81a36f
Author: Miklos Vajna 
AuthorDate: Wed Oct 25 09:45:05 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Oct 27 11:40:00 2023 +0200

Related: tdf#157590 sw floattable: avoid a bit of not needed work

See

,
we only need to work out if this row has spans in case the row would
split, can skip this otherwise.

(cherry picked from commit d6527f127622f23ac529ce667fac5ff69ea33ea4)

Change-Id: Ic61dade7f42e7e43322e902a1f91d6a62bdc0ed8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158521
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b97536d015c6..06ace548a1a0 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2609,10 +2609,10 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 auto pUpperFly = static_cast(GetUpper());
 bFlySplit = pUpperFly->IsFlySplitAllowed();
 
-if (bFlySplit)
+if (bFlySplit && bTryToSplit)
 {
-// See if this is a nested split fly where the inner 
table also has
-// rowspans.
+// This is a split fly that wants to split the row 
itself. See if it's also
+// nested. If so, we'll want to know if the row split 
has rowspans.
 SwTextFrame* pAnchorCharFrame = 
pUpperFly->FindAnchorCharFrame();
 if (pAnchorCharFrame && pAnchorCharFrame->IsInFly())
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-10-27 Thread Attila Szűcs (via logerrit)
 sw/source/core/doc/docredln.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ff767b645077c1b10dc541ee2a202ff94446f604
Author: Attila Szűcs 
AuthorDate: Thu Oct 26 23:11:03 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Oct 27 10:15:18 2023 +0200

tdf#157662 SW: fix connected area calculation

Reset pRedline to its origin value between the 2 loops,
because the 1. loop may change it.

without this fix, if it discover neightbours in the 1. direction,
it will not discover them in the other direction.

Change-Id: Ia1ab357ada17cb7574907a3aa1bf0dd4d7a90255
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158517
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 4d3493515d6a..c5a6b6885a71 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -811,6 +811,7 @@ void SwRedlineTable::getConnectedArea(size_type nPosOrigin, 
size_type& rPosStart
 rPosStart--;
 pRedline = pOther;
 }
+pRedline = pOrigin;
 while (rPosEnd + 1 < size() && (pOther = (*this)[rPosEnd + 1])
&& lcl_CanCombineWithRange(pOrigin, pRedline, pOther, false, 
bCheckChilds))
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-10-26 Thread Attila Szűcs (via logerrit)
 sw/source/uibase/misc/redlndlg.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6c3cf5c000ce8c1e82bd834995d1ee52f8c2baeb
Author: Attila Szűcs 
AuthorDate: Wed Oct 25 13:09:22 2023 +0200
Commit: Caolán McNamara 
CommitDate: Thu Oct 26 09:32:18 2023 +0200

SW: small fix for manage changes dialog.

Fixed a continue, as it was planned to effect the outer loop.
(probably when it was replaced to an inner loop it was forgot to handle)

fixed a nullptr check also.

These problems may not result real problem right now,
but when interdependedt redlines will be improved,
they will result in problems.

Change-Id: Ie139f9a657abbacea9450176d2fe138392beddfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158457
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index de5310de0311..401998451fc4 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -434,13 +434,16 @@ void SwRedlineAcceptDlg::Activate()
 {
 while (pRedlineData)
 {
-if (pRedlineData != pBackupData->pChild)
+if (!pBackupData || pRedlineData != pBackupData->pChild)
 {
 // Redline-Children were inserted, changed or deleted
 i = CalcDiff(i, true);
 if (i == SwRedlineTable::npos)
 return;
-continue;
+
+// here was a continue; targetted to the outer loop
+// now a break will do, as there is nothing after it in 
the outer loop
+break;
 }
 pBackupData = pBackupData->pNext;
 pRedlineData = pRedlineData->Next();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-10-26 Thread Attila Szűcs (via logerrit)
 sw/source/core/doc/docredln.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 94d578ea6009cfc44cc512171fd453bb0286888b
Author: Attila Szűcs 
AuthorDate: Wed Oct 25 11:40:23 2023 +0200
Commit: Caolán McNamara 
CommitDate: Thu Oct 26 09:30:11 2023 +0200

tdf#157663 SW: reenable move recognition improvements

Re-enabled the improvement of move recognition in redlines, that
is able to recognize movements split into more redlines.

Probably it does not effect performance too much, but if in some cases
it would become a problem then this small patch can be reverted easily.

Change-Id: I6598d4d4f98f472f3972aec41b82ec26d90db860
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158455
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 95498d625c90..4d3493515d6a 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -873,11 +873,7 @@ bool SwRedlineTable::isMoved(size_type rPos) const
 if (isMovedImpl(rPos, false))
 return true;
 else
-{
-// Commented out because of probably performance issue
-//return isMovedImpl(rPos, true);
-return false;
-}
+return isMovedImpl(rPos, true);
 }
 
 bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const
@@ -947,7 +943,7 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 size_type nStart = rPos > nLookahead ? rPos - nLookahead : 0;
 // first, try to compare to single redlines
 // next, try to compare to combined redlines
-for (int nPass = 0; nPass < (bTryCombined ? 2 : 1) && !bRet; nPass++)
+for (int nPass = 0; nPass < 2 && !bRet; nPass++)
 {
 for (size_type nPosAct = nStart; nPosAct < nEnd && !bRet; ++nPosAct)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source sw/uiconfig

2023-10-25 Thread Skyler Grey (via logerrit)
 sw/source/core/fields/reffld.cxx |   21 +
 sw/uiconfig/swriter/ui/fldrefpage.ui |2 +-
 2 files changed, 6 insertions(+), 17 deletions(-)

New commits:
commit 60c111838da81697a49b3011eebe8b1e05ad08bb
Author: Skyler Grey 
AuthorDate: Tue Oct 24 10:19:52 2023 +
Commit: Skyler Grey 
CommitDate: Wed Oct 25 16:36:51 2023 +0200

Improve STYLE_FROM_BOTTOM compatability with Word

From my testing in Word, it doesn't honor the "search from bottom" flag
when it is in the body, only in marginals. Additionally, it doesn't
continue searching in the opposite order if the referenced content is
not found on the current page, instead it searches in the same order as
it would normally (i.e. pages above then pages below). This commit
changes the behavior and UI of our from bottom flag to match.

Change-Id: Id991c92b9aeaa054b136f7a3d9c7c8ea0026e514
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158382
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 3a7bc4ae4e70..1f8aae4e3506 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1385,8 +1385,6 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 case REF_STYLE:
 if (!pSelf) break;
 
-bool bFlagFromBottom = (nFlags & REFFLDFLAG_STYLE_FROM_BOTTOM) == 
REFFLDFLAG_STYLE_FROM_BOTTOM;
-
 const SwNodes& nodes = pDoc->GetNodes();
 
 StyleRefElementType elementType = StyleRefElementType::Default;
@@ -1435,6 +1433,8 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 // For marginals, styleref tries to act on the current 
page first
 // 1. Get the page we're on, search it from top to bottom
 
+bool bFlagFromBottom = (nFlags & 
REFFLDFLAG_STYLE_FROM_BOTTOM) == REFFLDFLAG_STYLE_FROM_BOTTOM;
+
 Point aPt;
 std::pair const tmp(aPt, false);
 
@@ -1500,10 +1500,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 
 if (beforeStart)
 {
-if (bFlagFromBottom)
-pSearchThird.push_front(nodes[n]);
-else
-pSearchSecond.push_front(nodes[n]);
+pSearchSecond.push_front(nodes[n]);
 }
 else if (beforeEnd)
 {
@@ -1517,8 +1514,6 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 beforeEnd = false;
 }
 }
-else if (bFlagFromBottom)
-pSearchSecond.push_back(nodes[n]);
 else
 pSearchThird.push_back(nodes[n]);
 }
@@ -1580,20 +1575,14 @@ SwTextNode* SwGetRefFieldType::FindAnchor(SwDoc* pDoc, 
const OUString& rRefMark,
 {
 if (beforeElement)
 {
-if (bFlagFromBottom)
-pSearchSecond.push_front(nodes[n]);
-else
-pSearchFirst.push_front(nodes[n]);
+pSearchFirst.push_front(nodes[n]);
 
 if (*pReference == *nodes[n])
 {
 beforeElement = false;
 }
 }
-else if (bFlagFromBottom)
-pSearchFirst.push_back(nodes[n]);
-else
-pSearchSecond.push_back(nodes[n]);
+pSearchSecond.push_back(nodes[n]);
 }
 
 // 1. Search up until we hit the top of the document
diff --git a/sw/uiconfig/swriter/ui/fldrefpage.ui 
b/sw/uiconfig/swriter/ui/fldrefpage.ui
index 635cbb35fb41..8592211ef10e 100644
--- a/sw/uiconfig/swriter/ui/fldrefpage.ui
+++ b/sw/uiconfig/swriter/ui/fldrefpage.ui
@@ -201,7 +201,7 @@
 top
 
   
-Search from bottom to top
+Search this page from bottom to 
top
 True
 True
 False


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-09-29 Thread Miklos Vajna (via logerrit)
 sw/source/core/layout/fly.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dba206bd9b7e219cd8531641c6ff6c158446b2c2
Author: Miklos Vajna 
AuthorDate: Thu Sep 28 09:03:27 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Sep 29 14:48:41 2023 +0200

sw floattable: maintain the invariant that fly height is at least MINFLY

Fixes these warnings on loading 
sw/qa/core/layout/data/floattable-in-inlinetable.docx:

warn:legacy.osl:6908:6908:sw/source/core/layout/flylay.cxx:703: 
 - fly frame has negative height now.
warn:legacy.osl:6908:6908:sw/source/core/layout/flylay.cxx:295: 
SwFlyFreeFrame::Format(), flipping Fly.

(cherry picked from commit 25b8fdd3b939a221ba00ca37fbf89adaf893aab7)

Change-Id: I20d01e3289ea597a5b5f4ee43a5e1b892a618648
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157394
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index c3db26950461..e0b9d1837e67 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1442,7 +1442,7 @@ void SwFlyFrame::Format( vcl::RenderContext* 
/*pRenderContext*/, const SwBorderA
 SwTwips nDeadline = GetFlyAnchorBottom(this, *pAnchor);
 SwTwips nTop = aRectFnSet.GetTop(getFrameArea());
 SwTwips nBottom = aRectFnSet.GetTop(getFrameArea()) + 
nRemaining;
-if (nBottom > nDeadline)
+if (nBottom > nDeadline && nDeadline > nTop)
 {
 nRemaining = nDeadline - nTop;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-09-25 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/shells/textfld.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 6c39caedbe08f44683f14eabae4e96c3642c4e44
Author: Miklos Vajna 
AuthorDate: Fri Sep 22 15:40:17 2023 +0200
Commit: Caolán McNamara 
CommitDate: Mon Sep 25 09:52:25 2023 +0200

sw: fix crash in SwTextShell::ExecField()

Crashreport signature:

Fatal signal received: SIGSEGV code: 128 for address: 0x0

program/libswlo.so
SwTextShell::ExecField(SfxRequest&)
sw/source/uibase/shells/textfld.cxx:456
program/libmergedlo.so
SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, 
bool)
sfx2/source/control/dispatch.cxx:257
program/libmergedlo.so
SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet 
const*, SfxItemSet const*, unsigned short)
sfx2/source/control/dispatch.cxx:814
program/libmergedlo.so
SfxDispatchController_Impl::dispatch(com::sun::star::util::URL 
const&, com::sun::star::uno::Sequence 
const&, 
com::sun::star::uno::Reference 
const&)
sfx2/source/control/unoctitm.cxx:682

Change-Id: I359f9ee643daff9acfb67800e38666cce060c0b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157171
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index b0603d4eed96..9a5d1ac5ee73 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -452,13 +452,17 @@ void SwTextShell::ExecField(SfxRequest )
 pMgr->RegisterAnswerText(sText);
 pWin->ExecuteCommand(nSlot);
 
-// Set the parent postit id of the reply.
-
GetView().GetPostItMgr()->GetLatestPostItField()->SetParentPostItId(pIdItem->GetValue().toUInt32());
+SwPostItField* pLatestPostItField = 
pMgr->GetLatestPostItField();
+if (pLatestPostItField)
+{
+// Set the parent postit id of the reply.
+
pLatestPostItField->SetParentPostItId(pIdItem->GetValue().toUInt32());
 
-// If name of the replied comment is empty, we need to 
set a name in order to connect them in the xml file.
-pWin->GeneratePostItName(); // Generates a name if the 
current name is empty.
+// If name of the replied comment is empty, we 
need to set a name in order to connect them in the xml file.
+pWin->GeneratePostItName(); // Generates a name if 
the current name is empty.
 
-
GetView().GetPostItMgr()->GetLatestPostItField()->SetParentName(pWin->GetPostItField()->GetName());
+
pLatestPostItField->SetParentName(pWin->GetPostItField()->GetName());
+}
 }
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-09-22 Thread Michael Stahl (via logerrit)
 sw/source/filter/ww8/wrtw8sty.cxx |   10 ++
 sw/source/filter/ww8/wrtww8.hxx   |2 ++
 sw/source/filter/ww8/ww8atr.cxx   |   13 ++---
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 493bca76c7cd8a4581deb2e930cb3b196a78acc6
Author: Michael Stahl 
AuthorDate: Tue Feb 7 14:17:11 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Sep 22 14:57:59 2023 +0200

tdf#153083 writerfilter,sw: DOCX locale-dependent TOC \t style names, 3

The import crashed on fdo85740-1.docx with an unhandled exception.

This is because it mapped the TOC style "Table of Figures" from "table
of figures", but the ApplyStyleSheetsImpl() actually uses the converted
name "Drawing" instead, so "Table of Figures" didn't exist.

(regression from commit ca71482237d31703454062b8b2f544a8bacd2831)

It turns out that once that is fixed, the DOCX export needs to convert
"Drawing" back to "Table of Figures" in the TOC field.

(cherry picked from commit 345f23474845da0defa4a9276228f54b5ded5736)

Conflicts:
writerfilter/source/dmapper/DomainMapper_Impl.cxx
writerfilter/source/dmapper/StyleSheetTable.cxx

[ Miklos: this is the DOC filter part, as that was not cherry-picked
originally. ]

Change-Id: I4858c79dd74154b229b7568610c0b8ba7b3e2b6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157170
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index ab72b5f1cc15..1bf5c89078e1 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -471,6 +471,16 @@ OString const & MSWordStyles::GetStyleId(sal_uInt16 nSlot) 
const
 return m_aStyles[nSlot].style_id;
 }
 
+OUString MSWordStyles::GetStyleWWName(SwFormat const*const pFormat) const
+{
+if (auto slot = m_rExport.m_pStyles->GetSlot(pFormat); slot != 0xfff)
+{
+assert(!m_aStyles[slot].ww_name.isEmpty());
+return m_aStyles[slot].ww_name;
+}
+return OUString();
+}
+
 /// For WW8 only - extend pO so that the size of pTableStrm is even.
 static void impl_SkipOdd(std::unique_ptr const& pO, std::size_t 
nTableStrmTell)
 {
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index c7c22ea52320..7f20ed491bc2 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1645,6 +1645,8 @@ public:
 
 /// Get styleId of the nSlot-th style (nSlot is its position in m_aStyles).
 OString const & GetStyleId(sal_uInt16 nSlot) const;
+/// the awful TOC field references names, not styleIds
+OUString GetStyleWWName(SwFormat const* pFormat) const;
 
 const SwFormat* GetSwFormat(sal_uInt16 nSlot) const { return 
m_aStyles[nSlot].format; }
 /// Get numbering rule of the nSlot-th style
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 32bbe12fb5f2..9a561c05dac6 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2404,7 +2404,11 @@ void AttributeOutputBase::StartTOX( const SwSection& 
rSect )
 SwTextFormatColl const*const pColl = 
GetExport().m_rDoc.FindTextFormatCollByName(rStyle);
 if (pColl)
 {
-sStr += "\\t \"" + rStyle + sEntryEnd;
+OUString const 
converted(GetExport().m_pStyles->GetStyleWWName(pColl));
+if (!converted.isEmpty())
+{
+sStr += "\\t \"" + converted + sEntryEnd;
+}
 }
 }
 break;
@@ -2553,11 +2557,14 @@ void AttributeOutputBase::StartTOX( const SwSection& 
rSect )
 SwTextFormatColl* pColl = 
GetExport().m_rDoc.FindTextFormatCollByName(sStyle);
 if (pColl)
 {
-if 
(!pColl->IsAssignedToListLevelOfOutlineStyle() || 
pColl->GetAssignedOutlineStyleLevel() < nTOXLvl)
+OUString const 
converted(GetExport().m_pStyles->GetStyleWWName(pColl));
+if (!converted.isEmpty() &&
+
(!pColl->IsAssignedToListLevelOfOutlineStyle()
+ || 
pColl->GetAssignedOutlineStyleLevel() < nTOXLvl))
 {
 if( !sTOption.isEmpty() )
 sTOption += tsep;
-sTOption += sStyle + sLvl;
+sTOption += converted + sLvl;
   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source writerfilter/qa writerfilter/source

2023-09-14 Thread Miklos Vajna (via logerrit)
 sw/source/core/layout/flycnt.cxx  |7 +-
 writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx |   27 
++
 writerfilter/qa/cppunittests/dmapper/data/floattable-nested.docx  |binary
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx  |8 --
 4 files changed, 33 insertions(+), 9 deletions(-)

New commits:
commit 3b96641c556dc240d5118825e3f0277ed870bf64
Author: Miklos Vajna 
AuthorDate: Wed Sep 13 08:14:19 2023 +0200
Commit: Caolán McNamara 
CommitDate: Thu Sep 14 10:19:36 2023 +0200

sw floattable, nesting: add DOCX import

There were two problems here:

1) writerfilter/ didn't even try allowing split floating tables for the
   inner case, because layout didn't support that previously.

2) CppunitTest_writerfilter_dmapper's test3NestedFloatingTables crashed
   because we expected that in case a fly+table is not toplevel, then
   the parent is also a fly+table frame, but in this case the parent was
   just a table frame.

   Fix this by checking for a table parent instead of a fly parent when
   deciding if we handle the split as a nested case or a toplevel one.

(cherry picked from commit 5127b1961b762643d47a26704556fd9b8664c6fc)

Change-Id: I4c58636ef80371b8ec51a96fe436fa6379c795d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156905
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 310526d39944..13388e378867 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1611,10 +1611,11 @@ SwLayoutFrame *SwFrame::GetNextFlyLeaf( MakePageType 
eMakePage )
 }
 }
 
-if (bLeftFly && pFlyAnchor && pFlyAnchor->IsInFly()
-&& FindFlyFrame() == pLayLeaf->FindFlyFrame())
+if (bLeftFly && pFlyAnchor && pFlyAnchor->IsInTab()
+&& FindTabFrame() == pLayLeaf->FindTabFrame())
 {
-// This is an inner fly, then the follow anchor will be just 
next to us.
+// This is an inner fly (parent is an inline or a floating 
table), then the follow
+// anchor will be just next to us.
 SwLayoutFrame* pFlyAnchorUpper = pFlyAnchor->GetUpper();
 pOldLayLeaf = pLayLeaf;
 pLayLeaf = pFlyAnchorUpper;
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx
index 8c11e3db22c7..fa1567c5a577 100644
--- a/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/DomainMapperTableHandler.cxx
@@ -133,6 +133,33 @@ CPPUNIT_TEST_FIXTURE(Test, 
testDOCXFloatingTableHiddenAnchor)
 // hidden.
 CPPUNIT_ASSERT(!bCharHidden);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDOCXFloatingTableNested)
+{
+// Given a document with nested, multi-page floating tables:
+// When loading that document:
+loadFromURL(u"floattable-nested.docx");
+
+// Then make sure that both floating tables are allowed to split:
+uno::Reference xFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xFrames(xFramesSupplier->getTextFrames(),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xFrames->getCount());
+// Outer frame:
+uno::Reference xFrame1;
+xFrames->getByIndex(0) >>= xFrame1;
+bool bIsSplitAllowed = false;
+xFrame1->getPropertyValue("IsSplitAllowed") >>= bIsSplitAllowed;
+CPPUNIT_ASSERT(bIsSplitAllowed);
+// Inner frame:
+uno::Reference xFrame2;
+xFrames->getByIndex(1) >>= xFrame2;
+bIsSplitAllowed = false;
+xFrame2->getPropertyValue("IsSplitAllowed") >>= bIsSplitAllowed;
+// Without the accompanying fix in place, this test would have failed, the 
inner frame could not
+// split.
+CPPUNIT_ASSERT(bIsSplitAllowed);
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/qa/cppunittests/dmapper/data/floattable-nested.docx 
b/writerfilter/qa/cppunittests/dmapper/data/floattable-nested.docx
new file mode 100644
index ..655e6c0e0bad
Binary files /dev/null and 
b/writerfilter/qa/cppunittests/dmapper/data/floattable-nested.docx differ
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 44749e7b124f..fdad7aba4011 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1590,12 +1590,8 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 comphelper::makePropertyValue("IsFollowingTextFlow", 
true));
 }
 
-if (nestedTableLevel <= 1)
-{
-  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-09-08 Thread Gökay Şatır (via logerrit)
 sw/source/uibase/docvw/AnnotationMenuButton.cxx |   28 ++--
 1 file changed, 3 insertions(+), 25 deletions(-)

New commits:
commit e653ddd24ab4b75db212431461035ecbd9d625fa
Author: Gökay Şatır 
AuthorDate: Thu Sep 7 11:22:25 2023 +0300
Commit: Miklos Vajna 
CommitDate: Fri Sep 8 10:41:50 2023 +0200

We can allow one to answer their own comment.

Other office implementations allow this.

I think we can enable reply button for the owner of the comment, unless 
there is a good reason to not to.

Signed-off-by: Gökay Şatır 
Change-Id: I6969122efe24d2804b4092e0afe0709a2fd1ef98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156688
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx 
b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 1696f7e6d338..11d755cbd7e2 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -66,13 +66,11 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, 
weld::Toggleable&, void)
 if (!mxMenuButton->get_active())
 return;
 
-bool bReplyVis = true;
-
 bool bReadOnly = IsReadOnly();
 if (bReadOnly)
 {
 mxMenuButton->set_item_visible("reply", false);
-bReplyVis = false;
+mxMenuButton->set_item_visible("sep1", false); // Separator after 
reply button.
 mxMenuButton->set_item_visible("resolve", false);
 mxMenuButton->set_item_visible("unresolve", false);
 mxMenuButton->set_item_visible("resolvethread", false);
@@ -81,6 +79,8 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, 
weld::Toggleable&, void)
 }
 else
 {
+mxMenuButton->set_item_visible("reply", !IsProtected());
+mxMenuButton->set_item_visible("sep1", !IsProtected());
 mxMenuButton->set_item_visible("resolve", !IsResolved());
 mxMenuButton->set_item_visible("unresolve", IsResolved());
 mxMenuButton->set_item_visible("resolvethread", !IsThreadResolved());
@@ -92,28 +92,6 @@ IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, 
weld::Toggleable&, void)
 mxMenuButton->set_item_visible("deleteby", !bReadOnly);
 mxMenuButton->set_item_visible("deleteall", !bReadOnly);
 mxMenuButton->set_item_visible("formatall", !bReadOnly);
-
-if (IsProtected())
-{
-mxMenuButton->set_item_visible("reply", false);
-bReplyVis = false;
-}
-else
-{
-SvtUserOptions aUserOpt;
-OUString sAuthor;
-if ((sAuthor = aUserOpt.GetFullName()).isEmpty())
-{
-if ((sAuthor = aUserOpt.GetID()).isEmpty())
-{
-sAuthor = SwResId(STR_REDLINE_UNKNOWN_AUTHOR);
-}
-}
-// do not allow to reply to ourself and no answer possible if this 
note is in a protected section
-bReplyVis = sAuthor != GetAuthor();
-mxMenuButton->set_item_visible("reply", bReplyVis);
-}
-mxMenuButton->set_item_visible("sep1", bReplyVis);
 }
 
 IMPL_LINK(SwAnnotationWin, KeyInputHdl, const KeyEvent&, rKeyEvt, bool)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-30 Thread Pranam Lashkari (via logerrit)
 sw/source/uibase/utlui/content.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 1fca94be7fafc305cf02c0134fbc2d7e5cfb2a03
Author: Pranam Lashkari 
AuthorDate: Tue Aug 29 17:37:38 2023 +0800
Commit: Pranam Lashkari 
CommitDate: Wed Aug 30 12:54:05 2023 +0200

LOK: update navigator instantly on heading level change

problem:
i.e: when you change the header level,
it was not reflected instantly in navigator and required reopening it.
That was due to header level change was not registed as change in LOK case

Change-Id: I503eb6a3fe9d2801ea5b45b0a1096e8174360ddc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156239
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Attila Szűcs 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index c837124b723c..03d46e4a8cc2 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2991,18 +2991,24 @@ bool SwContentTree::HasContentChanged()
 // In case of LOK, empty contentTypes are hidden, even in all 
content view
 // so it is not enough to check only the m_xTreeView.
 bool bCountChanged = false;
+bool bHasContentChanged = false;
 for (ContentTypeId i : o3tl::enumrange())
 {
 if (m_aActiveContentArr[i])
 {
 auto nLastTMCount = 
m_aActiveContentArr[i]->GetMemberCount();
-m_aActiveContentArr[i]->FillMemberList();
+if (i == ContentTypeId::OUTLINE) // this is required for 
checking if header level is changed
+
m_aActiveContentArr[i]->FillMemberList();
+else
+m_aActiveContentArr[i]->FillMemberList();
 // If the member count of a type is changed, then the 
content is surely changed
 if (m_aActiveContentArr[i]->GetMemberCount() != 
nLastTMCount)
 bCountChanged = true;
+if (bHasContentChanged)
+bContentChanged = true;
 }
 }
-if (bCountChanged)
+if (bCountChanged || bContentChanged)
 return true;
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-28 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/paintfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 17e61679dfc0dc3fd6cb1ff685f8bbf7b4cdbd91
Author: Caolán McNamara 
AuthorDate: Fri Aug 25 09:54:28 2023 +0100
Commit: Andras Timar 
CommitDate: Mon Aug 28 21:44:29 2023 +0200

crash case seen on clicking on drawing text box inside a footer

Change-Id: Id7645ad651d237c94fecb2fc2b6c57a88f3caa55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156001
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index ac9389e03277..4c5f1bf11489 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7116,7 +7116,8 @@ std::vector 
SwPageFrame::GetSubsidiaryLinesPolygons(const S
 pLay = pLay->GetNext();
 }
 
-assert(pPageBody && "presumably this is impossible");
+if (!pPageBody)
+return aPolygons;
 
 SwRect aArea( pPageBody->getFrameArea() );
 if ( pFootnoteCont )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-17 Thread Attila Szűcs (via logerrit)
 sw/source/uibase/utlui/navipi.cxx |   21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

New commits:
commit a4d6f4183ba76c3d03312a9ed16f286e60e3a7c5
Author: Attila Szűcs 
AuthorDate: Mon Aug 7 04:00:39 2023 +0200
Commit: Caolán McNamara 
CommitDate: Thu Aug 17 15:07:48 2023 +0200

SW: LOK: crashfix for ios navigator

Added conditions to check if m_pNavigateByComboBox
exist, because on ios, navigator does not have
thit combobox.

Change-Id: If5411a1687338caaa9fd76ae5471be4648ab61de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155388
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit c6250e82472f0d36c0c0c4b33c76882c94da8170)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155771
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 0f6d2ac78923..bd53813ac64b 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -132,6 +132,8 @@ IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, 
weld::ComboBox&, rBox, void)
 
 void SwNavigationPI::UpdateNavigateBy()
 {
+if (!m_pNavigateByComboBox)
+return;
 SfxUInt32Item aParam(FN_NAV_ELEMENT, 
m_pNavigateByComboBox->get_active_id().toUInt32());
 const SfxPoolItem* aArgs[2];
 aArgs[0] = 
@@ -543,8 +545,17 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement");
 NavElementToolBoxControl* pToolBoxControl =
 dynamic_cast(xController.get());
-assert(pToolBoxControl);
-m_pNavigateByComboBox = pToolBoxControl->GetComboBox();
+
+// In case of LOK, the xController may not a NavElementToolBoxControl
+if (comphelper::LibreOfficeKit::isActive() && !pToolBoxControl)
+{
+m_pNavigateByComboBox = nullptr;
+}
+else
+{
+assert(pToolBoxControl);
+m_pNavigateByComboBox = pToolBoxControl->GetComboBox();
+}
 
 // Restore content tree settings before calling UpdateInitShow. 
UpdateInitShow calls Fillbox,
 // which calls Display and UpdateTracking. Incorrect outline levels could 
be displayed and
@@ -652,7 +663,9 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, 
GlobalMenuSelectHdl));
 m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, 
ToolBoxClickHdl));
 m_xGlobalToolBox->set_item_active("globaltoggle", true);
-m_pNavigateByComboBox->connect_changed(LINK(this, SwNavigationPI, 
NavigateByComboBoxSelectHdl));
+if (m_pNavigateByComboBox)
+m_pNavigateByComboBox->connect_changed(
+LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl));
 
 //  set toolbar of both modes to widest of each
 
m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width()
 +
@@ -1138,6 +1151,8 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, 
void)
 
 void SwNavigationPI::SelectNavigateByContentType(const OUString& 
rContentTypeName)
 {
+if (!m_pNavigateByComboBox)
+return;
 if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos 
!= -1)
 {
 m_pNavigateByComboBox->set_active(nPos);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-14 Thread Miklos Vajna (via logerrit)
 sw/source/filter/ww8/ww8par.hxx  |   15 ---
 sw/source/filter/ww8/ww8par2.cxx |   10 +-
 sw/source/filter/ww8/ww8par6.cxx |4 ++--
 3 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 0ee831e39e44c0df1fff7c344bf0c9393ce57734
Author: Miklos Vajna 
AuthorDate: Thu Aug 10 13:46:04 2023 +0200
Commit: Caolán McNamara 
CommitDate: Mon Aug 14 10:55:58 2023 +0200

sw: improve naming of ApoTestResults members

- Sp29 -> PPc or TPc (paragraph or table position code)
- Sp37 -> PWr (paragraph wrap)

(cherry picked from commit d7cd82948a4afe0f2049acaf68890d22f14e4396)

Conflicts:
sw/source/filter/ww8/ww8par2.cxx

Change-Id: I49400cc325e9981586490f5221a6a5f5d59c0084
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155651
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 94baf8c186c3..41695a70481a 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -216,7 +216,7 @@ struct WW8FlyPara
 WW8FlyPara(bool bIsVer67, const WW8FlyPara* pSrc = nullptr);
 bool operator==(const WW8FlyPara& rSrc) const;
 void Read(sal_uInt8 nSprmTPc, WW8PLCFx_Cp_FKP* pPap);
-void ReadFull(sal_uInt8 nSprm29, SwWW8ImplReader* pIo);
+void ReadFull(sal_uInt8 nOrigSprmTPc, SwWW8ImplReader* pIo);
 void Read(sal_uInt8 nSprmTPc, WW8RStyle const * pStyle);
 void ApplyTabPos(const WW8_TablePos *pTabPos);
 bool IsEmpty() const;
@@ -1006,15 +1006,16 @@ struct ApoTestResults
 {
 bool mbStartApo;
 bool mbStopApo;
-bool m_bHasSprm37;
-bool m_bHasSprm29;
-sal_uInt8 m_nSprm29;
+bool m_bHasSprmPWr;
+bool m_bHasSprmPPc;
+/// sprmPPc if m_bHasSprmPPc is true, sprmTPc otherwise.
+sal_uInt8 m_nSprmPPc;
 WW8FlyPara* mpStyleApo;
 ApoTestResults()
-: mbStartApo(false), mbStopApo(false), m_bHasSprm37(false)
-, m_bHasSprm29(false), m_nSprm29(0), mpStyleApo(nullptr) {}
+: mbStartApo(false), mbStopApo(false), m_bHasSprmPWr(false)
+, m_bHasSprmPPc(false), m_nSprmPPc(0), mpStyleApo(nullptr) {}
 bool HasStartStop() const { return (mbStartApo || mbStopApo); }
-bool HasFrame() const { return (m_bHasSprm29 || m_bHasSprm37 || 
mpStyleApo); }
+bool HasFrame() const { return (m_bHasSprmPPc || m_bHasSprmPWr || 
mpStyleApo); }
 };
 
 struct ANLDRuleMap
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 863ca7d6370b..d73b02dbb208 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -455,11 +455,11 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, 
bool bTableRowEnd,
 to see if we are still in that frame.
 */
 
-aRet.m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm 
!= nullptr;
-SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
-const sal_uInt8 *pSrpm29 = aSrpm29.pSprm;
-aRet.m_bHasSprm29 = pSrpm29 != nullptr;
-aRet.m_nSprm29 = (pSrpm29 && aSrpm29.nRemainingData >= 1) ? *pSrpm29 : 0;
+aRet.m_bHasSprmPWr = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm 
!= nullptr;
+SprmResult aSrpmPPc = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
+const sal_uInt8 *pSrpmPPc = aSrpmPPc.pSprm;
+aRet.m_bHasSprmPPc = pSrpmPPc != nullptr;
+aRet.m_nSprmPPc = (pSrpmPPc && aSrpmPPc.nRemainingData >= 1) ? *pSrpmPPc : 
0;
 
 // Is there some frame data here
 bool bNowApo = aRet.HasFrame() || pTopLevelTable;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index a863c048e53a..299e06461c36 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2419,7 +2419,7 @@ std::unique_ptr 
SwWW8ImplReader::ConstructApo(const ApoTestResults &
 
 // find APO parameter and test for bGrafApo
 if (rApo.HasFrame())
-pRet->ReadFull(rApo.m_nSprm29, this);
+pRet->ReadFull(rApo.m_nSprmPPc, this);
 
 pRet->ApplyTabPos(pTabPos);
 
@@ -2809,7 +2809,7 @@ bool SwWW8ImplReader::TestSameApo(const ApoTestResults 
,
 WW8FlyPara aF(m_bVer67, rApo.mpStyleApo);
 // WWPara for current para
 if (rApo.HasFrame())
-aF.Read(rApo.m_nSprm29, m_xPlcxMan->GetPapPLCF());
+aF.Read(rApo.m_nSprmPPc, m_xPlcxMan->GetPapPLCF());
 aF.ApplyTabPos(pTabPos);
 
 return aF == *m_xWFlyPara;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-09 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/itrcrsr.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8ac6428e4805cc34683595c4d239f0688e0ea9bf
Author: Mike Kaganski 
AuthorDate: Wed Aug 9 20:15:51 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 10 06:53:36 2023 +0200

tdf#120715: handle LOK case

Commit 690d4eb71509649ad147cfe60f5b97e2cfaaa519 fixed the two problems
of wrong paragraph mark position and wrong cursor position, calling
AddExtraBlankWidth from SwTextPainter::DrawTextLine. Since this function
is called before calculating cursor position in desktop case, this fixed
them both: SwCursorShell::EndAction calls SwViewShell::EndAction before
UpdateCursor; the former calls ImplEndAction, and in it, PaintSwFrame is
called when not in LOK mode.

But in LOK mode, PaintSwFrame is not called until SwViewShell::PaintTile
runs in a later request; thus, UpdateCursor operated on unadjusted data.
The cursor position arrived wrong, but the paragraph mark was painted OK
when tiles were rendered.

To avoid dependency on the call order, also call AddExtraBlankWidth from
SwTextCursor::GetCharRect, which is called inside UpdateCursor.

Change-Id: I0984d7c6235a7f2573f9fa8b7ed0cefee5747658
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155531
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 4aa3cfda7a6007867eba922a1b549471cbced425)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155479
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 47befa14d008..3f0ed590cae1 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1251,6 +1251,7 @@ void SwTextCursor::GetCharRect( SwRect* pOrig, 
TextFrameIndex const nOfst,
 
 // If necessary, as catch up, do the adjustment
 GetAdjusted();
+AddExtraBlankWidth();
 
 const Point aCharPos( GetTopLeft() );
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-03 Thread Miklos Vajna (via logerrit)
 sw/source/core/unocore/unoobj2.cxx |   14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 2930d1b9c4e58cfb8c8de775b0370a46b7d953e5
Author: Miklos Vajna 
AuthorDate: Wed Aug 2 11:58:29 2023 +0200
Commit: Caolán McNamara 
CommitDate: Thu Aug 3 14:04:44 2023 +0200

sw floattable: simplify collecting frames at node with layout

See

,
one dynamic cast is enough.

(cherry picked from commit f151ba5ebc8662d5459eacb1c5d6f01a4c826f26)

Change-Id: I1f57b1b64fb501e522c949e013160df79ea55094
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155279
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index beed66fe5eec..7fcb1255f1cf 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -127,16 +127,12 @@ struct FrameClientSortListLess
 
 if (nAnchorType == RndStdIds::FLY_AT_PARA)
 {
-SwFlyFrame* pFly = pAnchoredObj->DynCastFlyFrame();
-if (pFly)
+auto pFlyAtContentFrame = 
dynamic_cast(pAnchoredObj);
+if (pFlyAtContentFrame && pFlyAtContentFrame->IsFollow())
 {
-auto pFlyAtContentFrame = pFly->DynCastFlyAtContentFrame();
-if (pFlyAtContentFrame && pFlyAtContentFrame->IsFollow())
-{
-// We're collecting frame formats, ignore non-master 
fly frames to prevent
-// duplication.
-continue;
-}
+// We're collecting frame formats, ignore non-master fly 
frames to prevent
+// duplication.
+continue;
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/source/core/unocore/unostyle.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 358f0313846da3b41aaea87be6fe0b286a25cef1
Author: Miklos Vajna 
AuthorDate: Tue Aug 1 09:18:13 2023 +0200
Commit: Andras Timar 
CommitDate: Tue Aug 1 10:20:28 2023 +0200

sw: fix build

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx: 
In member function ‘virtual 
com::sun::star::uno::Sequence 
{anonymous}::SwXStyle::getPropertyStates(const 
com::sun::star::uno::Sequence&)’:

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx:2554:30:
 error: ‘SfxStyleFamily {anonymous}::StyleFamilyEntry::m_eFamily’ is private 
within this context
 if (m_rEntry.m_eFamily == SfxStyleFamily::Frame
  ^

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx:201:20:
 note: declared private here
 SfxStyleFamily m_eFamily;
^
make[1]: *** 
[/home/vmiklos/git/libreoffice/co-23.05/solenv/gbuild/LinkTarget.mk:337: 
/home/vmiklos/git/libreoffice/co-23.05/workdir/CxxObject/sw/source/core/unocore/unostyle.o]
 Error 1

Change-Id: I3674834ad13efd070f057a981297c6c4d05d10e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155123
Reviewed-by: Andras Timar 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index bfc39c11992b..5f2bd6207894 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2551,7 +2551,7 @@ uno::Sequence 
SwXStyle::getPropertyStates(const uno::Seque
 break;
 case XATTR_FILLSTYLE:
 {
-if (m_rEntry.m_eFamily == SfxStyleFamily::Frame
+if (m_rEntry.family() == SfxStyleFamily::Frame
 && xStyle->GetFrameFormat()->DerivedFrom() == 
GetDoc()->GetDfltFrameFormat())
 {   // tdf#156155 mpDfltFrameFormat is the parent, but because
 // it IsDefault() it is not enumerated/exported as a style


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-07-26 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit 0f9beed6e610bab184cedc96916b723463de6620
Author: Caolán McNamara 
AuthorDate: Fri May 26 12:56:16 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 26 15:40:52 2023 +0200

SwViewShell::ToggleHeaderFooterEdit already calls GetWin()->Invalidate()

so this is a duplicate call, drop it

Change-Id: I4d332217594f7e1ceb4692ea31a6718ecd44d1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152304
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 94639b415729beb2a27bcb47da2cbd5205006861)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154850
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index f868a6ed1002..c8a8ea0b7cb4 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3005,12 +3005,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 rSh.SetShowHeaderFooterSeparator( FrameControlType::Footer, 
eControl == FrameControlType::Footer );
 
 if ( !rSh.IsHeaderFooterEdit() )
-{
 rSh.ToggleHeaderFooterEdit();
-
-// Repaint everything
-rSh.GetWin()->Invalidate();
-}
 }
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-07-17 Thread Mike Kaganski (via logerrit)
 sw/source/core/draw/dcontact.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 25feffa49576564d7fe70fb20597855d33ac8492
Author: Mike Kaganski 
AuthorDate: Fri Jul 14 18:51:41 2023 +0300
Commit: Miklos Vajna 
CommitDate: Mon Jul 17 08:07:07 2023 +0200

tdf#156287: don't try to move objects to pages other than their anchor

Objects may have offset moving them outside of the current page, where
their anchor is. This doesn't mean that they would move to another page,
just that they will be clipped.

Without this taken into account, objects which rectangle would be on
another page, would trigger infinite loop because of their position
invalidation in SwLayAction::FormatContent's cleanup code, where they
will move to their correct page; and then their off-page rectangle
would move them to another page again.

Change-Id: I2b818403163041a49a3bc1640b1af9a1705fd671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/15
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 8fc1162d3e7f894adf225fa65ec09bbb83bb17fb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154451
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ad2a6fe37bc0..2c0c5be60c86 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2057,10 +2057,12 @@ void SwDrawContact::ChkPage()
 }
 
 // --> #i28701#
+// tdf#156287: use anchor page, not current bound rectangle's page,
+// because an object can't move to a page other than its anchor anyway
 SwPageFrame* pPg = ( maAnchoredDrawObj.GetAnchorFrame() &&
maAnchoredDrawObj.GetAnchorFrame()->IsPageFrame() )
  ? GetPageFrame()
- : FindPage( SwRect(GetMaster()->GetCurrentBoundRect()) );
+ : maAnchoredDrawObj.FindPageFrameOfAnchor();
 if ( GetPageFrame() == pPg )
 return;
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-07-07 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/config/usrpref.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f4eb5a8ccf66fb33f9c7b286644d070c4febd423
Author: Mike Kaganski 
AuthorDate: Wed Jul 5 15:30:30 2023 +0300
Commit: Caolán McNamara 
CommitDate: Fri Jul 7 10:16:09 2023 +0200

tdf#155462: Re-enable ShowScrollBarTips expert config

... accidentally broken by commit 4ed26badfd6fd9190cb6e54078b41eb38cb37dca.

Change-Id: I407e1eab47277dd8fa00c123b32596557fd5f2a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154037
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/config/usrpref.cxx 
b/sw/source/uibase/config/usrpref.cxx
index e2599f4092b3..055949ef4b93 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -388,7 +388,7 @@ void SwLayoutViewConfig::Load()
 case 16: m_rParent.SetViewLayoutBookMode(bSet); break;// 
"ViewLayout/BookMode",
 case 17: m_rParent.SetDefaultPageMode(bSet,true); break;// 
"Other/IsSquaredPageMode",
 case 18: m_rParent.SetApplyCharUnit(bSet, true); break;// 
"Other/ApplyUserChar"
-case 29: m_rParent.SetShowScrollBarTips(bSet); break;// 
"Window/ShowScrollBarTips",
+case 19: m_rParent.SetShowScrollBarTips(bSet); break;// 
"Window/ShowScrollBarTips",
 }
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source vcl/jsdialog

2023-07-06 Thread Skyler Grey (via logerrit)
 sw/source/ui/dialog/uiregionsw.cxx |  102 ++---
 vcl/jsdialog/enabled.cxx   |1 
 2 files changed, 53 insertions(+), 50 deletions(-)

New commits:
commit 6aff11f36ecd02613c0613c9e89883c81656d9f6
Author: Skyler Grey 
AuthorDate: Sun Feb 19 13:13:05 2023 +
Commit: Szymon Kłos 
CommitDate: Thu Jul 6 11:48:41 2023 +0200

Make the format > sections > options dialog a jsdialog

- This dialog was not properly tunneled so did not show on collabora
  online
- Running asynchronously as a jsdialog both fixes this issue and is a
  general improvement (in that jsdialog conversion improves
  accessability, looks more consistent with the rest of COOL, etc.)

Note- This commit was previously given the Change-Id
  Ie9a70da70bbb30de039ded82f738285b1b734421 however I have replaced
  it due to accidentally creating it against the wrong base branch.
  To see the old change go to
  https://gerrit.libreoffice.org/c/core/+/147295

Change-Id: I2715eb1d8e3e301e1519e2ef6b69c823e571d08c
Signed-off-by: Skyler Grey 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151188
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index f3560e8f2b67..89248e7eed8d 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1048,57 +1048,59 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, 
weld::Button&, void)
 aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
 aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
 
-SwSectionPropertyTabDialog aTabDlg(m_xDialog.get(), aSet, m_rSh);
-if (RET_OK != aTabDlg.run())
-return;
-
-const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet();
-if( !(pOutSet && pOutSet->Count()) )
-return;
-
-const SwFormatCol* pColItem = pOutSet->GetItemIfSet(
-RES_COL, false );
-const SvxBrushItem* pBrushItem = pOutSet->GetItemIfSet(
-RES_BACKGROUND, false );
-const SwFormatFootnoteAtTextEnd* pFootnoteItem = pOutSet->GetItemIfSet(
-RES_FTN_AT_TXTEND, false );
-const SwFormatEndAtTextEnd* pEndItem = pOutSet->GetItemIfSet(
-RES_END_AT_TXTEND, false );
-const SwFormatNoBalancedColumns* pBalanceItem = pOutSet->GetItemIfSet(
-RES_COLUMNBALANCE, false );
-const SvxFrameDirectionItem* pFrameDirItem = pOutSet->GetItemIfSet(
-RES_FRAMEDIR, false );
-const SvxLRSpaceItem* pLRSpaceItem = pOutSet->GetItemIfSet(
-RES_LR_SPACE, false );
-
-if( !(pColItem ||
-  pBrushItem ||
-  pFootnoteItem ||
-  pEndItem ||
-  pBalanceItem ||
-  pFrameDirItem ||
-  pLRSpaceItem) )
-return;
-
-m_xTree->selected_foreach([&](weld::TreeIter& rEntry)
-{
-SectRepr* pRepr = weld::fromId(m_xTree->get_id(rEntry));
-if (pColItem)
-pRepr->GetCol() = *pColItem;
-if (pBrushItem)
-pRepr->GetBackground().reset(pBrushItem->Clone());
-if (pFootnoteItem)
-pRepr->GetFootnoteNtAtEnd() = *pFootnoteItem;
-if (pEndItem)
-pRepr->GetEndNtAtEnd() = *pEndItem;
-if (pBalanceItem)
-pRepr->GetBalance().SetValue(pBalanceItem->GetValue());
-if (pFrameDirItem)
-pRepr->GetFrameDir()->SetValue(pFrameDirItem->GetValue());
-if (pLRSpaceItem)
-pRepr->GetLRSpace().reset(pLRSpaceItem->Clone());
-return false;
+auto pDlg = std::make_shared(m_xDialog.get(), 
aSet, m_rSh);
+SfxTabDialogController::runAsync(pDlg, [pDlg, this](sal_Int32 nResult){
+if (nResult == RET_OK) {
+const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
+if( !(pOutSet && pOutSet->Count()) )
+return;
+
+const SwFormatCol* pColItem = pOutSet->GetItemIfSet(
+RES_COL, false );
+const SvxBrushItem* pBrushItem = pOutSet->GetItemIfSet(
+RES_BACKGROUND, false );
+const SwFormatFootnoteAtTextEnd* pFootnoteItem = 
pOutSet->GetItemIfSet(
+RES_FTN_AT_TXTEND, false );
+const SwFormatEndAtTextEnd* pEndItem = pOutSet->GetItemIfSet(
+RES_END_AT_TXTEND, false );
+const SwFormatNoBalancedColumns* pBalanceItem = 
pOutSet->GetItemIfSet(
+RES_COLUMNBALANCE, false );
+const SvxFrameDirectionItem* pFrameDirItem = pOutSet->GetItemIfSet(
+RES_FRAMEDIR, false );
+const SvxLRSpaceItem* pLRSpaceItem = pOutSet->GetItemIfSet(
+  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-29 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/itrpaint.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 97436f1487f647ed16228f7f7c3a5533981dc018
Author: Mike Kaganski 
AuthorDate: Wed Jun 28 18:54:43 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jun 29 10:49:03 2023 +0200

tdf#156078: Use TabOverSpacing compat option instead of TabOverflow

As Justin Luth noted, "TabOverflow is basically always true", and
using it basically equal to making the test always true. On the
other hand, TabOverSpacing is accurate for the task.

Change-Id: I608b200dac0169cbafc935a03452aac9ba0527a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153722
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit e24a3a3c339d7a175ebfeef31a280becda9d5950)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153703
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 3709e4a56869..7f61a27a412b 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -149,8 +149,8 @@ void SwTextPainter::DrawTextLine( const SwRect , 
SwSaveClip ,
 //compatibility settings: allow tabstop text to exceed right margin
 const auto& iDSA = 
GetInfo().GetTextFrame()->GetDoc().getIDocumentSettingAccess();
 const bool bTabOverMargin = iDSA.get(DocumentSettingId::TAB_OVER_MARGIN);
-const bool bTabOverflow = iDSA.get(DocumentSettingId::TAB_OVERFLOW);
-if (bTabOverMargin || bTabOverflow)
+const bool bTabOverSpacing = iDSA.get(DocumentSettingId::TAB_OVER_SPACING);
+if (bTabOverMargin || bTabOverSpacing)
 {
 SwLinePortion* pPorIter = pPor;
 while( pPorIter )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-23 Thread Szymon Kłos (via logerrit)
 sw/source/core/undo/docundo.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 001ef1ee056a74247e9a6229f466aa268e6765c7
Author: Szymon Kłos 
AuthorDate: Thu Jun 22 16:46:22 2023 +0200
Commit: Michael Meeks 
CommitDate: Fri Jun 23 09:18:40 2023 +0200

lok: use correct shell when doing undo

When doing undo we save EditShell reference in the context object.
Later it is used to get cursor we want to move to the place
where modification was done (in sw/source/core/undo/unins.cxx:281).

In LOK case when 2 different sessions were used and undo was done
by user A - then user's B cursor was moved. This fixes that issue.

We use current shell instead of getting it indirectly through
SwDoc::GetEditShell()

Change-Id: I7a10ea98587f48818e8d0aaa9ad739d4eed514f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153461
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index a9efc248259a..57202fe3632a 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -666,7 +667,10 @@ bool UndoManager::impl_DoUndoRedo(UndoOrRedoType 
undoOrRedo, size_t nUndoOffset)
 
 UnoActionContext c(& rDoc); // exception-safe StartAllAction/EndAllAction
 
-SwEditShell *const pEditShell(rDoc.GetEditShell());
+SwView* pViewShell = dynamic_cast(SfxViewShell::Current());
+SwEditShell *const pEditShell(
+comphelper::LibreOfficeKit::isActive() && pViewShell ? 
pViewShell->GetWrtShellPtr()
+: rDoc.GetEditShell());
 OSL_ENSURE(pEditShell, "sw::UndoManager needs a SwEditShell!");
 if (!pEditShell)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-21 Thread Paris Oplopoios (via logerrit)
 sw/source/ui/misc/pagenumberdlg.cxx|   32 +---
 sw/source/uibase/inc/pagenumberdlg.hxx |1 +
 2 files changed, 26 insertions(+), 7 deletions(-)

New commits:
commit 82e04b9041b256cd8191c7b142caefa94c137309
Author: Paris Oplopoios 
AuthorDate: Wed Jun 14 01:49:07 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Wed Jun 21 17:14:30 2023 +0200

Remove hardcoded values in pagenumberdlg

Removed hardcoded text width/heights and margins in pagenumberdlg to
create the preview image and also added a different text preview for
IncludePageTotal mode

Change-Id: Ib4f4f9ba702f87babf13c1435dc3845add1f43cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153030
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 
(cherry picked from commit 63627c174778f7d435a540c43ec0498c76e739ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153288
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/ui/misc/pagenumberdlg.cxx 
b/sw/source/ui/misc/pagenumberdlg.cxx
index 1b1c4a98f579..2396da26202b 100644
--- a/sw/source/ui/misc/pagenumberdlg.cxx
+++ b/sw/source/ui/misc/pagenumberdlg.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent)
 : SfxDialogController(pParent, "modules/swriter/ui/pagenumberdlg.ui", 
"PageNumberDialog")
@@ -49,6 +50,7 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent)
 
SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xPageNumberTypeLB->get_widget(),
  
::std::numeric_limits::max());
 m_xPageNumberTypeLB->connect_changed(LINK(this, SwPageNumberDlg, 
NumberTypeSelectHdl));
+m_xIncludePageTotal->connect_toggled(LINK(this, SwPageNumberDlg, 
IncludePageTotalChangeHdl));
 updateImage();
 }
 
@@ -81,6 +83,11 @@ IMPL_LINK_NOARG(SwPageNumberDlg, NumberTypeSelectHdl, 
weld::ComboBox&, void)
 m_nPageNumberType = m_xPageNumberTypeLB->get_active_id();
 }
 
+IMPL_LINK_NOARG(SwPageNumberDlg, IncludePageTotalChangeHdl, weld::Toggleable&, 
void)
+{
+updateImage();
+}
+
 bool SwPageNumberDlg::GetMirrorOnEvenPages()
 {
 return m_xMirrorOnEvenPages->get_sensitive()
@@ -103,8 +110,7 @@ void SwPageNumberDlg::updateImage()
 int nBackgroundWidth = 75;
 int nBackgroundHeight = 105;
 
-int nSpriteWidth = 10;
-int nSpriteHeight = 14;
+int nMargin = 7;
 
 ScopedVclPtrInstance pVirtualDev;
 Size aVDSize(nBackgroundWidth, nBackgroundHeight);
@@ -112,17 +118,29 @@ void SwPageNumberDlg::updateImage()
 pVirtualDev->SetBackground(Color(0xF0, 0xF0, 0xF0));
 pVirtualDev->Erase();
 
-int y = m_aPageNumberPosition ? (nBackgroundHeight - nSpriteHeight - 5) : 
5;
-int x = 5;
+OUString sText = "#";
+
+if (m_xIncludePageTotal->get_state() == TRISTATE_TRUE)
+{
+sText += " / #";
+}
+
+DrawTextFlags eFlags = DrawTextFlags::Left;
+
 if (m_aPageNumberAlignment == 1)
 {
-x = (nBackgroundWidth - nSpriteWidth) / 2;
+eFlags = DrawTextFlags::Center;
 }
 else if (m_aPageNumberAlignment == 2)
 {
-x = nBackgroundWidth - nSpriteWidth - 5;
+eFlags = DrawTextFlags::Right;
 }
-pVirtualDev->DrawText(Point(x, y), "#");
+
+eFlags |= m_aPageNumberPosition ? DrawTextFlags::Bottom : 
DrawTextFlags::Top;
+
+pVirtualDev->DrawText(
+tools::Rectangle(nMargin, nMargin, nBackgroundWidth - nMargin, 
nBackgroundHeight - nMargin),
+sText, eFlags);
 
 m_xPreviewImage->set_image(pVirtualDev);
 }
diff --git a/sw/source/uibase/inc/pagenumberdlg.hxx 
b/sw/source/uibase/inc/pagenumberdlg.hxx
index 298ab975d1f2..87cf385993c9 100644
--- a/sw/source/uibase/inc/pagenumberdlg.hxx
+++ b/sw/source/uibase/inc/pagenumberdlg.hxx
@@ -43,6 +43,7 @@ class SwPageNumberDlg : public SfxDialogController
 
 DECL_LINK(OkHdl, weld::Button&, void);
 DECL_LINK(CancelHdl, weld::Button&, void);
+DECL_LINK(IncludePageTotalChangeHdl, weld::Toggleable&, void);
 DECL_LINK(PositionSelectHdl, weld::ComboBox&, void);
 DECL_LINK(AlignmentSelectHdl, weld::ComboBox&, void);
 DECL_LINK(NumberTypeSelectHdl, weld::ComboBox&, void);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-20 Thread Paris Oplopoios (via logerrit)
 sw/source/core/view/viewsh.cxx |   20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit e1193efffbe8310e9d13e049f47865b31a2d14e4
Author: Paris Oplopoios 
AuthorDate: Wed Jun 21 01:59:50 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Wed Jun 21 02:00:11 2023 +0200

sw: Fix spell checking having no view separation in tiled mode

Turning spell checking on or off for a single view would turn it on/off
for every view which is correct behavior normally but not in tiled mode
because different views might want different view options

Change-Id: Ib422f692e97618cfba6a7cb8b2a4f2b3f20a0ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153370
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 9c80d43f36a6..ef1d7317ef73 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2502,17 +2502,19 @@ void SwViewShell::ImplApplyViewOptions( const 
SwViewOption  )
 if( !bOnlineSpellChgd )
 return;
 
-bool bOnlineSpl = rOpt.IsOnlineSpell();
-for(SwViewShell& rSh : GetRingContainer())
+if ( !comphelper::LibreOfficeKit::isActive() )
 {
-if( == this)
-continue;
-rSh.mpOpt->SetOnlineSpell( bOnlineSpl );
-vcl::Window *pTmpWin = rSh.GetWin();
-if( pTmpWin )
-pTmpWin->Invalidate();
+bool bOnlineSpl = rOpt.IsOnlineSpell();
+for(SwViewShell& rSh : GetRingContainer())
+{
+if( == this)
+continue;
+rSh.mpOpt->SetOnlineSpell( bOnlineSpl );
+vcl::Window *pTmpWin = rSh.GetWin();
+if( pTmpWin )
+pTmpWin->Invalidate();
+}
 }
-
 }
 
 void SwViewShell::SetUIOptions( const SwViewOption  )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-13 Thread Tomaž Vajngerl (via logerrit)
 sw/source/filter/ww8/docxexport.cxx |   37 ++--
 1 file changed, 11 insertions(+), 26 deletions(-)

New commits:
commit a3ca125a08973c8b41a7170c085dff64a89c5f07
Author: Tomaž Vajngerl 
AuthorDate: Thu Jun 8 12:37:21 2023 +0900
Commit: Miklos Vajna 
CommitDate: Tue Jun 13 15:03:32 2023 +0200

sw: use ThemeExport instead of grab bag

Change-Id: I68d300d58aaa1e5da374a8ddea4ff37e9a1e1819
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152723
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit fcccb8f8d67dd7deec772746661d2d6dff2c14a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152725
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index b9c75140b7f6..7ad0f16eb6fb 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -48,11 +48,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -62,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "wrtww8.hxx"
@@ -74,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1464,35 +1469,15 @@ void DocxExport::WriteSettings()
 
 void DocxExport::WriteTheme()
 {
-uno::Reference< beans::XPropertySet > xPropSet( 
m_rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
-
-uno::Reference< beans::XPropertySetInfo > xPropSetInfo = 
xPropSet->getPropertySetInfo();
-OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
-if ( !xPropSetInfo->hasPropertyByName( aName ) )
+SdrPage* pPage = 
m_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
+if (!pTheme)
 return;
 
-uno::Reference themeDom;
-uno::Sequence< beans::PropertyValue > propList;
-xPropSet->getPropertyValue( aName ) >>= propList;
-auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
-[](const beans::PropertyValue& rProp) { return rProp.Name == 
"OOXTheme"; });
-if (pProp != std::cend(propList))
-pProp->Value >>= themeDom;
-
-// no theme dom to write
-if ( !themeDom.is() )
-return;
-
-m_rFilter.addRelation( m_pDocumentFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-u"theme/theme1.xml" );
+m_rFilter.addRelation(m_pDocumentFS->getOutputStream(), 
oox::getRelationship(Relationship::THEME), u"theme/theme1.xml" );
 
-uno::Reference< xml::sax::XSAXSerializable > serializer( themeDom, 
uno::UNO_QUERY );
-uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( 
comphelper::getProcessComponentContext() );
-writer->setOutputStream( GetFilter().openFragmentStream( 
"word/theme/theme1.xml",
-"application/vnd.openxmlformats-officedocument.theme+xml" ) );
-serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( 
writer, uno::UNO_QUERY_THROW ),
-uno::Sequence< beans::StringPair >() );
+oox::ThemeExport aThemeExport(_rFilter, oox::drawingml::DOCUMENT_DOCX);
+aThemeExport.write(u"word/theme/theme1.xml", *pTheme);
 }
 
 // See OOXMLDocumentImpl::resolveGlossaryStream


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-08 Thread Attila Szűcs (via logerrit)
 sw/source/uibase/inc/conttree.hxx  |1 +
 sw/source/uibase/utlui/content.cxx |8 
 sw/source/uibase/utlui/navipi.cxx  |   11 +++
 3 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 61e2022110d3088bc1653713dc270beaacae4c74
Author: Attila Szűcs 
AuthorDate: Fri Jun 9 05:56:31 2023 +0200
Commit: Andras Timar 
CommitDate: Fri Jun 9 07:29:30 2023 +0200

LOK: fix for navigator: hide empty contentTypes

fixed that opening heading by default, first check if headings
are not hidden, because it blindly opened the 1. type, but
from now, that can be an other type, or nothing

Change-Id: I86cac472d8cba9a46befc5a84ef073c01fa7243d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152779
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index ec0dbc7c84e8..e2cf31028171 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -236,6 +236,7 @@ public:
 { return State::HIDDEN == m_eState ? m_pHiddenShell : m_pActiveShell; }
 
 boolIsInDrag() const;
+boolHasHeadings() const;
 
 sal_uInt8   GetOutlineLevel()const {return m_nOutlineLevel;}
 voidSetOutlineLevel(sal_uInt8 nSet);
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 6325347a930e..5367627cad03 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1256,6 +1256,14 @@ bool SwContentTree::IsInDrag() const
 return m_xTreeView->get_drag_source() == m_xTreeView.get();
 }
 
+bool SwContentTree::HasHeadings() const
+{
+const std::unique_ptr& rpContentT = 
m_aActiveContentArr[ContentTypeId::OUTLINE];
+if (rpContentT && rpContentT->GetMemberCount() > 0)
+return true;
+return false;
+}
+
 // QueryDrop will be executed in the navigator
 sal_Int8 SwContentTree::AcceptDrop(const AcceptDropEvent& rEvt)
 {
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 61ada3408bbc..fb3f461f8f64 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -694,10 +694,13 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xGlobalTree->HideTree();
 
 //Open Headings by default
-auto& pTreeView = m_xContentTree->get_widget();
-std::unique_ptr itEntry(pTreeView.make_iterator());
-pTreeView.get_iter_first(*itEntry);
-pTreeView.expand_row(*itEntry);
+if (m_xContentTree->HasHeadings())
+{
+auto& pTreeView = m_xContentTree->get_widget();
+std::unique_ptr itEntry(pTreeView.make_iterator());
+pTreeView.get_iter_first(*itEntry);
+pTreeView.expand_row(*itEntry);
+}
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-08 Thread Attila Szűcs (via logerrit)
 sw/source/uibase/utlui/content.cxx |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit ed3bb61461e4e394bd476b4ec57ff3025eca153f
Author: Attila Szűcs 
AuthorDate: Thu Jun 8 11:21:16 2023 +0200
Commit: Andras Timar 
CommitDate: Thu Jun 8 21:51:43 2023 +0200

LOK: navigator: hide empty contentTypes

In case of LOK, do not insert empty contenttype to tree,
and implement new way to find changes in contents, in hidden
contentTypes, because the original checked only on the tree.

Change-Id: Ib1e4da5e05b2ad4161c6a66a9c54111d558f66f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152735
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index c54ec983d157..6325347a930e 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -111,6 +111,8 @@
 #include 
 #include 
 
+#include 
+
 #define CTYPE_CNT   0
 #define CTYPE_CTT   1
 
@@ -2544,6 +2546,13 @@ void SwContentTree::Display( bool bActive )
 
 OUString aImage(GetImageIdForContentTypeId(nCntType));
 bool bChOnDemand = 0 != rpContentT->GetMemberCount();
+
+// In case of LOK, empty content types must be hidden in the 
contenttree
+if (comphelper::LibreOfficeKit::isActive() && !bChOnDemand)
+{
+continue;
+}
+
 OUString sId(weld::toId(rpContentT.get()));
 insert(nullptr, rpContentT->GetName(), sId, bChOnDemand, 
xEntry.get());
 m_xTreeView->set_image(*xEntry, aImage);
@@ -2947,6 +2956,27 @@ bool SwContentTree::HasContentChanged()
 // is detected only fill member lists for remaining content types. The 
Display function
 // will clear and recreate the treeview from the content type member 
arrays if content has
 // changed.
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// In case of LOK, empty contentTypes are hidden, even in all 
content view
+// so it is not enough to check only the m_xTreeView.
+bool bCountChanged = false;
+for (ContentTypeId i : o3tl::enumrange())
+{
+if (m_aActiveContentArr[i])
+{
+auto nLastTMCount = 
m_aActiveContentArr[i]->GetMemberCount();
+m_aActiveContentArr[i]->FillMemberList();
+// If the member count of a type is changed, then the 
content is surely changed
+if (m_aActiveContentArr[i]->GetMemberCount() != 
nLastTMCount)
+bCountChanged = true;
+}
+}
+if (bCountChanged)
+return true;
+}
+
 std::unique_ptr xEntry(m_xTreeView->make_iterator());
 
 // lambda function to find the next content type entry


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-06-01 Thread Caolán McNamara (via logerrit)
 sw/source/core/access/accpara.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 51d3161bd9114fa503a6286247c87bc6f77b8b4b
Author: Caolán McNamara 
AuthorDate: Thu Jun 1 12:32:57 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jun 1 14:39:36 2023 +0200

take a copy of SwAccessibleParagraph::GetString()

take a copy of this a11y and not a reference

it is not guaranteed that listeners to the a11y events called by
FireAccessibleEvent will themselves not call anything which could end up
calling ClearPortionData which would leave rText pointing to old
released memory

seen in the wild with:

==15145==ERROR: AddressSanitizer: heap-use-after-free
program/../program/libswlo.so
rtl::OUString::equals(rtl::OUString const&) const
builddir/libreoffice/include/rtl/ustring.hxx:952
program/../program/libswlo.so
rtl::operator==(rtl::OUString const&, rtl::OUString const&)
builddir/libreoffice/include/rtl/ustring.hxx:1713
program/../program/libswlo.so
SwAccessibleContext::InvalidatePosOrSize(SwRect const&)

builddir/libreoffice/sw/source/core/access/acccontext.cxx:1196

and

previously allocated by thread T0 here:
program/../program/libswlo.so
SwAccessibleParagraph::UpdatePortionData()
builddir/libreoffice/sw/source/core/access/accpara.cxx:442

with free of:

program/../program/libswlo.so

std::default_delete::operator()(SwAccessiblePortionData*)
 const

gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/unique_ptr.h:78
program/../program/libswlo.so
SwAccessibleParagraph::ClearPortionData()
builddir/libreoffice/sw/source/core/access/accpara.cxx:451
program/../program/libswlo.so
SwAccessibleParagraph::getCaretPosition()
builddir/libreoffice/sw/source/core/access/accpara.cxx:1016
program/libmergedlo.so

LOKDocumentFocusListener::updateParagraphInfo(com::sun::star::uno::Reference
 const&, bool, std::__cxx11::basic_string, 
std::allocator >)
builddir/libreoffice/sfx2/source/view/viewsh.cxx:685

Change-Id: I72c9894ca842b8f040b27481f0fd8d56542eb530
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152442
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 687e2571c339..8761e379b1e7 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -250,16 +250,16 @@ void SwAccessibleParagraph::InvalidateContent_( bool 
bVisibleDataFired )
 
 ClearPortionData();
 
-const OUString& rText = GetString();
+const OUString sText = GetString();
 
-if( rText != sOldText )
+if( sText != sOldText )
 {
 // The text is changed
 AccessibleEventObject aEvent;
 aEvent.EventId = AccessibleEventId::TEXT_CHANGED;
 
-// determine exact changes between sOldText and rText
-
(void)comphelper::OCommonAccessibleText::implInitTextChangedEvent(sOldText, 
rText,
+// determine exact changes between sOldText and sText
+
(void)comphelper::OCommonAccessibleText::implInitTextChangedEvent(sOldText, 
sText,
   
aEvent.OldValue,
   
aEvent.NewValue);
 
@@ -302,7 +302,7 @@ void SwAccessibleParagraph::InvalidateContent_( bool 
bVisibleDataFired )
 FireAccessibleEvent( aEvent );
 }
 
-if( rText == sOldText )
+if( sText == sOldText )
 return;
 
 OUString sNewDesc( GetDescription() );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-31 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/config/viewopt.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d6f093c8b0ba4590dfea0891b2399fff9cf67bbe
Author: Caolán McNamara 
AuthorDate: Wed May 31 12:59:49 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 31 14:42:58 2023 +0200

Related: tdf#155507 don't enable field shadings in online case

as in initializeForTiledRendering we don't want field shadings

Change-Id: Ie1ea2c365bcd78cdfd554646474c4ef05a19fcda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152433
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/config/viewopt.cxx 
b/sw/source/uibase/config/viewopt.cxx
index fb9f9abbac12..fba5bae14424 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -124,7 +124,9 @@ SwViewColors::SwViewColors(const svtools::ColorConfig& 
rConfig)
 
 aValue = rConfig.GetColorValue(svtools::WRITERFIELDSHADINGS);
 m_aFieldShadingsColor = aValue.nColor;
-if(aValue.bIsVisible)
+// as in initializeForTiledRendering we don't want to enable
+// field shadings for the online case
+if (aValue.bIsVisible && !comphelper::LibreOfficeKit::isActive())
 m_nAppearanceFlags |= ViewOptFlags::FieldShadings;
 
 aValue = rConfig.GetColorValue(svtools::WRITERSECTIONBOUNDARIES);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-31 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/uno/unotxdoc.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 7f38801e2d4ff57a363ed60d3031ef42abb2cb8a
Author: Caolán McNamara 
AuthorDate: Fri May 26 15:08:05 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 31 14:10:26 2023 +0200

Related: tdf#155507 disable HeaderFooter menu for tiled rendering

Change-Id: I3fa87dc40c8e68d00f2f2fa82a0e6c4179466429
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152332
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 31f2de053d89fc782f98f74785643dbd6e19ba73)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152432
Tested-by: Caolán McNamara 

diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 29bede97f15b..1a1c5c3ec41a 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3605,6 +3605,10 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::SequenceGetRedlineAuthor(SW_MOD()->GetRedlineAuthor());
 OUString sAuthor;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-30 Thread Mike Kaganski (via logerrit)
 sw/source/filter/html/htmlnumwriter.cxx |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 9449d50a885b91bcf4f75b6569d5f3b28e868076
Author: Mike Kaganski 
AuthorDate: Tue May 30 12:11:08 2023 +0300
Commit: Andras Timar 
CommitDate: Wed May 31 07:24:26 2023 +0200

Fix CI breakage from commit 36831c668c53fdfcd78300045e6beafccbba35c6

It backported commit ebf8b0b0699fe34c86badb3087869d902a4e40a8 from
libreoffice-7-5 to co-23.05; and in the process, it manually restored
the 'if (rWrt.mbXHTML)' condition, that was removed in co-23.05 in
commit b401ff5020264adef2fd68c111d9bc9ea84ee1ab (htmlexport: close li
mark not only in xhtml, 2023-02-08).

Unfortunately, the backport that included manual merge conflict
resolution wasn't CI-tested.

Change-Id: Id42b6309ed92e209b682b4b1cf5578e2a0f20fc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152385
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sw/source/filter/html/htmlnumwriter.cxx 
b/sw/source/filter/html/htmlnumwriter.cxx
index a3bc30891f76..2bb4f5d96457 100644
--- a/sw/source/filter/html/htmlnumwriter.cxx
+++ b/sw/source/filter/html/htmlnumwriter.cxx
@@ -287,15 +287,12 @@ Writer& OutHTML_NumberBulletListEnd( SwHTMLWriter& rWrt,
 bool bListEnd = !bSameRule || rNextInfo.GetDepth() < rInfo.GetDepth() || 
rNextInfo.IsRestart(rInfo);
 bool bNextIsSubitem = !bListEnd && rNextInfo.GetDepth() > rInfo.GetDepth();
 
-if (rWrt.mbXHTML)
+// XHTML  for the list item content, if there is an open .
+if (bListEnd || (!bNextIsSubitem && rNextInfo.IsNumbered()))
 {
-// XHTML  for the list item content, if there is an open .
-if (bListEnd || (!bNextIsSubitem && rNextInfo.IsNumbered()))
-{
-HTMLOutFuncs::Out_AsciiTag(
-rWrt.Strm(), Concat2View(rWrt.GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_li),
-false);
-}
+HTMLOutFuncs::Out_AsciiTag(
+rWrt.Strm(), Concat2View(rWrt.GetNamespace() + 
OOO_STRING_SVTOOLS_HTML_li),
+false);
 }
 
 if (!bListEnd)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-30 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f425c0aab6e33b8029bf7e87ac9b10b4b4489ac9
Author: Caolán McNamara 
AuthorDate: Fri May 26 14:47:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 30 21:08:01 2023 +0200

Related: tdf#155507 Only need this invalidate if using header/footer 
controls

which is implied from the IsUseHeaderFooterMenu option

Change-Id: I0f9a32ed1a3e0e5e277c33c45206757d133d92e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152311
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 09e5b01c7758..7564385f19a9 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2965,9 +2965,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 
 if ( !bActive )
 {
-// When in Hide-Whitespace mode, we don't want header
-// and footer controls.
-if (!rSh.GetViewOptions()->IsHideWhitespaceMode())
+// HeaderFooter menu implies header/footer controls, so only 
do this with IsUseHeaderFooterMenu enabled.
+// But, additionally, when in Hide-Whitespace mode, we don't 
want those controls.
+if (rSh.GetViewOptions()->IsUseHeaderFooterMenu() && 
!rSh.GetViewOptions()->IsHideWhitespaceMode())
 {
 SwPaM aPam(*rSh.GetCurrentShellCursor().GetPoint());
 const bool bWasInHeader = 
aPam.GetPoint()->GetNode().FindHeaderStartNode() != nullptr;
@@ -2992,7 +2992,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 // if the cursor cannot be positioned on-screen, then 
the user would need to scroll back again to use the control.
 // This should only be done for the footer. The cursor 
can always be re-positioned near the header. tdf#134023.
 if ( eControl == FrameControlType::Footer && 
!bSeparatorWasVisible
- && rSh.GetViewOptions()->IsUseHeaderFooterMenu() 
&& !Application::IsHeadlessModeEnabled() )
+ && !Application::IsHeadlessModeEnabled() )
 return;
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-30 Thread Caolán McNamara (via logerrit)
 sw/source/core/crsr/crsrsh.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 643c6b9a96020d5498d981c7ab081226415ab016
Author: Caolán McNamara 
AuthorDate: Fri May 26 10:31:16 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 30 17:09:02 2023 +0200

tdf#155507 don't redraw numbering when cursor enters it, if...

"field shadings" are turned off and so the new output would be the same
as it already is. Which removes a potential source of whole document
invalidations in a multi-user collaborative scenario where participants
may be casually clicking around the place with an expectation that it
has limited effect on the other participants

Change-Id: I2fb51ba3358bfc920aa2bff3593a0dd46f287100
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152229
Reviewed-by: Michael Meeks 
Tested-by: Caolán McNamara 

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 03cecdbbd8bf..15c0dc1a6409 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -391,12 +391,18 @@ void SwCursorShell::MarkListLevel( const OUString& 
sListId,
 if (sListId == m_sMarkedListId && nListLevel == m_nMarkedListLevel)
 return;
 
-if ( !m_sMarkedListId.isEmpty() )
-mxDoc->MarkListLevel( m_sMarkedListId, m_nMarkedListLevel, false );
-
-if ( !sListId.isEmpty() )
-{
-mxDoc->MarkListLevel( sListId, nListLevel, true );
+// Writer redraws the "marked" list with the field shading, if there
+// is no field shading then the marked list would be redrawn for no
+// visually identifiable reason, so skip the mark if field shadings
+// are disabled.
+const bool bVisuallyMarked(GetViewOptions()->IsFieldShadings());
+if (bVisuallyMarked)
+{
+if ( !m_sMarkedListId.isEmpty() )
+mxDoc->MarkListLevel( m_sMarkedListId, m_nMarkedListLevel, false );
+
+if ( !sListId.isEmpty() )
+mxDoc->MarkListLevel( sListId, nListLevel, true );
 }
 
 m_sMarkedListId = sListId;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-23 Thread Caolán McNamara (via logerrit)
 sw/source/core/view/viewsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 56298afb797b7406d1d3b4d6cf6fdb23e4284679
Author: Caolán McNamara 
AuthorDate: Mon May 22 15:36:45 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 23 17:24:29 2023 +0200

in online do less whole document invalidation

https://github.com/CollaboraOnline/online/issues/6379

lets at least halve the num of invalidations on joining
a session.

Change-Id: I8ceb0a9ee23d632c9fb2c4a96250cc259b4a2f29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152103
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 53457942749f..13ffa8720488 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1280,7 +1280,7 @@ void SwViewShell::VisPortChgd( const SwRect )
 return;
 maVisArea.Pos() = rRect.Pos();
 }
-else
+else if (!comphelper::LibreOfficeKit::isActive())
 GetWin()->Invalidate( aRect );
 }
 else if ( !mnLockPaint ) //will be released in Unlock


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-22 Thread Attila Szűcs (via logerrit)
 sw/source/uibase/utlui/navipi.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 09c40d669cac5f167fa68cb5c6ad94a6a9e2a844
Author: Attila Szűcs 
AuthorDate: Thu May 18 10:36:38 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 22 15:26:34 2023 +0200

LOK: Navigator: headings expanded by default

Called an expand_row for the first element of the contetnTree
in the navigator constructor.
Right now contructor is called every time when navigator is
opened, it may change later. (desktop app do it only if navigator
opens in a new window, not on sidebar)

Change-Id: Ibe4b71e6a6ddb573269178f83c295b0c2cbd53b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151939
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 99f87a13a055..61ada3408bbc 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -692,6 +692,12 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xGlobalBox->hide();
 m_xGlobalToolBox->hide();
 m_xGlobalTree->HideTree();
+
+//Open Headings by default
+auto& pTreeView = m_xContentTree->get_widget();
+std::unique_ptr itEntry(pTreeView.make_iterator());
+pTreeView.get_iter_first(*itEntry);
+pTreeView.expand_row(*itEntry);
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-18 Thread Justin Luth (via logerrit)
 sw/source/core/txtnode/ndtxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6f608c493aa42c8fcdef8cb7220423fefb8555c9
Author: Justin Luth 
AuthorDate: Mon May 15 09:57:55 2023 -0400
Commit: Justin Luth 
CommitDate: Thu May 18 21:26:06 2023 +0200

related tdf#136536 sw: don't copy useless char escapement to next node on 
split

This was clearing ANY single direct formatting attribute,
not just char escapement.

While that might be desireable in certain contexts,
limit the hack to its intended subscript/superscript only.

Change-Id: I0d503af826635c4325332cc985964957ee0b065d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151796
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit a4d011fb8ae24f90375744af5e98ba81716a22cb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151911
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index a334baf87634..879ccaa9f35e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -738,7 +738,7 @@ SwTextNode *SwTextNode::SplitContentNode(const SwPosition & 
rPos,
 }
 
 const std::shared_ptr& pSet = 
pHt->GetAutoFormat().GetStyleHandle();
-if (!pSet || pSet->Count() != 1 || 
!pSet->GetItem(RES_CHRATR_ESCAPEMENT))
+if (!pSet || pSet->Count() != 1 || 
!pSet->HasItem(RES_CHRATR_ESCAPEMENT))
 {
 continue;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-18 Thread Justin Luth (via logerrit)
 sw/source/uibase/shells/textfld.cxx |   38 +++-
 1 file changed, 21 insertions(+), 17 deletions(-)

New commits:
commit 9f446595a3237351d934687938284eea8cd9dec1
Author: Justin Luth 
AuthorDate: Wed Apr 26 12:05:15 2023 -0400
Commit: Justin Luth 
CommitDate: Thu May 18 17:55:07 2023 +0200

tdf#86630 sw page number wizard: only turn on current page footer

Without specifying the name of the page style,
all in-use page styles were having the header or footer enabled.
That was not the intent.

Change-Id: I5eadd73cb2d7e11b6a003826b5698e22df3f13c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151133
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151900
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index f9d091cce3cf..93f19ca4e0dd 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1044,11 +1045,10 @@ FIELD_INSERT:
 rSh.SwCursorShell::Push();
 
rDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_PAGE_NUMBER, nullptr);
 
-// Insert header/footer
-bool bFooter = (pDlg->GetPageNumberPosition() == 1);
-sal_uInt16 nPageNumberPosition = bFooter ?
-FN_INSERT_PAGEFOOTER : FN_INSERT_PAGEHEADER;
-SfxBoolItem aItem(FN_PARAM_1, true);
+const size_t nPageDescIndex = rSh.GetCurPageDesc();
+const SwPageDesc& rDesc = rSh.GetPageDesc(nPageDescIndex);
+const bool bHeaderAlreadyOn = 
rDesc.GetMaster().GetHeader().IsActive();
+const bool bFooterAlreadyOn = 
rDesc.GetMaster().GetFooter().IsActive();
 
 SvxPageItem aPageItem(SID_ATTR_PAGE);
 aPageItem.SetNumType(pDlg->GetPageNumberType());
@@ -1056,13 +1056,17 @@ FIELD_INSERT:
   SfxCallMode::API | 
SfxCallMode::SYNCHRON,
   {  });
 
+// Insert header/footer
+const bool bHeader = !pDlg->GetPageNumberPosition();
+if (bHeader && !bHeaderAlreadyOn)
+rSh.ChangeHeaderOrFooter(rDesc.GetName(), bHeader, 
/*On=*/true, /*Warn=*/false);
+else if (!bHeader && !bFooterAlreadyOn)
+rSh.ChangeHeaderOrFooter(rDesc.GetName(), false, 
/*On=*/true, /*Warn=*/false);
 
-
-rSh.GetView().GetDispatcher().ExecuteList(
-nPageNumberPosition,
-SfxCallMode::API | SfxCallMode::SYNCHRON,
-{}
-);
+if (bHeader)
+rSh.GotoHeaderText();
+else
+rSh.GotoFooterText();
 
 SwTextNode* pTextNode = 
rSh.GetCursor()->GetPoint()->GetNode().GetTextNode();
 
@@ -1070,13 +1074,13 @@ FIELD_INSERT:
 if (pTextNode && !pTextNode->GetText().isEmpty())
 {
 
rDoc->getIDocumentContentOperations().SplitNode(*rSh.GetCursor()->GetPoint(), 
false);
-}
 
-// Go back to start of header/footer
-if (bFooter)
-rSh.GotoFooterText();
-else
-rSh.GotoHeaderText();
+// Go back to start of header/footer
+if (bHeader)
+rSh.GotoHeaderText();
+else
+rSh.GotoFooterText();
+}
 
 // Set alignment for the new line
 switch (pDlg->GetPageNumberAlignment())


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-18 Thread Justin Luth (via logerrit)
 sw/source/ui/misc/pagenumberdlg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2f1f2b192da9e576268431d0dbbbceccf74e311d
Author: Justin Luth 
AuthorDate: Tue Apr 25 12:58:29 2023 -0400
Commit: Justin Luth 
CommitDate: Thu May 18 17:53:54 2023 +0200

tdf#86630 sw page number wizard: default to center of page

Defaulting to one side of the page only makes sense
if the footer is mirrored.
[Well, mirrored isn't the best word here
because it only refers to margin spacing.]

The only way to get mirrored footers is to have
separate left and right pages.

It would be nice to add mirroring to the wizard,
but that can be done separately.

First, lets just get a better default value in place.

Change-Id: I314c6a34414a696c6f2e27bb2b0747fdb86f3b22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150998
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Paris Oplopoios 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151898
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/ui/misc/pagenumberdlg.cxx 
b/sw/source/ui/misc/pagenumberdlg.cxx
index 47e532e18ae6..b2634d68950e 100644
--- a/sw/source/ui/misc/pagenumberdlg.cxx
+++ b/sw/source/ui/misc/pagenumberdlg.cxx
@@ -30,8 +30,8 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent)
 , m_xPageNumberPosition(m_xBuilder->weld_combo_box("positionCombo"))
 , m_xPageNumberAlignment(m_xBuilder->weld_combo_box("alignmentCombo"))
 , m_xPreviewImage(m_xBuilder->weld_image("previewImage"))
-, m_aPageNumberPosition(1)
-, m_aPageNumberAlignment(0)
+, m_aPageNumberPosition(1) // bottom
+, m_aPageNumberAlignment(1) // center
 {
 m_xOk->connect_clicked(LINK(this, SwPageNumberDlg, OkHdl));
 m_xPageNumberPosition->connect_changed(LINK(this, SwPageNumberDlg, 
PositionSelectHdl));


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-16 Thread Patrick Luby (via logerrit)
 sw/source/uibase/shells/textsh1.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit fc157beedabfd08c0991bdd1633be0b9b7a9ff49
Author: Patrick Luby 
AuthorDate: Sun May 14 20:15:12 2023 -0400
Commit: Tomaž Vajngerl 
CommitDate: Wed May 17 06:53:45 2023 +0200

Fix iOS build breakages

Change-Id: Ib30a16f0803638d1b4049ddcbb3829a49ac57cb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151751
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Patrick Luby 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 573d82d74ca8..76554e923e45 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1670,19 +1670,15 @@ void SwTextShell::Execute(SfxRequest )
 
 case SID_ATTR_CHAR_COLOR2:
 {
-Color aSet;
 const SfxStringItem* pColorStringItem = nullptr;
 bool bHasItem = false;
 
 if(pItem)
 {
-aSet = static_cast(pItem)->GetValue();
 bHasItem = true;
 }
 else if (pArgs && (pColorStringItem = 
pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
 {
-OUString sColor = pColorStringItem->GetValue();
-aSet = Color(ColorTransparency, sColor.toInt32(16));
 bHasItem = true;
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-16 Thread Michael Meeks (via logerrit)
 sw/source/core/layout/layact.cxx |1 +
 sw/source/core/view/viewsh.cxx   |4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 765cc200fd7e809d4aeca9bc83fa125ee248fce9
Author: Michael Meeks 
AuthorDate: Fri Mar 24 17:42:40 2023 +
Commit: Caolán McNamara 
CommitDate: Wed May 17 00:37:45 2023 +0200

lok: avoid painting writer windows to a giant virtual-device.

When layout changes, we don't want to immediately redraw lots of
windows; we should be able to wait for tiles to be rendered
instead. Certainly we don't want to allocate a giant virtual
device.

Unfortunately we also believe that full document invalidations
are cheap - so warn about that.

Change-Id: Ib56320d4860c4b6f4e100b30cc6d3e490a1c7a90
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149601
Tested-by: Jenkins
(cherry picked from commit 1ed50bb714b8ed657cd422df850a6852cd863f43)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149622
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 583ca4a3b4db..be803a3b00c1 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2352,6 +2352,7 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp 
*pI ) :
 bool bUnlock = false;
 if ( pViewImp->HasPaintRegion() )
 {
+SAL_INFO("sw.idle", "Disappointing full document 
invalidation");
 pViewImp->DeletePaintRegion();
 
 // Cause a repaint with virtual device.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 8a99aa5de310..53457942749f 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -475,7 +475,7 @@ void SwViewShell::ImplStartAction()
 
 void SwViewShell::ImplLockPaint()
 {
-if ( GetWin() && GetWin()->IsVisible() )
+if ( GetWin() && GetWin()->IsVisible() && 
!comphelper::LibreOfficeKit::isActive())
 GetWin()->EnablePaint( false ); //Also cut off the controls.
 Imp()->LockPaint();
 }
@@ -485,7 +485,7 @@ void SwViewShell::ImplUnlockPaint( bool bVirDev )
 CurrShell aCurr( this );
 if ( GetWin() && GetWin()->IsVisible() )
 {
-if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() )
+if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() && 
!comphelper::LibreOfficeKit::isActive())
 {
 //Refresh with virtual device to avoid flickering.
 VclPtrInstance pVout( *mpOut );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-16 Thread Caolán McNamara (via logerrit)
 sw/source/core/inc/viewimp.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit daa451e14b808a8388cc628082f30cbdc080573f
Author: Caolán McNamara 
AuthorDate: Mon May 15 21:09:05 2023 +0100
Commit: Michael Meeks 
CommitDate: Tue May 16 13:50:04 2023 +0200

tdf#155349 std::move of a std::optional leave behind a set std::optional

unlike std::move of a std::unique_ptr which leaves behind an empty
std::unique_ptr

so if HasPaintRegion was true before TakePaintRegion it was
still true after TakePaintRegion

Change-Id: I6569f5ccd8081cbcec42190c474a98c4e28030a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151776
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index f68c9c7f1f90..4b249154c2f8 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -152,7 +152,7 @@ public:
 
 bool AddPaintRect( const SwRect  );
 bool HasPaintRegion()  { return m_oPaintRegion.has_value(); }
-std::optional TakePaintRegion() { return 
std::move(m_oPaintRegion); }
+std::optional TakePaintRegion() { auto ret = 
std::move(m_oPaintRegion); m_oPaintRegion.reset(); return ret; }
 const std::optional& GetPaintRegion() { return 
m_oPaintRegion; }
 void DeletePaintRegion() { m_oPaintRegion.reset(); }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-11 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/utlui/navipi.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 412e4571371764dcdc5cc1347b1e6ae9a283d3ae
Author: Szymon Kłos 
AuthorDate: Thu May 11 10:20:01 2023 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 11 14:08:19 2023 +0200

navigator: lok: hide global tree on construction to not flicker

Change-Id: Icfb9b79b16dc46a722c46a08f647afaf9ad49b4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151661
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index 4f60ba96e874..99f87a13a055 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -691,6 +691,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xDocListBox->hide();
 m_xGlobalBox->hide();
 m_xGlobalToolBox->hide();
+m_xGlobalTree->HideTree();
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-09 Thread Jim Raykowski (via logerrit)
 sw/source/filter/html/htmlfldw.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2dbf19425b2494676daf0dc8674b72a3b2defe8d
Author: Jim Raykowski 
AuthorDate: Tue May 2 11:05:47 2023 -0800
Commit: Paris Oplopoios 
CommitDate: Tue May 9 14:51:17 2023 +0200

tdf#154551 check pointer before use

Change-Id: Ied215ea393760f246128610c5b7b4d50ab211f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151300
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 
Reviewed-by: Jim Raykowski 
(cherry picked from commit 20bf9f2b31343e17c14a3091d59b40a71eeb3e26)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151520
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/filter/html/htmlfldw.cxx 
b/sw/source/filter/html/htmlfldw.cxx
index 64dd86a347dc..d6d3e4ba1137 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -544,7 +544,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const 
SfxPoolItem& rHt )
 {
 const SwTextField *pTextField = rField.GetTextField();
 OSL_ENSURE( pTextField, "Where is the txt fld?" );
-if( pTextField && rWrt.m_pDoc->GetDocShell() )
+if (pTextField && rWrt.m_pDoc->GetDocShell() && 
rWrt.m_pDoc->GetDocShell()->GetView())
 {
 // ReqIF-XHTML doesn't allow specifying a background color.
 const SwViewOption* pViewOptions = 
rWrt.m_pDoc->GetDocShell()->GetView()->GetWrtShell().GetViewOptions();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-08 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/uiview/viewling.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8760c7cec6b491c7d2c2d85db698197766d7e40c
Author: Mike Kaganski 
AuthorDate: Mon May 8 14:39:18 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon May 8 20:42:04 2023 +0200

lok: also do not push the cursor in lok case

Change-Id: Iaa70edd1fd8f196f487816a324ab0dbb0d363358
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151506
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 4a998c6c7325505d90780d18304267377a69225a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151513
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index 45b1851ad3c5..9d724b304688 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -636,7 +636,8 @@ bool SwView::ExecSpellPopup(const Point& rPt)
 {
 const bool bOldViewLock = m_pWrtShell->IsViewLocked();
 m_pWrtShell->LockView( true );
-m_pWrtShell->Push();
+if (!comphelper::LibreOfficeKit::isActive())
+m_pWrtShell->Push();
 SwRect aToFill;
 
 SwCursorShell *pCursorShell = m_pWrtShell.get();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-05-08 Thread Szymon Kłos (via logerrit)
 sw/source/ui/dialog/uiregionsw.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 04fdafcd04c4482464cba545dbd6104ff11166bd
Author: Szymon Kłos 
AuthorDate: Mon May 1 16:34:07 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 8 12:23:01 2023 +0200

lok: Hide file name label

this is followup for:
commit 80c423520baa94cd3546e02cb383946a7d448ce9
lok: Hide file linking in section

Change-Id: I28f965766758d87f457e8471bf88b5db886fbba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151232
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 37a7ab66fa9c..f3560e8f2b67 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -418,15 +418,11 @@ SwEditRegionDlg::SwEditRegionDlg(weld::Window* pParent, 
SwWrtShell& rWrtSh)
 
 if(comphelper::LibreOfficeKit::isActive())
 {
-m_xBuilder->weld_label("label8")->hide(); // Link
-m_xFileCB->hide();
 m_xDDECB->hide();
 m_xDDECommandFT->hide();
 m_xFileNameFT->hide();
 m_xFileNameED->hide();
 m_xFilePB->hide();
-m_xSubRegionFT->hide();
-m_xSubRegionED->hide();
 }
 }
 
@@ -1188,7 +1184,8 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::Toggleable&, 
rButton, void)
 {
 m_xDDECommandFT->hide();
 m_xFileNameFT->set_sensitive(bFile);
-m_xFileNameFT->show();
+if(!comphelper::LibreOfficeKit::isActive())
+m_xFileNameFT->show();
 m_xSubRegionED->show();
 m_xSubRegionFT->show();
 m_xSubRegionED->set_sensitive(bFile);
@@ -1755,7 +1752,8 @@ IMPL_LINK( SwInsertSectionTabPage, DDEHdl, 
weld::Toggleable&, rButton, void )
 {
 m_xDDECommandFT->hide();
 m_xFileNameFT->set_sensitive(bFile);
-m_xFileNameFT->show();
+if(!comphelper::LibreOfficeKit::isActive())
+m_xFileNameFT->show();
 m_xSubRegionFT->show();
 m_xSubRegionED->show();
 m_xSubRegionED->set_sensitive(bFile);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source vcl/jsdialog

2023-05-03 Thread Pranam Lashkari (via logerrit)
 sw/source/ui/dialog/wordcountdialog.cxx |4 ++--
 vcl/jsdialog/enabled.cxx|1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e7bcf7aa95a31dcefc82f56b23a36424353016c3
Author: Pranam Lashkari 
AuthorDate: Tue Apr 4 14:52:26 2023 +0100
Commit: Szymon Kłos 
CommitDate: Wed May 3 09:59:23 2023 +0200

jsdialog: enabled word count dialog (writer)

set mobile fields visibility only with mobile phones

Change-Id: I5680effe9df5de01221bcf52e339490aa5dd5a6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150024
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/ui/dialog/wordcountdialog.cxx 
b/sw/source/ui/dialog/wordcountdialog.cxx
index 6dbd3c780ac4..a96e1c50b3be 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -87,7 +87,7 @@ void SwWordCountFloatDlg::showCJK(bool bShowCJK)
 {
 m_xCurrentCjkcharsFT->set_visible(bShowCJK);
 m_xDocCjkcharsFT->set_visible(bShowCJK);
-if (m_xCjkcharsLabelFT2)
+if (IS_MOBILE_PHONE && m_xCjkcharsLabelFT2)
 m_xCjkcharsLabelFT2->set_visible(bShowCJK);
 m_xCjkcharsLabelFT->set_visible(bShowCJK);
 }
@@ -96,7 +96,7 @@ void SwWordCountFloatDlg::showStandardizedPages(bool 
bShowStandardizedPages)
 {
 m_xCurrentStandardizedPagesFT->set_visible(bShowStandardizedPages);
 m_xDocStandardizedPagesFT->set_visible(bShowStandardizedPages);
-if (m_xStandardizedPagesLabelFT2)
+if (IS_MOBILE_PHONE && m_xStandardizedPagesLabelFT2)
 m_xStandardizedPagesLabelFT2->set_visible(bShowStandardizedPages);
 m_xStandardizedPagesLabelFT->set_visible(bShowStandardizedPages);
 }
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index d620b537c93c..0fd8f6e94293 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -199,6 +199,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/swriter/ui/tocstylespage.ui"
 || rUIFile == u"modules/swriter/ui/translationdialog.ui"
 || rUIFile == u"modules/swriter/ui/watermarkdialog.ui"
+|| rUIFile == u"modules/swriter/ui/wordcount.ui"
 // sfx
 || rUIFile == u"sfx/ui/cmisinfopage.ui"
 || rUIFile == u"sfx/ui/custominfopage.ui"


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-04-20 Thread Miklos Vajna (via logerrit)
 sw/source/filter/html/htmlfldw.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0d9f0c0f7c90f63d5803a3e1cc27979b505fa03a
Author: Miklos Vajna 
AuthorDate: Wed Apr 19 09:17:21 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 20 08:30:17 2023 +0200

sw: fix crash in OutHTML_SwFormatField()

Crashreport signature:

program/libswlo.so
SwDocShell::GetView()
sw/inc/docsh.hxx:222
program/libswlo.so
OutHTML_SwFormatField(Writer&, SfxPoolItem const&)
sw/source/filter/html/htmlfldw.cxx:549
...
program/libswlo.so
SwTransferable::WriteObject(tools::SvRef&, void*, 
unsigned int, com::sun::star::datatransfer::DataFlavor const&)
sw/source/uibase/dochdl/swdtflvr.cxx:?

I.e. clipboard documents don't have a doc shell, handle that.

Change-Id: I48b22087f759a11b4aa46b83b310f4a661e1fbc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150596
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/html/htmlfldw.cxx 
b/sw/source/filter/html/htmlfldw.cxx
index 2d3e6c4ca4d1..9da104508b8f 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -543,7 +543,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const 
SfxPoolItem& rHt )
 {
 const SwTextField *pTextField = rField.GetTextField();
 OSL_ENSURE( pTextField, "Where is the txt fld?" );
-if( pTextField )
+if( pTextField && rWrt.m_pDoc->GetDocShell() )
 {
 // ReqIF-XHTML doesn't allow specifying a background color.
 const SwViewOption* pViewOptions = 
rWrt.m_pDoc->GetDocShell()->GetView()->GetWrtShell().GetViewOptions();


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-04-20 Thread Miklos Vajna (via logerrit)
 sw/source/filter/ww8/ww8par.hxx   |   12 +-
 sw/source/filter/ww8/ww8par2.hxx  |4 
 sw/source/filter/ww8/ww8par6.cxx  |  194 +++---
 sw/source/filter/ww8/ww8struc.hxx |   16 +--
 4 files changed, 113 insertions(+), 113 deletions(-)

New commits:
commit 98e12ba06454f64fecb8c35b24143191e2b43c30
Author: Miklos Vajna 
AuthorDate: Mon Apr 17 09:03:47 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 20 08:28:39 2023 +0200

sw: improve naming of WW8_TablePos members

- Sp26 -> TDxaAbs
- Sp27 -> TDyaAbs
- LeMgn -> LeftMargin
- RiMgn -> RightMargin
- UpMgn -> UpperMargin
- LoMgn -> LowerMargin
- Sp29 -> TPc
- Sp37 -> PWr

(cherry picked from commit cbd7ce7ea647a2608e1d12035a634a1637482672)

Conflicts:
sw/source/filter/ww8/ww8par6.cxx

Change-Id: Icc92ea3180a05c65a8a41ff04d97a1217c7b51b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150537
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index f283182137ba..8297a184aee2 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -202,11 +202,11 @@ struct WW8FlyPara
 // Attention: *DO NOT* reorder, since parts will be
 // compared using memcmp
 bool bVer67;
-sal_Int16 nSp26, nSp27; // raw position
+sal_Int16 nTDxaAbs, nTDyaAbs; // raw position
 sal_Int16 nSp45, nSp28; // width / height
-sal_Int16 nLeMgn, nRiMgn, nUpMgn, nLoMgn;   // borders
-sal_uInt8 nSp29; // raw binding + alignment
-sal_uInt8 nSp37; // Wrap-Mode ( 1 / 2; 0 = no Apo ? )
+sal_Int16 nLeftMargin, nRightMargin, nUpperMargin, nLowerMargin;   
// borders
+sal_uInt8 nTPc; // raw binding + alignment
+sal_uInt8 nPWr; // Wrap-Mode ( 1 / 2; 0 = no Apo ? )
 WW8_BRCVer9_5 brc;  // borders Top, Left, Bottom, Right, Between
 bool bBorderLines;  // border lines
 bool bGrafApo;  // true: this frame is only used to position
@@ -215,9 +215,9 @@ struct WW8FlyPara
 
 WW8FlyPara(bool bIsVer67, const WW8FlyPara* pSrc = nullptr);
 bool operator==(const WW8FlyPara& rSrc) const;
-void Read(sal_uInt8 nSprm29, WW8PLCFx_Cp_FKP* pPap);
+void Read(sal_uInt8 nSprmTPc, WW8PLCFx_Cp_FKP* pPap);
 void ReadFull(sal_uInt8 nSprm29, SwWW8ImplReader* pIo);
-void Read(sal_uInt8 nSprm29, WW8RStyle const * pStyle);
+void Read(sal_uInt8 nSprmTPc, WW8RStyle const * pStyle);
 void ApplyTabPos(const WW8_TablePos *pTabPos);
 bool IsEmpty() const;
 };
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index c486d1b93864..db7f70447694 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -49,8 +49,8 @@ private:
 public:
 // part 1: directly derived Sw attributes
 sal_Int16 nXPos, nYPos; // Position
-sal_Int16 nLeMgn, nRiMgn;   // borders
-sal_Int16 nUpMgn, nLoMgn;   // borders
+sal_Int16 nLeftMargin, nRightMargin;   // borders
+sal_Int16 nUpperMargin, nLowerMargin;   // borders
 sal_Int16 nWidth, nHeight;  // size
 sal_Int16 nNetWidth;
 
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 7825602f7cc9..28eb3592319a 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -1640,14 +1640,14 @@ void WW8FlyPara::ApplyTabPos(const WW8_TablePos 
*pTabPos)
 {
 if (pTabPos)
 {
-nSp26 = pTabPos->nSp26;
-nSp27 = pTabPos->nSp27;
-nSp29 = pTabPos->nSp29;
-nLeMgn = pTabPos->nLeMgn;
-nRiMgn = pTabPos->nRiMgn;
-nUpMgn = pTabPos->nUpMgn;
-nLoMgn = pTabPos->nLoMgn;
-nSp37 = pTabPos->nSp37;
+nTDxaAbs = pTabPos->nTDxaAbs;
+nTDyaAbs = pTabPos->nTDyaAbs;
+nTPc = pTabPos->nTPc;
+nLeftMargin = pTabPos->nLeftMargin;
+nRightMargin = pTabPos->nRightMargin;
+nUpperMargin = pTabPos->nUpperMargin;
+nLowerMargin = pTabPos->nLowerMargin;
+nPWr = pTabPos->nPWr;
 }
 }
 
@@ -1657,16 +1657,16 @@ WW8FlyPara::WW8FlyPara(bool bIsVer67, const WW8FlyPara* 
pSrc /* = 0 */)
 memcpy( this, pSrc, sizeof( WW8FlyPara ) ); // Copy-Ctor
 else
 {
-nSp26 = 0;
-nSp27 = 0;
+nTDxaAbs = 0;
+nTDyaAbs = 0;
 nSp45 = 0;
 nSp28 = 0;
-nLeMgn = 0;
-nRiMgn = 0;
-nUpMgn = 0;
-nLoMgn = 0;
-nSp29 = 0;
-nSp37 = 2;  // Default: wrapping
+nLeftMargin = 0;
+nRightMargin = 0;
+nUpperMargin = 0;
+nLowerMargin = 0;
+nTPc = 0;
+nPWr = 2;  // Default: 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-04-20 Thread Miklos Vajna (via logerrit)
 sw/source/core/unocore/unotext.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 3b1d844d8d567b3e593cd6ab524581bb9bfc400d
Author: Miklos Vajna 
AuthorDate: Wed Apr 12 10:55:23 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 20 08:26:11 2023 +0200

sw floattable: don't try to set left margin as cell property

Cell UNO objects don't have such a property, and this generates a
warning on importing sw/qa/core/layout/data/floattable.docx, silence it.

(cherry picked from commit 8f9523b3ef464731afed61a253c958644fca6335)

Change-Id: I573c6f95edb8577e70518a9c21119a0e32b6a411
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150383
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 2f16de793d35..124325789afd 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2199,7 +2199,13 @@ lcl_ApplyCellProperties(
 {
 try
 {
-xCellPS->setPropertyValue(rName, rValue);
+static const std::initializer_list 
vDenylist = {
+u"LeftMargin",
+};
+if (std::find(vDenylist.begin(), vDenylist.end(), rName) == 
vDenylist.end())
+{
+xCellPS->setPropertyValue(rName, rValue);
+}
 }
 catch (const uno::Exception&)
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source writerfilter/source

2023-04-20 Thread Miklos Vajna (via logerrit)
 sw/source/filter/ww8/ww8par.cxx  |4 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   88 +
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|2 
 writerfilter/source/dmapper/PropertyMap.cxx  |  143 ---
 writerfilter/source/dmapper/PropertyMap.hxx  |3 
 5 files changed, 19 insertions(+), 221 deletions(-)

New commits:
commit 4313a72bd3e8100e645049baf52dcd628cc9bfea
Author: Miklos Vajna 
AuthorDate: Wed Apr 12 09:20:12 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 20 08:25:55 2023 +0200

sw floattable: remove no longer needed DOCX import heuristics

Now that IsFlySplitAllowed() is true, m_aPendingFloatingTables and
related code can go in writerfilter/.

(cherry picked from commit c50bf5a5daaae3d40f89ea0784a75a8a571c208d)

Change-Id: Id69e13e82fc447ad56b9f3926e353c203e600141
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150312
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 48ad05bc1681..b5733757216a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2577,10 +2577,6 @@ bool 
SwWW8ImplReader::FloatingTableConversion(WW8PLCFx_Cp_FKP* pPap)
 {
 // This is ww8 version of the code deciding if the table needs to be
 // in a floating frame.
-// For OOXML code, see SectionPropertyMap::FloatingTableConversion in
-// writerfilter/source/dmapper/PropertyMap.cxx
-// The two should do ~same, so if you make changes here, please check
-// that the other is in sync.
 
 // Note that this is just a list of heuristics till sw core can have a
 // table that is floating and can span over multiple pages at the same
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 6018c0df2acc..d9d5a0aa6f90 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -59,22 +59,6 @@
 #include 
 #endif
 
-namespace
-{
-bool IsFlySplitAllowed()
-{
-bool bRet
-= 
officecfg::Office::Writer::Filter::Import::DOCX::ImportFloatingTableAsSplitFly::get();
-
-if (bRet)
-{
-bRet = getenv("SW_DISABLE_FLY_SPLIT") == nullptr;
-}
-
-return bRet;
-}
-}
-
 namespace writerfilter::dmapper {
 
 using namespace ::com::sun::star;
@@ -375,29 +359,7 @@ TableStyleSheetEntry * 
DomainMapperTableHandler::endTableGetTableStyle(TableInfo
 
 comphelper::SequenceAsHashMap aGrabBag;
 
-if (nullptr != 
m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition())
-{
-TablePositionHandler *pTablePositions = 
m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition();
-
-uno::Sequence< beans::PropertyValue  > aGrabBagTS{
-comphelper::makePropertyValue("bottomFromText", 
pTablePositions->getBottomFromText()),
-comphelper::makePropertyValue("horzAnchor", 
pTablePositions->getHorzAnchor()),
-comphelper::makePropertyValue("leftFromText", 
pTablePositions->getLeftFromText()),
-comphelper::makePropertyValue("rightFromText", 
pTablePositions->getRightFromText()),
-comphelper::makePropertyValue("tblpX", 
pTablePositions->getX()),
-comphelper::makePropertyValue("tblpXSpec", 
pTablePositions->getXSpec()),
-comphelper::makePropertyValue("tblpY", 
pTablePositions->getY()),
-comphelper::makePropertyValue("tblpYSpec", 
pTablePositions->getYSpec()),
-comphelper::makePropertyValue("topFromText", 
pTablePositions->getTopFromText()),
-comphelper::makePropertyValue("vertAnchor", 
pTablePositions->getVertAnchor())
-};
-
-if (!IsFlySplitAllowed())
-{
-aGrabBag["TablePosition"] <<= aGrabBagTS;
-}
-}
-else if (bConvertToFloatingInFootnote)
+if (bConvertToFloatingInFootnote)
 {
 // define empty "TablePosition" to avoid export temporary floating
 aGrabBag["TablePosition"] = uno::Any();
@@ -1587,10 +1549,8 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 comphelper::makePropertyValue("IsFollowingTextFlow", 
true));
 }
 
-if (IsFlySplitAllowed())
-{
-
aFrameProperties.push_back(comphelper::makePropertyValue("IsSplitAllowed", 
true));
-}
+// A text frame created for floating tables is always allowed to 
split.
+
aFrameProperties.push_back(comphelper::makePropertyValue("IsSplitAllowed", 
true));
 
 // In case the document ends with a table, we're called after
 // 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-04-01 Thread Paris Oplopoios (via logerrit)
 sw/source/uibase/app/apphdl.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 0dca587be41718d2d88e80fc585829ad83da59ea
Author: Paris Oplopoios 
AuthorDate: Sat Apr 1 18:03:44 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Sat Apr 1 19:29:52 2023 +0200

Notify LOK that application background color has been changed

Notify LOK when the application background color changes in Writer

Change-Id: Ibc900cc8b3253aaa5b53602a007566896f04d9df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149906
Tested-by: Paris Oplopoios 
Reviewed-by: Paris Oplopoios 

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index ed1c5ee792d4..1bf1145a5dec 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -80,6 +80,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -984,9 +985,15 @@ void SwModule::ConfigurationChanged( 
utl::ConfigurationBroadcaster* pBrdCst, Con
 {
 SwViewOption aNewOptions = 
*pSwView->GetWrtShell().GetViewOptions();
 
aNewOptions.SetThemeName(m_pColorConfig->GetCurrentSchemeName());
-aNewOptions.SetColorConfig(*m_pColorConfig);
+SwViewColors aViewColors(*m_pColorConfig);
+aNewOptions.SetColorConfig(aViewColors);
 pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
 pViewShell->GetWindow()->Invalidate();
+if (bOnlyInvalidateCurrentView)
+{
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
+
aViewColors.m_aAppBackgroundColor.AsRGBHexString().toUtf8().getStr());
+}
 }
 }
 if (bOnlyInvalidateCurrentView)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-03-27 Thread Justin Luth (via logerrit)
 sw/source/core/doc/docfly.cxx |   38 +-
 1 file changed, 17 insertions(+), 21 deletions(-)

New commits:
commit ed12347e0194896e5f0853b9f8533f0cde27e3cc
Author: Justin Luth 
AuthorDate: Thu Mar 16 18:49:12 2023 -0400
Commit: Miklos Vajna 
CommitDate: Mon Mar 27 21:14:38 2023 +

tdf#135581 sw UI: keep image in place when changing anchor

Changing the anchor type should not move an image around.

The only time we have a position to fix AFAICS is when
the anchor changes and the RelationOrient is no longer appropriate.
In that case we always get a new p*OrientItem.
If GetPos changed, then that means the user (or earlier algorithm)
already adjusted for the change. If there is no difference in GetPos
even though the relation changed, then that is the only time we (likely)
need to recalculate.

So the typical example requiring an adjustment would be a change
from "to paragraph" at text position 0 to a "to page" anchor.
In this case "page" has no relationship to "text margins"
and thus needs to base the absolute position 0 on page instead of text,
meaning that the margins would need to be added to the absolute position.

This code is basically unchanged since initial import.
I have no idea why it could possibly be good to change
the position when there is no new information given
(no pHoriOrientItem/pVertOrientItem).

[I checked and "from top" and "from bottom"
 are both == NONE, as well of course as "from left".]

Change-Id: Ib89ad9ba26c8826ed43f6d4505a82502b9ad8af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149012
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149634
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 5ddc713ff4af..998f123ee6c0 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -363,26 +363,25 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& 
rFormat, SfxItemSet& rSet, boo
 case RndStdIds::FLY_AT_FLY:// LAYER_IMPL
 case RndStdIds::FLY_AT_PAGE:
 {
-// If no position attributes are coming in, we correct the 
position in a way
-// such that the fly's document coordinates are preserved.
-// If only the alignment changes in the position attributes 
(text::RelOrientation::FRAME
-// vs. text::RelOrientation::PRTAREA), we also correct the 
position.
+// If only the anchor type has changed (char -> para -> page) and 
the absolute position
+// is unchanged even though there is a new relative orientation
+// (likely because the old orientation was not valid for the new 
anchor type),
+// then adjust the position to account for the moved anchor 
position.
 const SwFormatHoriOrient* pHoriOrientItem = rSet.GetItemIfSet( 
RES_HORI_ORIENT, false );
 
 SwFormatHoriOrient aOldH( rFormat.GetHoriOrient() );
 bool bPutOldH(false);
 
-if( text::HoriOrientation::NONE == aOldH.GetHoriOrient() && ( 
!pHoriOrientItem ||
-aOldH.GetPos() == pHoriOrientItem->GetPos() ))
+if (text::HoriOrientation::NONE == aOldH.GetHoriOrient() && 
pHoriOrientItem
+&& text::HoriOrientation::NONE == 
pHoriOrientItem->GetHoriOrient()
+&& aOldH.GetPos() == pHoriOrientItem->GetPos())
 {
 SwTwips nPos = (RndStdIds::FLY_AS_CHAR == nOld) ? 0 : 
aOldH.GetPos();
 nPos += aOldAnchorPos.getX() - aNewAnchorPos.getX();
 
-if( pHoriOrientItem )
-{
-aOldH.SetHoriOrient( pHoriOrientItem->GetHoriOrient() );
-aOldH.SetRelationOrient( 
pHoriOrientItem->GetRelationOrient() );
-}
+assert(aOldH.GetRelationOrient() != 
pHoriOrientItem->GetRelationOrient());
+aOldH.SetRelationOrient(pHoriOrientItem->GetRelationOrient());
+
 aOldH.SetPos( nPos );
 bPutOldH = true;
 }
@@ -406,19 +405,16 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& 
rFormat, SfxItemSet& rSet, boo
 const SwFormatVertOrient* pVertOrientItem = rSet.GetItemIfSet( 
RES_VERT_ORIENT, false );
 SwFormatVertOrient aOldV( rFormat.GetVertOrient() );
 
-// #i28922# - correction: compare 
-if( text::VertOrientation::NONE == aOldV.GetVertOrient() && 
(!pVertOrientItem ||
-aOldV.GetPos() == pVertOrientItem->GetPos() ) )
+if (text::VertOrientation::NONE == aOldV.GetVertOrient() && 
pVertOrientItem
+&& text::VertOrientation::NONE == 
pVertOrientItem->GetVertOrient()
+&& aOldV.GetPos() == pVertOrientItem->GetPos())
   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source sw/uiconfig vcl/jsdialog

2023-03-21 Thread Pranam Lashkari (via logerrit)
 sw/source/ui/frmdlg/column.cxx |2 +-
 sw/uiconfig/swriter/ui/columndialog.ui |   20 +---
 vcl/jsdialog/enabled.cxx   |1 +
 3 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit f50d009885c499e55db35571ace83f2ed7effbfe
Author: Pranam Lashkari 
AuthorDate: Mon Mar 20 18:35:31 2023 +0530
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 12:59:32 2023 +

jsdialog: enable column dialog (writer)

Change-Id: I4b91d271d766d8efeaddc3c3775513184036c5f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149167
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 5692a906e279..c2a24ad18ef6 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -89,7 +89,7 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& 
rSh)
 , m_bSectionChanged(false)
 , m_bSelSectionChanged(false)
 , m_bFrameChanged(false)
-, m_xContentArea(m_xDialog->weld_content_area())
+, m_xContentArea(m_xBuilder->weld_container("content"))
 , m_xOkButton(m_xBuilder->weld_button("ok"))
 {
 SwRect aRect;
diff --git a/sw/uiconfig/swriter/ui/columndialog.ui 
b/sw/uiconfig/swriter/ui/columndialog.ui
index 5bf4d5d9d999..2162f1e5b2fd 100644
--- a/sw/uiconfig/swriter/ui/columndialog.ui
+++ b/sw/uiconfig/swriter/ui/columndialog.ui
@@ -17,6 +17,23 @@
 False
 vertical
 12
+
+  
+True
+False
+vertical
+12
+
+  
+
+  
+  
+False
+True
+begin
+0
+  
+
 
   
 False
@@ -74,9 +91,6 @@
 0
   
 
-
-  
-
   
 
 
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 6595cf7971c0..7efb9de2bb84 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -128,6 +128,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/swriter/ui/captionoptions.ui"
 || rUIFile == u"modules/swriter/ui/characterproperties.ui"
 || rUIFile == u"modules/swriter/ui/charurlpage.ui"
+|| rUIFile == u"modules/swriter/ui/columndialog.ui"
 || rUIFile == u"modules/swriter/ui/columnpage.ui"
 || rUIFile == u"modules/swriter/ui/contentcontroldlg.ui"
 || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui"


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-16 Thread Paris Oplopoios (via logerrit)
 sw/source/uibase/docvw/PostItMgr.cxx |1 +
 sw/source/uibase/uno/unotxdoc.cxx|1 +
 2 files changed, 2 insertions(+)

New commits:
commit 55aed3396961031fc1fe5432a1a5b38fe75995ba
Author: Paris Oplopoios 
AuthorDate: Tue Feb 14 19:06:29 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Feb 16 09:09:30 2023 +

Add paraIdParent to LOK notification attributes

paraIdParent has to do with which comments are replies to other comments
which differs from the parent attribute which has to do with
which comments are in the same thread with other comments

Change-Id: I27feba55eadeeff22d409f69d8df976ad85e0ba6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147070
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index cb07ee9c33a5..0e478d9bea6b 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -169,6 +169,7 @@ namespace {
 
 aAnnotation.put("id", pField->GetPostItId());
 aAnnotation.put("parent", pWin->CalcParent());
+aAnnotation.put("paraIdParent", pField->GetParentId());
 aAnnotation.put("author", pField->GetPar1().toUtf8().getStr());
 aAnnotation.put("text", pField->GetPar2().toUtf8().getStr());
 aAnnotation.put("resolved", pField->GetResolved() ? "true" : 
"false");
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 26521c2ccf45..173340162d83 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3329,6 +3329,7 @@ void SwXTextDocument::getPostIts(tools::JsonWriter& 
rJsonWriter)
 auto commentNode = rJsonWriter.startStruct();
 rJsonWriter.put("id", pField->GetPostItId());
 rJsonWriter.put("parent", pWin->CalcParent());
+rJsonWriter.put("paraIdParent", pField->GetParentId());
 rJsonWriter.put("author", pField->GetPar1());
 rJsonWriter.put("text", pField->GetPar2());
 rJsonWriter.put("resolved", pField->GetResolved() ? "true" : "false");


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-14 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/uiview/view.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 895853e617579e99aadcfc23afdb68de79db720f
Author: Miklos Vajna 
AuthorDate: Wed Feb 8 09:04:14 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Feb 14 09:27:42 2023 +0100

sw: fix crash in SwView::AttrChangedNotify()

Crashreport signature:

program/../program/libswlo.so
SwView::AttrChangedNotify(LinkParamNone*)
sw/source/uibase/uiview/view.cxx:507
program/../program/libswlo.so
SwWrtShell::DrawSelChanged()
sw/source/uibase/wrtsh/wrtsh3.cxx:261
program/../program/libswlo.so
SwDrawView::MarkListHasChanged()
sw/source/core/draw/dview.cxx:767
program/libmergedlo.so
SdrMarkView::MarkObj(SdrObject*, SdrPageView*, bool, bool, 
std::vector >&&)
svx/source/svdraw/svdmrkv.cxx:2196
program/../program/libswlo.so
SwDrawContact::DisconnectFromLayout(bool)

/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/stl_vector.h:336

This seems to happen when the SwDrawContent delete is in progress, so
we no longer have the shells at hand that are usually present.

Change-Id: Iba0601654c946b85e7c2de33fe76d99b26a20eae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146649
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Justin Luth 
(cherry picked from commit 25fb91ec9a4908fad631c890fe780b273f89a71e)

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 8ed0e97301dc..8c3ffcde2322 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -528,6 +528,11 @@ IMPL_LINK_NOARG(SwView, AttrChangedNotify, LinkParamNone*, 
void)
 if ( GetEditWin().IsChainMode() )
 GetEditWin().SetChainMode( false );
 
+if (!m_pWrtShell || !GetDocShell())
+{
+return;
+}
+
 //Opt: Not if PaintLocked. During unlock a notify will be once more 
triggered.
 if( !m_pWrtShell->IsPaintLocked() && !g_bNoInterrupt &&
 GetDocShell()->IsReadOnly() )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-09 Thread Mert Tumer (via logerrit)
 sw/source/ui/table/instable.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 1e472f9b0191bbde8f63b26b4d739cc97293a99b
Author: Mert Tumer 
AuthorDate: Fri Mar 25 17:56:30 2022 +0300
Commit: Szymon Kłos 
CommitDate: Thu Feb 9 19:12:34 2023 +

make default selected table style to Default Table Style for only online

unfortunately when the table has a style 
sw/qa/uitest/writer_tests4/tdf115573.py fails
because tables that have pre-applied style resets the style of the elements 
in their cells
when a new row is inserted and the ui test above relies on that. For now 
this is LOK only

Signed-off-by: Mert Tumer 
Change-Id: I2f60376fc2d929498aef45259a5ef291922ccdcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132124
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gökay ŞATIR 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146723
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 8620b204b51a9e0552a0002f7f06292bdfad37a7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146702
Tested-by: Szymon Kłos 

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 7383da93bdef..a5aa4cd83853 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -148,8 +148,13 @@ void SwInsTableDlg::InitAutoTableFormat()
 // Change this min variable if you add autotable manually.
 minTableIndexInLb = 1;
 maxTableIndexInLb = minTableIndexInLb + 
static_cast(m_xTableTable->size());
-m_xLbFormat->select( minTableIndexInLb );
-m_tbIndex = lbIndexToTableIndex( minTableIndexInLb );
+// 1 means default table style
+// unfortunately when the table has a style 
sw/qa/uitest/writer_tests4/tdf115573.py fails
+// because tables that have pre-applied style resets the style of the 
elements in their cells
+// when a new row is inserted and the ui test above relies on that. For 
now this is LOK only
+m_lbIndex = comphelper::LibreOfficeKit::isActive() ? 1 : 0;
+m_xLbFormat->select(m_lbIndex);
+m_tbIndex = lbIndexToTableIndex(m_lbIndex);
 
 SelFormatHdl( *m_xLbFormat );
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-09 Thread Mert Tumer (via logerrit)
 sw/source/ui/table/instable.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 51cea0559c373d54f65e0630c0eda1eaf0ac2fe2
Author: Mert Tumer 
AuthorDate: Wed Mar 23 14:23:23 2022 +0300
Commit: Szymon Kłos 
CommitDate: Thu Feb 9 19:12:05 2023 +

sw: change inserttable style option default to 1

Right now it is default to NONE in the list
if the user explicitly choses otherwise but that
does not align with inserttable option on the toolbar
there it is defaulted to "Default Table Style"
1 means "Default Table Style"

Signed-off-by: Mert Tumer 
Change-Id: I1db19f0292ac6775653b0db3f2860fea9e3b0adf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131971
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146722
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
(cherry picked from commit ef46afe71751929b8b17d278d83c8e3ceefc862f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146701

diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index e10279add315..7383da93bdef 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -148,9 +148,8 @@ void SwInsTableDlg::InitAutoTableFormat()
 // Change this min variable if you add autotable manually.
 minTableIndexInLb = 1;
 maxTableIndexInLb = minTableIndexInLb + 
static_cast(m_xTableTable->size());
-m_lbIndex = 0;
-m_xLbFormat->select( m_lbIndex );
-m_tbIndex = lbIndexToTableIndex(m_lbIndex);
+m_xLbFormat->select( minTableIndexInLb );
+m_tbIndex = lbIndexToTableIndex( minTableIndexInLb );
 
 SelFormatHdl( *m_xLbFormat );
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-09 Thread Szymon Kłos (via logerrit)
 sw/source/ui/frmdlg/cption.cxx |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 4f1527e066d440f2a15c595a38a8fcfe7d8bcfec
Author: Szymon Kłos 
AuthorDate: Mon Feb 6 17:27:50 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Feb 9 12:59:19 2023 +

tdf#153244 apply caption options

Change-Id: I2aa53a85ab9f38ddf74caac85047235ea85a40af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146590
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 6a7b3d59d790cb8ea55353fe4173d71a13931d50)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146694
Tested-by: Szymon Kłos 

diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index ab23c1f09987..e6b387a42910 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -72,14 +72,6 @@ public:
 
 void  SetCharacterStyle(const OUString& rStyle);
 OUString  GetCharacterStyle() const;
-
-virtual short run() override
-{
-int nRet = GenericDialogController::run();
-if (nRet == RET_OK)
-Apply();
-return nRet;
-}
 };
 
 }
@@ -319,6 +311,7 @@ IMPL_LINK_NOARG(SwCaptionDialog, OptionHdl, weld::Button&, 
void)
 
 GenericDialogController::runAsync(pDlg, [pDlg, this](sal_Int32 nResult){
 if (nResult == RET_OK) {
+pDlg->Apply();
 m_bCopyAttributes = pDlg->IsApplyBorderAndShadow();
 m_sCharacterStyle = pDlg->GetCharacterStyle();
 //#i61007# order of captions


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-04 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/txtfrm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit edafe2784f7e3edd6207fae1d1e82c9596da4925
Author: Mike Kaganski 
AuthorDate: Fri Feb 3 17:21:19 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sat Feb 4 11:28:31 2023 +

Avoid UB

as seen in https://ci.libreoffice.org/job/lo_ubsan/2671/ after commit
333183d9a72d1e2b7ae65145092efec5e357ad14 ("tdf#153304: Add undo entries
and set modified in SwXFrame::setProperty*", 2023-02-02):

  [_RUN_] testImagePropsCreateUndoAndModifyDoc::TestBody
  warn:sal.file:4195:4195:sal/osl/unx/file_misc.cxx:401: Invalid directory 
URL
  warn:basic:4195:4195:basic/source/uno/namecont.cxx:953: Cannot access 
extensions!
  warn:sal.file:4195:4195:sal/osl/unx/file_misc.cxx:401: Invalid directory 
URL
  warn:basic:4195:4195:basic/source/uno/namecont.cxx:953: Cannot access 
extensions!
  warn:legacy.osl:4195:4195:sw/source/core/text/porfly.cxx:198: CalcFlyPos: 
Not Found!
  warn:legacy.osl:4195:4195:sw/source/core/text/txtfrm.cxx:3092: Prepare: 
Why me?
  /include/o3tl/strong_int.hxx:143:40: runtime error: signed integer 
overflow: 2147483647 + 1 cannot be represented in type 'int'
  #0 0x7f79b14fee7a in o3tl::strong_int 
o3tl::operator+(o3tl::strong_int const&, o3tl::strong_int const&) 
/include/o3tl/strong_int.hxx:143:40
  #1 0x7f79b553f7a5 in SwTextFrame::IsIdxInside(o3tl::strong_int, o3tl::strong_int) const 
/sw/source/core/text/txtfrm.cxx:1665:71
  #2 0x7f79b559be6a in SwTextFrame::InvalidateRange(SwCharRange const&, 
long) /sw/source/core/text/txtfrm.cxx:1689:10
  #3 0x7f79b5566a79 in SwTextFrame::Prepare(PrepareHint, void const*, 
bool) /sw/source/core/text/txtfrm.cxx:3093:17
  #4 0x7f79b438c1b5 in SwFlyInContentFrame::SwClientNotify(SwModify 
const&, SfxHint const&) /sw/source/core/layout/flyincnt.cxx:137:28
  #5 0x7f79b17c06e2 in SwModify::CallSwClientNotify(SfxHint const&) 
const /sw/source/core/attr/calbck.cxx:322:18
  #6 0x7f79b17c09e5 in 
sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const 
/sw/source/core/attr/calbck.cxx:327:15
  #7 0x7f79b17be1ef in SwModify::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/attr/calbck.cxx:313:5
  #8 0x7f79b1801e06 in SwFormat::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/attr/format.cxx:314:19
  #9 0x7f79b414fa7c in SwFrameFormat::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2713:15
  #10 0x7f79b17c0f13 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet 
const&, SwAttrSet&, SwAttrSet&) /sw/source/core/attr/calbck.cxx:336:13
  #11 0x7f79b18090b5 in SwFormat::SetFormatAttr(SfxPoolItem const&) 
/sw/source/core/attr/format.cxx:520:13
  #12 0x7f79b23c2e54 in SwDoc::SetFlyFrameAnchor(SwFrameFormat&, 
SfxItemSet&, bool) /sw/source/core/doc/docfly.cxx:326:13
  #13 0x7f79b23cac22 in lcl_SetFlyFrameAttr(SwDoc&, signed char 
(SwDoc::*)(SwFrameFormat&, SfxItemSet&, bool), SwFrameFormat&, SfxItemSet&) 
/sw/source/core/doc/docfly.cxx:451:17
  #14 0x7f79b23ca43d in SwDoc::SetFlyFrameAttr(SwFrameFormat&, 
SfxItemSet&) /sw/source/core/doc/docfly.cxx:560:23
  #15 0x7f79b64818d2 in SwXFrame::setPropertyValue(rtl::OUString 
const&, com::sun::star::uno::Any const&) 
/sw/source/core/unocore/unoframe.cxx:1921:36
  #16 0x7f79d562de12 in 
testImagePropsCreateUndoAndModifyDoc::TestBody() 
/sw/qa/core/undo/undo.cxx:136:13
  ...

See 
https://gerrit.libreoffice.org/c/core/+/146484/7#message-8ce5de47f17cc701fc58b932e80b1de8469053bf
Hope it makes sense.

Change-Id: Id5c86ed4c093993557a24e00b3288ccdfa4de2ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146542
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 274587f634e57b59b34f352409453b394064cadd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146522
Tested-by: Mike Kaganski 

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 86cfe6555431..aa371cd3df63 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1657,6 +1657,8 @@ TextFrameIndex SwTextFrame::FindBrk(std::u16string_view 
aText,
 
 bool SwTextFrame::IsIdxInside(TextFrameIndex const nPos, TextFrameIndex const 
nLen) const
 {
+if (nPos == TextFrameIndex(COMPLETE_STRING)) // the "not found" range
+return false;
 // Silence over-eager warning emitted at least by GCC trunk towards 6:
 #if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-03 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/translatehelper.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a6b3eb3fbcccdc4873f10c946313f12712b3b231
Author: Szymon Kłos 
AuthorDate: Wed Nov 30 17:53:34 2022 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 21:59:42 2023 +0100

deepl: don't introduce new bullets

Used HTML should be free from new line characters and also 
marks so we don't generate new lines.

Change-Id: I02b8f9a9af9f93e8d90a7f4a22ea02c8e1f47651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143507
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144948
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/translatehelper.cxx 
b/sw/source/uibase/shells/translatehelper.cxx
index 8933d22db27f..507c2812a675 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -45,7 +45,7 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
 SolarMutexGuard gMutex;
 OString aResult;
 WriterRef xWrt;
-GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter", OUString(), xWrt);
+GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter,NoPrettyPrint", OUString(), 
xWrt);
 if (pCursor != nullptr)
 {
 SvMemoryStream aMemoryStream;
@@ -63,6 +63,13 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
 aResult = aResult.replaceAll("", "");
 }
+
+// HTML has for that  and  also does new line
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("\n", "").trim();
 return aResult;
 }
 return {};


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-02-02 Thread Mike Kaganski (via logerrit)
 sw/source/core/unocore/unoframe.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 8325a8e3d5d442b5bb93e339e17a404b0576a351
Author: Mike Kaganski 
AuthorDate: Wed Feb 1 12:16:34 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Feb 2 17:01:30 2023 +

Throw early on invalid state

The result of GetFrameFormat call was dereferenced unconditionally
in the unit conversion code, despite it can obviously return NULL.

Change-Id: I30117f1db942a8ff108a959891d8763c4d44fb39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146429
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 62797844fed93d5e33505d544606e4d4e2530f8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146413
Tested-by: Mike Kaganski 

diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index 381109f4e97e..cf1c9575c987 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1400,6 +1400,8 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 {
 SolarMutexGuard aGuard;
 SwFrameFormat* pFormat = GetFrameFormat();
+if (!pFormat && !IsDescriptor())
+throw uno::RuntimeException();
 
 // Hack to support hidden property to transfer textDirection
 if(rPropertyName == "FRMDirection")
@@ -1409,9 +1411,9 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 SwDocModifyAndUndoGuard guard(*pFormat);
 SvxFrameDirectionItem aItem(SvxFrameDirection::Environment, 
RES_FRAMEDIR);
 aItem.PutValue(_rValue, 0);
-GetFrameFormat()->SetFormatAttr(aItem);
+pFormat->SetFormatAttr(aItem);
 }
-else if(IsDescriptor())
+else // if(IsDescriptor())
 {
 m_pProps->SetProperty(o3tl::narrowing(RES_FRAMEDIR), 
0, _rValue);
 }
@@ -1450,7 +1452,7 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 
 if(bDoIt)
 {
-const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : 
GetFrameFormat()->GetDoc());
+const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : pFormat->GetDoc());
 const SfxItemPool& rPool = pDoc->GetAttrPool();
 const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
 
@@ -1941,7 +1943,7 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 }
 }
 }
-else if(IsDescriptor())
+else // if(IsDescriptor())
 {
 m_pProps->SetProperty(pEntry->nWID, nMemberId, aValue);
 if( FN_UNO_FRAME_STYLE_NAME == pEntry->nWID )
@@ -1986,8 +1988,6 @@ void SwXFrame::setPropertyValue(const OUString& 
rPropertyName, const ::uno::Any&
 m_nVisibleAreaHeight = sAspect.toInt64();
 }
 }
-else
-throw uno::RuntimeException();
 }
 
 namespace


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-01-22 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/wrtw8sty.cxx |   46 +++---
 1 file changed, 43 insertions(+), 3 deletions(-)

New commits:
commit a9213f4bd6334892fde0aa6127acc9d1dc486f7d
Author: Mike Kaganski 
AuthorDate: Sun Jan 22 08:33:17 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Jan 22 08:13:55 2023 +

tdf#153094: Fix default character style index, and document it

Thanks Caolán for catching it, and providing the relevant
documentation pointers! See

https://gerrit.libreoffice.org/c/core/+/145806/1#message-c4a9649a8381bd1885d39923fe278b86bc07a228

Change-Id: I6379579befda583f609f87d973fcfaacf9f1fed6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145963
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit a00556ada3214d7584bebd4d6ac33bf5c25a3467)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145936
Tested-by: Mike Kaganski 

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index b2b84295e504..11bf0471812a 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -121,15 +121,55 @@ public:
 
 //  Styles
 
-// Immediately after reserved slots, character styles begin
-#define WW8_RESERVED_SLOTS 15 // tdf#153094: the value is important
+// According to [MS-DOC] v20221115 2.9.271 STSH,
+// "The beginning of the rglpstd array is reserved for specific "fixed-index" 
application-defined
+//  styles. A particular fixed-index, application-defined style has the same 
istd value in every
+//  stylesheet. The rglpstd MUST contain an LPStd for each of these 
fixed-index styles and the order
+//  MUST match the order in the following table.
+//
+//  istd   sti of application-defined style (see sti in StdfBase)
+//  0  0
+//  1  1
+//  2  2
+//  3  3
+//  4  4
+//  5  5
+//  6  6
+//  7  7
+//  8  8
+//  9  9
+//  10 65
+//  11 105
+//  12 107
+//  13 Reserved for future use
+//  14 Reserved for future use"
+//
+// And [MS-OE376] v20220816 2.1.236 Part 4 Section 2.7.3.9, name (Primary 
Style Name)
+// specifies the following mapping:
+//
+//  stiStyle nameStyle type
+//  0  Normalparagraph
+//  1  heading 1 paragraph
+//  2  heading 2 paragraph
+//  3  heading 3 paragraph
+//  4  heading 4 paragraph
+//  5  heading 5 paragraph
+//  6  heading 6 paragraph
+//  7  heading 7 paragraph
+//  8  heading 8 paragraph
+//  9  heading 9 paragraph
+//  65 Default Paragraph Fontcharacter
+//  105Normal Table  table
+//  107No List   numbering
+
+#define WW8_RESERVED_SLOTS 15
 
 // GetId( SwCharFormat ) for use in text -> zero is not allowed,
 // use "Default Char Style" instead
 sal_uInt16 MSWordExportBase::GetId( const SwCharFormat* pFormat ) const
 {
 sal_uInt16 nRet = m_pStyles->GetSlot( pFormat );
-return ( nRet != 0x0fff ) ? nRet : WW8_RESERVED_SLOTS;  // Default 
Char Style
+return ( nRet != 0x0fff ) ? nRet : 10;  // Default Char Style
 }
 
 // GetId( SwTextFormatColl ) for use in TextNodes -> zero is not allowed,


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-01-20 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/wrtw8sty.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5a1a3f0ca3c585cccd88c82871b78f96d79955ff
Author: Mike Kaganski 
AuthorDate: Fri Jan 20 11:41:06 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jan 20 11:35:57 2023 +

tdf#153094: it seems that DOC requires WW8_RESERVED_SLOTS = 15

Regression from commit a2a08463e0299d514e6e555ae61c68bb0e4348d0,
where I mistakenly assumed that the value is just to accommodate
enough entries. I don't know where it's documented, but this
fixes the bug.

Change-Id: Ifecf5d294222e3a40cb23f7c147694dbdf35e405
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145869
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145889

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 7900bd1ba3c8..b2b84295e504 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -122,7 +122,7 @@ public:
 //  Styles
 
 // Immediately after reserved slots, character styles begin
-#define WW8_RESERVED_SLOTS 10
+#define WW8_RESERVED_SLOTS 15 // tdf#153094: the value is important
 
 // GetId( SwCharFormat ) for use in text -> zero is not allowed,
 // use "Default Char Style" instead


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-01-19 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 9c2adfdfed56b19adf90e7ec3f0b8fbf1c819784
Author: Mike Kaganski 
AuthorDate: Wed Jan 18 16:16:07 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 19 15:48:17 2023 +

Simplify a bit

Change-Id: I3e3d13f468192967056af5c5c21709352a7acf8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145741
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit ce805e052a4d0278190603021103dfe53439b463)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145795
Tested-by: Mike Kaganski 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index fbdedc3b64c9..2e14a90dbfe7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3669,10 +3669,9 @@ void AttributeOutputBase::ParaOutlineLevelBase( const 
SfxUInt16Item& rItem )
 
 void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
 {
-const SwTextNode* pTextNd = nullptr;
 if (rNumRule.GetValue().isEmpty())
 {
-ParaNumRule_Impl(pTextNd, 0, 0);
+ParaNumRule_Impl(nullptr, 0, 0);
 return;
 }
 const SwNumRule* pRule = GetExport().m_rDoc.FindNumRulePtr(
@@ -3683,17 +3682,13 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 sal_uInt16 nNumId = GetExport().GetNumberingId(*pRule) + 1;
 sal_uInt8 nLvl = 0;
 
-if (!GetExport().m_pOutFormatNode)
-{
-ParaNumRule_Impl(pTextNd, nLvl, nNumId);
-return;
-}
-
-if (pTextNd = dynamic_cast(GetExport().m_pOutFormatNode); pTextNd)
+const SwTextNode* pTextNd = dynamic_cast(GetExport().m_pOutFormatNode);
+if (pTextNd)
 {
 if( pTextNd->IsCountedInList())
 {
 nLvl = std::clamp(pTextNd->GetActualListLevel(), 0, MAXLEVEL - 1);
+const bool bListRestart = pTextNd->IsListRestart();
 
 if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // 
FIXME
 {
@@ -3701,7 +3696,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 OUString const listId(pTextNd->GetListId());
 if (!listId.isEmpty()
 && (listId != pRule->GetDefaultListId() // default list id 
uses the 1:1 mapping
-|| pTextNd->IsListRestart())// or restarting 
previous list
+|| bListRestart)// or restarting previous list
 )
 {
 SwList const*const pList(
@@ -3712,7 +3707,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 GetExport().m_rDoc.FindNumRulePtr(
 pList->GetDefaultListStyleName()));
 assert(pAbstractRule);
-if (pAbstractRule == pRule && 
!pTextNd->IsListRestart())
+if (pAbstractRule == pRule && !bListRestart)
 {
 // different list, but no override
 nNumId = GetExport().DuplicateAbsNum(listId, 
*pAbstractRule) + 1;
@@ -3722,7 +3717,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 nNumId = GetExport().OverrideNumRule(
 *pRule, listId, *pAbstractRule) + 1;
 
-if (pTextNd->IsListRestart())
+if (bListRestart)
 {
 // For restarted lists we should also keep 
value for
 // future w:lvlOverride / w:startOverride
@@ -3733,7 +3728,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 }
 }
 }
-else if (pTextNd->IsListRestart())
+else if (bListRestart)
 {
 sal_uInt16 nStartWith = 
static_cast(pTextNd->GetActualListStartValue());
 nNumId = GetExport().DuplicateNumRule(pRule, nLvl, nStartWith);