summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-16 18:08:46 +0100
committerAndras Timar <andras.timar@collabora.com>2018-02-20 16:29:47 +0100
commitbc5bf595c1c8fe61ecf461786d0b7ebba7a74f1b (patch)
treea11405d586d405f3dbf44fd0de9b07960bfcc9c7 /include
parent744c267f8f6de0ba4a829874992c1404b5b79e28 (diff)
tdf#115783 sd: fix lost char attributes during in-table copy&paste
The SvxFontHeightItem (12pt) is originally a character-level property on the table cell (covering the whole cell text) but when the user sets the font height of the cell, sdr::properties::CellProperties::ItemSetChanged() will turn that into a paragraph-level property. This is fine, except that this way the property has unclear semantics when the user pastes single-paragraph content into an existing paragraph. (Keep the old paragraph properties? Use the new ones?) The current behavior is that sd::View::OnEndPasteOrDrop() calls into ContentAttribs::SetStyleSheet() at the end of the paste, which removes paragraph-level formatting (giving visibility to the from-style 18pt font height this way for the existing content), so both the old and the new paragraph formatting is lost. Improve the situation by copying these paragraph-level character properties back to character-level before paste at the paste position (so doc model is back to the state after load), that way font height and similar properties are not removed by the on-end-paste handler. (cherry picked from commit f0c25c751cf8e166a84b289746bce6202a40391d) Conflicts: editeng/source/outliner/outliner.cxx sd/qa/unit/tiledrendering/tiledrendering.cxx sd/source/ui/view/sdview.cxx Change-Id: I43d321dedcda6c0df9b009b9d99c3544f783473c Reviewed-on: https://gerrit.libreoffice.org/49977 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editeng.hxx2
-rw-r--r--include/editeng/outliner.hxx2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index ff9bed37e27c..8190648e66e0 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -311,6 +311,8 @@ public:
virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
+ /// Set attributes from rSet an all characters of nPara.
+ void SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet);
void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags = GetAttribsFlags::ALL ) const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index dd83ed03c9cd..febc2abe1069 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -904,6 +904,8 @@ public:
// Only for EditEngine mode
void QuickInsertText( const OUString& rText, const ESelection& rSel );
void QuickDelete( const ESelection& rSel );
+ /// Set attributes from rSet an all characters of nPara.
+ void SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet);
void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
void QuickFormatDoc();