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>
diff --git a/include/svx/rotmodit.hxx b/include/svx/rotmodit.hxx
index c76b569..013bf98 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 0000000..dfc6c7a
--- /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 8b378cd..3ec86cc 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() );