summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-02-25 15:58:06 -0400
committerAndras Timar <andras.timar@collabora.com>2020-02-26 15:28:43 +0100
commit70321a866ce3be1eeea1037a4f688db759c115b2 (patch)
treebf8bc3abc40616918773709a53723c5967234e33
parentdb593a614cc22d81d66b0783a08e64377011ad4a (diff)
lok: remove complex rotation / alignment settings
It is very confusing for mobile user the text orientation properties, let's remove the property for mobile view. Change-Id: I4150f9ed7343d38fd00ee66fa5afffe40426b984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89479 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx45
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.hxx2
2 files changed, 47 insertions, 0 deletions
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 6955fa47d2b5..68760df7c81d 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -29,6 +29,8 @@
#include <svx/dlgutil.hxx>
#include <vcl/toolbox.hxx>
#include <svx/sidebar/SidebarDialControl.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <comphelper/lok.hxx>
using namespace css;
using namespace css::uno;
@@ -133,6 +135,49 @@ void AlignmentPropertyPanel::Initialize()
mpMtrAngle->SetDropDownLineCount(mpMtrAngle->GetEntryCount());
}
+namespace {
+
+void eraseNode(boost::property_tree::ptree& pTree, const std::string& aValue)
+{
+ boost::optional<boost::property_tree::ptree&> pId;
+ boost::optional<boost::property_tree::ptree&> pSubTree = pTree.get_child_optional("children");
+
+ if (pSubTree)
+ {
+ boost::property_tree::ptree::iterator itFound = pSubTree.get().end();
+ for (boost::property_tree::ptree::iterator it = pSubTree.get().begin(); it != pSubTree.get().end(); ++it)
+ {
+ pId = it->second.get_child_optional("id");
+ if (pId && pId.get().get_value<std::string>("") == aValue)
+ {
+ itFound = it;
+ break;
+ }
+
+ eraseNode(it->second, aValue);
+ }
+
+ if (itFound != pSubTree.get().end())
+ {
+ pSubTree.get().erase(itFound);
+ }
+ }
+}
+
+}
+
+boost::property_tree::ptree AlignmentPropertyPanel::DumpAsPropertyTree()
+{
+ boost::property_tree::ptree aTree = PanelLayout::DumpAsPropertyTree();
+
+ if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ {
+ eraseNode(aTree, "textorientbox");
+ }
+
+ return aTree;
+}
+
IMPL_LINK( AlignmentPropertyPanel, ReferenceEdgeHdl, Button*, pControl, void )
{
SvxRotateMode eMode;
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index 9df3f424d885..86c37c3cb57a 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -60,6 +60,8 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ virtual boost::property_tree::ptree DumpAsPropertyTree() override;
+
// constructor/destructor
AlignmentPropertyPanel(
vcl::Window* pParent,