summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-12-10 12:48:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-12-10 20:35:35 +0100
commite1807c61f1abc6cab74d0fa8ccac7a8ef9114b88 (patch)
tree07ead5860940989cb03c4792abed50fa883ba9a1
parent837902468522531c8d0ad35612dce53d4facb668 (diff)
Related: tdf#129300 rotation reference edge had no real description
Change-Id: I739c577d9a5f98969daa0c8fb3b7a63dea40743c Reviewed-on: https://gerrit.libreoffice.org/84831 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/svx/rotmodit.hxx2
-rw-r--r--svx/inc/rotationstrings.hrc36
-rw-r--r--svx/source/items/rotmodit.cxx13
3 files changed, 49 insertions, 2 deletions
diff --git a/include/svx/rotmodit.hxx b/include/svx/rotmodit.hxx
index c76b569a903f..013bf98d1240 100644
--- a/include/svx/rotmodit.hxx
+++ b/include/svx/rotmodit.hxx
@@ -51,6 +51,8 @@ public:
OUString& rText, const IntlWrapper& ) const override;
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
+private:
+ static OUString GetValueText(SvxRotateMode nVal);
};
diff --git a/svx/inc/rotationstrings.hrc b/svx/inc/rotationstrings.hrc
new file mode 100644
index 000000000000..dfc6c7aa7b44
--- /dev/null
+++ b/svx/inc/rotationstrings.hrc
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVX_INC_ROTATIONSTRINGS_HRC
+#define INCLUDED_SVX_INC_ROTATIONSTRINGS_HRC
+
+#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+
+const char* RID_SVXITEMS_ROTATE_MODE[] =
+{
+ // enum SvxRotateMode ----------------------------------------------------
+ NC_("RID_SVXITEMS_ROTATE_MODE_STANDARD", "Rotation only within cell"),
+ NC_("RID_SVXITEMS_ROTATE_MODE_TOP", "From upper cell edge"),
+ NC_("RID_SVXITEMS_ROTATE_MODE_CENTER", "From vertical middle cell"),
+ NC_("RID_SVXITEMS_ROTATE_MODE_BOTTOM", "From lower cell edge"),
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index 8b378cdf5cc9..3ec86cc1ab3d 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -31,7 +31,9 @@
#include <com/sun/star/table/CellOrientation.hpp>
#include <com/sun/star/table/CellAddress.hpp>
+#include <svx/dialmgr.hxx>
#include <svx/rotmodit.hxx>
+#include <rotationstrings.hrc>
using namespace ::com::sun::star;
@@ -56,6 +58,12 @@ SvxRotateModeItem::~SvxRotateModeItem()
{
}
+OUString SvxRotateModeItem::GetValueText(SvxRotateMode nVal)
+{
+ assert(nVal <= SVX_ROTATE_MODE_BOTTOM && "enum overflow!");
+ return SvxResId(RID_SVXITEMS_ROTATE_MODE[static_cast<size_t>(nVal)]);
+}
+
bool SvxRotateModeItem::GetPresentation(
SfxItemPresentation ePres,
MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/,
@@ -66,8 +74,9 @@ bool SvxRotateModeItem::GetPresentation(
switch ( ePres )
{
case SfxItemPresentation::Complete:
- rText += "...: ";
- [[fallthrough]]; // break; // FALL THROUGH!!!
+ rText += GetValueText(GetValue());
+ return true;
+ break;
case SfxItemPresentation::Nameless:
rText += OUString::number( GetValue() );