diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-11-14 08:20:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-11-14 09:34:10 +0100 |
commit | c1a535ee2db757b2e40683dc918cbad8b7429cfa (patch) | |
tree | 972d63ca4728f663e0dea8a3f2be1f08175512a9 /sw/source/uibase/frmdlg/frmmgr.cxx | |
parent | d93d11529e7922fe391edcc839af8a3b4044b809 (diff) |
sw floattable, insert UI: fix unexpected border and spacing
Select an inline table (make sure the whole table is selected), insert a
frame, then the frame width is already calculated from the table width,
but an unexpected second frame border / spacing is also added. Given
that the table already has its own border, adding a second border by
default makes no sense.
It's possible to disable default borders in SetFrameSizeFromTable(), but
in case the borders are unchanged, the dialog's output item set will
still contain no border info, so we will still get the default borders.
Fix the problem by making this explicit: if the dialog's input item set
had border info and the output item set had none, then still copy over
the border info from the input to the output in
SwTextShell::ExecInsert().
This automatically fixes the unwanted border spacing as well, so the
default frame properties are on par with the ones created by Word import
filters.
Change-Id: I4c9f165dad7a8bb70cfcfadaea4466a8d174b46e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159399
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/frmdlg/frmmgr.cxx')
-rw-r--r-- | sw/source/uibase/frmdlg/frmmgr.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index eb38c1c803f7..cdfeb267b990 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -666,6 +666,10 @@ void SwFlyFrameAttrMgr::SetFrameSizeFromTable() // The whole table is selected: default fly width should be the table width // in this case. m_aSet.Put(pTableFormat->GetFrameSize()); + + // The table can have its own border already, so an additional fly border makes no sense. + SvxBoxItem aBoxItem(RES_BOX); + m_aSet.Put(aBoxItem); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |