summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/inc/content.hxx6
-rw-r--r--sw/source/uibase/inc/conttree.hxx4
-rw-r--r--sw/source/uibase/inc/prcntfld.hxx22
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx12
-rw-r--r--sw/source/uibase/utlui/prcntfld.cxx97
5 files changed, 71 insertions, 70 deletions
diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index cb3e1030e8f5..2a7c9d64adab 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -138,14 +138,14 @@ public:
class SwGraphicContent final : public SwContent
{
- OUString sLink;
+ OUString m_sLink;
public:
SwGraphicContent(const SwContentType* pCnt, const OUString& rName, const OUString& rLink, tools::Long nYPos)
- : SwContent( pCnt, rName, nYPos ), sLink( rLink )
+ : SwContent( pCnt, rName, nYPos ), m_sLink( rLink )
{}
virtual ~SwGraphicContent() override;
- const OUString& GetLink() const {return sLink;}
+ const OUString& GetLink() const {return m_sLink;}
};
class SwTOXBaseContent final : public SwContent
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx
index cf1246425ac0..a93b421d20d7 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -304,7 +304,7 @@ private:
std::unique_ptr<SwGlblDocContent> m_pDocContent;
std::unique_ptr<sfx2::DocumentInserter> m_pDocInserter;
- static const SfxObjectShell* pShowShell;
+ static const SfxObjectShell* s_pShowShell;
void InsertRegion( const SwGlblDocContent* _pContent,
const css::uno::Sequence< OUString >& _rFiles );
@@ -327,7 +327,7 @@ private:
void GotoContent(const SwGlblDocContent*);
MenuEnableFlags GetEnableFlags() const;
- static void SetShowShell(const SfxObjectShell*pSet) {pShowShell = pSet;}
+ static void SetShowShell(const SfxObjectShell*pSet) {s_pShowShell = pSet;}
DECL_STATIC_LINK(SwGlobalTree, ShowFrameHdl, void*, void);
public:
diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx
index aabb04b8aa30..d8393d3097be 100644
--- a/sw/source/uibase/inc/prcntfld.hxx
+++ b/sw/source/uibase/inc/prcntfld.hxx
@@ -27,16 +27,16 @@ class SW_DLLPUBLIC SwPercentField
{
std::unique_ptr<weld::MetricSpinButton> m_pField;
- sal_Int64 nRefValue; // 100% value for conversion (in Twips)
- sal_Int64 nOldMax;
- sal_Int64 nOldMin;
- int nOldSpinSize;
- int nOldPageSize;
- sal_Int64 nLastPercent;
- sal_Int64 nLastValue;
- sal_uInt16 nOldDigits;
- FieldUnit eOldUnit;
- bool bLockAutoCalculation; //prevent recalculation of percent values when the
+ sal_Int64 m_nRefValue; // 100% value for conversion (in Twips)
+ sal_Int64 m_nOldMax;
+ sal_Int64 m_nOldMin;
+ int m_nOldSpinSize;
+ int m_nOldPageSize;
+ sal_Int64 m_nLastPercent;
+ sal_Int64 m_nLastValue;
+ sal_uInt16 m_nOldDigits;
+ FieldUnit m_eOldUnit;
+ bool m_bLockAutoCalculation; //prevent recalculation of percent values when the
//reference value is changed
SAL_DLLPRIVATE static int ImpPower10(sal_uInt16 n);
@@ -78,7 +78,7 @@ public:
void ShowPercent(bool bPercent);
- void LockAutoCalculation(bool bLock) {bLockAutoCalculation = bLock;}
+ void LockAutoCalculation(bool bLock) {m_bLockAutoCalculation = bLock;}
};
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 922b4fbc2059..7e044f64ad65 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -56,23 +56,23 @@ using namespace ::com::sun::star::uno;
#define GLOBAL_UPDATE_TIMEOUT 2000
-const SfxObjectShell* SwGlobalTree::pShowShell = nullptr;
+const SfxObjectShell* SwGlobalTree::s_pShowShell = nullptr;
namespace {
class SwGlobalFrameListener_Impl : public SfxListener
{
- bool bValid;
+ bool m_bValid;
public:
explicit SwGlobalFrameListener_Impl(SfxViewFrame& rFrame)
- : bValid(true)
+ : m_bValid(true)
{
StartListening(rFrame);
}
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
- bool IsValid() const {return bValid;}
+ bool IsValid() const {return m_bValid;}
};
}
@@ -80,7 +80,7 @@ public:
void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if( rHint.GetId() == SfxHintId::Dying)
- bValid = false;
+ m_bValid = false;
}
namespace {
@@ -997,7 +997,7 @@ SwNavigationPI* SwGlobalTree::GetParentWindow()
IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void)
{
- SfxViewFrame* pFirst = pShowShell ? SfxViewFrame::GetFirst(pShowShell) : nullptr;
+ SfxViewFrame* pFirst = s_pShowShell ? SfxViewFrame::GetFirst(s_pShowShell) : nullptr;
if (pFirst)
pFirst->ToTop();
SwGlobalTree::SetShowShell(nullptr);
diff --git a/sw/source/uibase/utlui/prcntfld.cxx b/sw/source/uibase/utlui/prcntfld.cxx
index ba30639a00fc..4c8eede6619d 100644
--- a/sw/source/uibase/utlui/prcntfld.cxx
+++ b/sw/source/uibase/utlui/prcntfld.cxx
@@ -22,28 +22,28 @@
SwPercentField::SwPercentField(std::unique_ptr<weld::MetricSpinButton> pControl)
: m_pField(std::move(pControl))
- , nOldMax(0)
- , nOldMin(0)
- , nLastPercent(-1)
- , nLastValue(-1)
- , nOldDigits(m_pField->get_digits())
- , eOldUnit(FieldUnit::NONE)
- , bLockAutoCalculation(false)
+ , m_nOldMax(0)
+ , m_nOldMin(0)
+ , m_nLastPercent(-1)
+ , m_nLastValue(-1)
+ , m_nOldDigits(m_pField->get_digits())
+ , m_eOldUnit(FieldUnit::NONE)
+ , m_bLockAutoCalculation(false)
{
sal_Int64 nMin, nMax;
m_pField->get_range(nMin, nMax, FieldUnit::TWIP);
- nRefValue = DenormalizePercent(nMax);
- m_pField->get_increments(nOldSpinSize, nOldPageSize, FieldUnit::NONE);
+ m_nRefValue = DenormalizePercent(nMax);
+ m_pField->get_increments(m_nOldSpinSize, m_nOldPageSize, FieldUnit::NONE);
}
void SwPercentField::SetRefValue(sal_Int64 nValue)
{
- sal_Int64 nRealValue = GetRealValue(eOldUnit);
+ sal_Int64 nRealValue = GetRealValue(m_eOldUnit);
- nRefValue = nValue;
+ m_nRefValue = nValue;
- if (!bLockAutoCalculation && (m_pField->get_unit() == FieldUnit::PERCENT))
- set_value(nRealValue, eOldUnit);
+ if (!m_bLockAutoCalculation && (m_pField->get_unit() == FieldUnit::PERCENT))
+ set_value(nRealValue, m_eOldUnit);
}
void SwPercentField::ShowPercent(bool bPercent)
@@ -58,50 +58,51 @@ void SwPercentField::ShowPercent(bool bPercent)
{
nOldValue = get_value();
- eOldUnit = m_pField->get_unit();
- nOldDigits = m_pField->get_digits();
- m_pField->get_range(nOldMin, nOldMax, FieldUnit::NONE);
- m_pField->get_increments(nOldSpinSize, nOldPageSize, FieldUnit::NONE);
+ m_eOldUnit = m_pField->get_unit();
+ m_nOldDigits = m_pField->get_digits();
+ m_pField->get_range(m_nOldMin, m_nOldMax, FieldUnit::NONE);
+ m_pField->get_increments(m_nOldSpinSize, m_nOldPageSize, FieldUnit::NONE);
m_pField->set_unit(FieldUnit::PERCENT);
m_pField->set_digits(0);
sal_Int64 nCurrentWidth
- = vcl::ConvertValue(nOldMin, 0, nOldDigits, eOldUnit, FieldUnit::TWIP);
+ = vcl::ConvertValue(m_nOldMin, 0, m_nOldDigits, m_eOldUnit, FieldUnit::TWIP);
// round to 0.5 percent
- int nPercent = nRefValue ? (((nCurrentWidth * 10) / nRefValue + 5) / 10) : 0;
+ int nPercent = m_nRefValue ? (((nCurrentWidth * 10) / m_nRefValue + 5) / 10) : 0;
m_pField->set_range(std::max(1, nPercent), 100, FieldUnit::NONE);
m_pField->set_increments(5, 10, FieldUnit::NONE);
- if (nOldValue != nLastValue)
+ if (nOldValue != m_nLastValue)
{
- nCurrentWidth = vcl::ConvertValue(nOldValue, 0, nOldDigits, eOldUnit, FieldUnit::TWIP);
- nPercent = nRefValue ? (((nCurrentWidth * 10) / nRefValue + 5) / 10) : 0;
+ nCurrentWidth
+ = vcl::ConvertValue(nOldValue, 0, m_nOldDigits, m_eOldUnit, FieldUnit::TWIP);
+ nPercent = m_nRefValue ? (((nCurrentWidth * 10) / m_nRefValue + 5) / 10) : 0;
m_pField->set_value(nPercent, FieldUnit::NONE);
- nLastPercent = nPercent;
- nLastValue = nOldValue;
+ m_nLastPercent = nPercent;
+ m_nLastValue = nOldValue;
}
else
- m_pField->set_value(nLastPercent, FieldUnit::NONE);
+ m_pField->set_value(m_nLastPercent, FieldUnit::NONE);
}
else
{
sal_Int64 nOldPercent = get_value(FieldUnit::PERCENT);
- nOldValue = Convert(get_value(), m_pField->get_unit(), eOldUnit);
+ nOldValue = Convert(get_value(), m_pField->get_unit(), m_eOldUnit);
- m_pField->set_unit(eOldUnit);
- m_pField->set_digits(nOldDigits);
- m_pField->set_range(nOldMin, nOldMax, FieldUnit::NONE);
- m_pField->set_increments(nOldSpinSize, nOldPageSize, FieldUnit::NONE);
+ m_pField->set_unit(m_eOldUnit);
+ m_pField->set_digits(m_nOldDigits);
+ m_pField->set_range(m_nOldMin, m_nOldMax, FieldUnit::NONE);
+ m_pField->set_increments(m_nOldSpinSize, m_nOldPageSize, FieldUnit::NONE);
- if (nOldPercent != nLastPercent)
+ if (nOldPercent != m_nLastPercent)
{
- set_value(nOldValue, eOldUnit);
- nLastPercent = nOldPercent;
- nLastValue = nOldValue;
+ set_value(nOldValue, m_eOldUnit);
+ m_nLastPercent = nOldPercent;
+ m_nLastValue = nOldValue;
}
else
- set_value(nLastValue, eOldUnit);
+ set_value(m_nLastValue, m_eOldUnit);
}
}
@@ -116,14 +117,14 @@ void SwPercentField::set_value(sal_Int64 nNewValue, FieldUnit eInUnit)
if (eInUnit == FieldUnit::TWIP)
{
nCurrentWidth
- = vcl::ConvertValue(nNewValue, 0, nOldDigits, FieldUnit::TWIP, FieldUnit::TWIP);
+ = vcl::ConvertValue(nNewValue, 0, m_nOldDigits, FieldUnit::TWIP, FieldUnit::TWIP);
}
else
{
- sal_Int64 nValue = Convert(nNewValue, eInUnit, eOldUnit);
- nCurrentWidth = vcl::ConvertValue(nValue, 0, nOldDigits, eOldUnit, FieldUnit::TWIP);
+ sal_Int64 nValue = Convert(nNewValue, eInUnit, m_eOldUnit);
+ nCurrentWidth = vcl::ConvertValue(nValue, 0, m_nOldDigits, m_eOldUnit, FieldUnit::TWIP);
}
- nPercent = nRefValue ? (((nCurrentWidth * 10) / nRefValue + 5) / 10) : 0;
+ nPercent = m_nRefValue ? (((nCurrentWidth * 10) / m_nRefValue + 5) / 10) : 0;
m_pField->set_value(nPercent, FieldUnit::NONE);
}
}
@@ -140,8 +141,8 @@ void SwPercentField::set_min(sal_Int64 nNewMin, FieldUnit eInUnit)
else
{
if (eInUnit == FieldUnit::NONE)
- eInUnit = eOldUnit;
- nOldMin = Convert(nNewMin, eInUnit, eOldUnit);
+ eInUnit = m_eOldUnit;
+ m_nOldMin = Convert(nNewMin, eInUnit, m_eOldUnit);
int nPercent = Convert(nNewMin, eInUnit, FieldUnit::PERCENT);
m_pField->set_min(std::max(1, nPercent), FieldUnit::NONE);
@@ -159,7 +160,7 @@ sal_Int64 SwPercentField::NormalizePercent(sal_Int64 nValue)
if (m_pField->get_unit() != FieldUnit::PERCENT)
nValue = m_pField->normalize(nValue);
else
- nValue = nValue * ImpPower10(nOldDigits);
+ nValue = nValue * ImpPower10(m_nOldDigits);
return nValue;
}
@@ -169,7 +170,7 @@ sal_Int64 SwPercentField::DenormalizePercent(sal_Int64 nValue)
nValue = m_pField->denormalize(nValue);
else
{
- int nFactor = ImpPower10(nOldDigits);
+ int nFactor = ImpPower10(m_nOldDigits);
nValue = ((nValue + (nFactor / 2)) / nFactor);
}
return nValue;
@@ -202,12 +203,12 @@ sal_Int64 SwPercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit
if (eInUnit == FieldUnit::PERCENT)
{
// Convert to metric
- sal_Int64 nTwipValue = (nRefValue * nValue + 50) / 100;
+ sal_Int64 nTwipValue = (m_nRefValue * nValue + 50) / 100;
if (eOutUnit == FieldUnit::TWIP) // Only convert if necessary
return NormalizePercent(nTwipValue);
else
- return vcl::ConvertValue(NormalizePercent(nTwipValue), 0, nOldDigits, FieldUnit::TWIP,
+ return vcl::ConvertValue(NormalizePercent(nTwipValue), 0, m_nOldDigits, FieldUnit::TWIP,
eOutUnit);
}
@@ -220,11 +221,11 @@ sal_Int64 SwPercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit
if (eInUnit == FieldUnit::TWIP) // Only convert if necessary
nCurrentWidth = nValue;
else
- nCurrentWidth = vcl::ConvertValue(nValue, 0, nOldDigits, eInUnit, FieldUnit::TWIP);
+ nCurrentWidth = vcl::ConvertValue(nValue, 0, m_nOldDigits, eInUnit, FieldUnit::TWIP);
// Round to 0.5 percent
- return nRefValue ? (((nCurrentWidth * 1000) / nRefValue + 5) / 10) : 0;
+ return m_nRefValue ? (((nCurrentWidth * 1000) / m_nRefValue + 5) / 10) : 0;
}
- return vcl::ConvertValue(nValue, 0, nOldDigits, eInUnit, eOutUnit);
+ return vcl::ConvertValue(nValue, 0, m_nOldDigits, eInUnit, eOutUnit);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */