summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-02-12 14:36:43 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-02-12 16:34:14 +0100
commit052b5d375307245223e694bb835d86966c370d3b (patch)
tree3639cbe96f5e0c43a83e2884f64e59908d2e166d
parenta2bd7470368b2a44edf25680bd250c4d2b7428cb (diff)
sw btlr writing mode: implement UNO API
The custom code in SwXCell::setPropertyValue() was added in commit 5a5597655a4bf12e4ca07c9c2b6f6221e217f080 (tentative fix for fdo#30474#, 2010-11-26), which suggests that not handling all constants from text::WritingMode2 was not intentional. Later the writerfilter side (which is the only client of this hidden property) was adapted to use text::WritingMode2, so do the same here. This implicitly adds support for the new text::WritingMode2::BT_LR as well. Change-Id: I37d8eaa844847cb19e7503b2d973069f9895e6bc Reviewed-on: https://gerrit.libreoffice.org/67730 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
-rw-r--r--editeng/source/items/frmitems.cxx6
-rw-r--r--sw/source/core/unocore/unotbl.cxx8
2 files changed, 7 insertions, 7 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 2d6c98d59531..961f9ccffb51 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3867,6 +3867,9 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal,
case text::WritingMode2::TB_LR:
SetValue( SvxFrameDirection::Vertical_LR_TB );
break;
+ case text::WritingMode2::BT_LR:
+ SetValue( SvxFrameDirection::Vertical_LR_BT );
+ break;
case text::WritingMode2::PAGE:
SetValue( SvxFrameDirection::Environment );
break;
@@ -3900,6 +3903,9 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal,
case SvxFrameDirection::Vertical_LR_TB:
nVal = text::WritingMode2::TB_LR;
break;
+ case SvxFrameDirection::Vertical_LR_BT:
+ nVal = text::WritingMode2::BT_LR;
+ break;
case SvxFrameDirection::Environment:
nVal = text::WritingMode2::PAGE;
break;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index dd409f7529ca..df40b80a11a0 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1022,14 +1022,8 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
if(rPropertyName == "FRMDirection")
{
SvxFrameDirection eDir = SvxFrameDirection::Environment;
- try
- {
- const std::array<SvxFrameDirection, 3> vDirs = { SvxFrameDirection::Horizontal_LR_TB, SvxFrameDirection::Horizontal_RL_TB, SvxFrameDirection::Vertical_RL_TB };
- eDir = vDirs.at(aValue.get<sal_Int32>());
- } catch(std::out_of_range &) {
- SAL_WARN("sw.uno", "unknown direction code, maybe it's a bitfield");
- }
SvxFrameDirectionItem aItem(eDir, RES_FRAMEDIR);
+ aItem.PutValue(aValue, 0);
pBox->GetFrameFormat()->SetFormatAttr(aItem);
}
else if(rPropertyName == "TableRedlineParams")