summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Szűcs <attila.szucs@collabora.com>2024-02-21 10:57:14 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-21 15:13:32 +0100
commit57ac7b73e898cf8889819d7f3beb3608e61b179b (patch)
tree7d1cac2c6afa142f059e16fcb774b54789a2ab62
parent95017739a05c4f515fc42caebfd1e01e8a9ba160 (diff)
tdf#67347 fix regression stacked text in calc
Added a new element (STACKED) to EEControlBits. It would be better to use only ONECHARPERLINE, but calc and impress used it from different places, and couldn't recognise each other, so they may overwrite each other. With this fix they both set a separate flag, and editeng check if any of the flags are set. regression was made by: I535da45e3a2f2d1550bad2a40e9909e0d561d0ef Change-Id: I60496059f3ce2773b232970bf2c3b7264ce64c5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--editeng/source/editeng/editstt2.hxx4
-rw-r--r--editeng/source/editeng/impedit3.cxx6
-rw-r--r--include/editeng/editstat.hxx5
3 files changed, 9 insertions, 6 deletions
diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx
index 334622b23495..09e7f02e1831 100644
--- a/editeng/source/editeng/editstt2.hxx
+++ b/editeng/source/editeng/editstt2.hxx
@@ -47,7 +47,9 @@ public:
{ return bool( nControlBits & EEControlBits::UNDOATTRIBS ); }
bool OneCharPerLine() const
- { return bool( nControlBits & EEControlBits::ONECHARPERLINE ); }
+ {
+ return bool(nControlBits & (EEControlBits::ONECHARPERLINE | EEControlBits::STACKED));
+ }
bool IsOutliner() const
{ return bool( nControlBits & EEControlBits::OUTLINER ); }
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 8bbcebcebf2a..0c8b9bae8223 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -695,13 +695,13 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
return false;
}
- //If the paragraph SvxFrameDirection is Stacked, use ONECHARPERLINE
+ //If the paragraph SvxFrameDirection is Stacked, use STACKED
const SvxFrameDirectionItem* pFrameDirItem = &GetParaAttrib(nPara, EE_PARA_WRITINGDIR);
bool bStacked = pFrameDirItem->GetValue() == SvxFrameDirection::Stacked;
if (bStacked)
- maStatus.TurnOnFlags(EEControlBits::ONECHARPERLINE);
+ maStatus.TurnOnFlags(EEControlBits::STACKED);
else
- maStatus.TurnOffFlags(EEControlBits::ONECHARPERLINE);
+ maStatus.TurnOffFlags(EEControlBits::STACKED);
// Initialization...
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 29653d5eec4f..4e839254df1c 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -32,7 +32,7 @@ enum class EEControlBits
PASTESPECIAL = 0x00000010, // Allow PasteSpecial
AUTOINDENTING = 0x00000020, // Automatic indenting
UNDOATTRIBS = 0x00000040, // Undo for Attributes...
- ONECHARPERLINE = 0x00000080, // One character per line
+ ONECHARPERLINE = 0x00000080, // One character per line (used in calc)
NOCOLORS = 0x00000100, // Engine: No Color
OUTLINER = 0x00000200, // Special treatment Outliner/Outline mode
OUTLINER2 = 0x00000400, // Special treatment Outliner/Page
@@ -51,10 +51,11 @@ enum class EEControlBits
FORMAT100 = 0x01000000, // Always format to 100%
ULSPACESUMMATION = 0x02000000, // MS Compat: sum SA and SB, not maximum value
SINGLELINE = 0x04000000, // One line for all text
+ STACKED = 0x08000000, // Same as ONECHARPERLINE (used in impress)
};
namespace o3tl
{
- template<> struct typed_flags<EEControlBits> : is_typed_flags<EEControlBits, 0x07ffffff> {};
+ template<> struct typed_flags<EEControlBits> : is_typed_flags<EEControlBits, 0x0fffffff> {};
}
enum class EVControlBits