sw: prefix members of ProgressBarHelper, SvI18NMapEntry_Key, ...
... XMLBase64ImportContext and XMLErrors See tdf#94879 for motivation. Change-Id: Ic8d1b3515727981c50d8f3a64fe6bf030f0521fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151491 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
@@ -31,37 +31,37 @@ inline constexpr OUStringLiteral XML_PROGRESSREPEAT = u"ProgressRepeat";
|
||||
|
||||
class XMLOFF_DLLPUBLIC ProgressBarHelper
|
||||
{
|
||||
css::uno::Reference < css::task::XStatusIndicator > xStatusIndicator;
|
||||
sal_Int32 nRange;
|
||||
sal_Int32 nReference;
|
||||
sal_Int32 nValue;
|
||||
double fOldPercent;
|
||||
bool bStrict;
|
||||
css::uno::Reference < css::task::XStatusIndicator > m_xStatusIndicator;
|
||||
sal_Int32 m_nRange;
|
||||
sal_Int32 m_nReference;
|
||||
sal_Int32 m_nValue;
|
||||
double m_fOldPercent;
|
||||
bool m_bStrict;
|
||||
// #96469#; if the value goes over the Range the progressbar starts again
|
||||
bool bRepeat;
|
||||
bool m_bRepeat;
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
bool bFailure;
|
||||
bool m_bFailure;
|
||||
#endif
|
||||
public:
|
||||
ProgressBarHelper(css::uno::Reference < css::task::XStatusIndicator> xStatusIndicator,
|
||||
const bool bStrict);
|
||||
~ProgressBarHelper();
|
||||
|
||||
void SetRange(sal_Int32 nVal) { nRange = nVal; }
|
||||
void SetReference(sal_Int32 nVal) { nReference = nVal; }
|
||||
void SetRange(sal_Int32 nVal) { m_nRange = nVal; }
|
||||
void SetReference(sal_Int32 nVal) { m_nReference = nVal; }
|
||||
void SetValue(sal_Int32 nValue);
|
||||
void SetRepeat(bool bValue) { bRepeat = bValue; }
|
||||
void Increment(sal_Int32 nInc = 1) { SetValue( nValue+nInc ); }
|
||||
void End() { if (xStatusIndicator.is()) xStatusIndicator->end(); }
|
||||
void SetRepeat(bool bValue) { m_bRepeat = bValue; }
|
||||
void Increment(sal_Int32 nInc = 1) { SetValue( m_nValue+nInc ); }
|
||||
void End() { if (m_xStatusIndicator.is()) m_xStatusIndicator->end(); }
|
||||
|
||||
// set the new reference and returns the new value which gives the
|
||||
// Progress Bar the same position as before
|
||||
void ChangeReference(sal_Int32 nNewReference);
|
||||
|
||||
sal_Int32 GetReference() const { return nReference; }
|
||||
sal_Int32 GetValue() const { return nValue; }
|
||||
bool GetRepeat() const { return bRepeat; }
|
||||
sal_Int32 GetReference() const { return m_nReference; }
|
||||
sal_Int32 GetValue() const { return m_nValue; }
|
||||
bool GetRepeat() const { return m_bRepeat; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace com::sun::star::io { class XOutputStream; }
|
||||
|
||||
class XMLOFF_DLLPUBLIC XMLBase64ImportContext final : public SvXMLImportContext
|
||||
{
|
||||
css::uno::Reference< css::io::XOutputStream > xOut;
|
||||
css::uno::Reference< css::io::XOutputStream > m_xOut;
|
||||
OUStringBuffer maCharBuffer;
|
||||
|
||||
public:
|
||||
|
||||
@@ -28,20 +28,20 @@
|
||||
|
||||
class SvI18NMapEntry_Key
|
||||
{
|
||||
sal_uInt16 nKind;
|
||||
OUString aName;
|
||||
sal_uInt16 m_nKind;
|
||||
OUString m_aName;
|
||||
public:
|
||||
SvI18NMapEntry_Key( sal_uInt16 nKnd, OUString sName ) :
|
||||
nKind( nKnd ),
|
||||
aName(std::move( sName ))
|
||||
m_nKind( nKnd ),
|
||||
m_aName(std::move( sName ))
|
||||
{
|
||||
}
|
||||
|
||||
bool operator<( const SvI18NMapEntry_Key& r ) const
|
||||
{
|
||||
return nKind < r.nKind ||
|
||||
( nKind == r.nKind &&
|
||||
aName < r.aName);
|
||||
return m_nKind < r.m_nKind ||
|
||||
( m_nKind == r.m_nKind &&
|
||||
m_aName < r.m_aName);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class XMLErrors
|
||||
/// definition of type for error list
|
||||
typedef ::std::vector<ErrorRecord> ErrorList;
|
||||
|
||||
ErrorList aErrors; /// list of error records
|
||||
ErrorList m_aErrors; /// list of error records
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -29,15 +29,15 @@ const float fProgressStep = 0.5;
|
||||
|
||||
ProgressBarHelper::ProgressBarHelper(css::uno::Reference < css::task::XStatusIndicator> xTempStatusIndicator,
|
||||
const bool bTempStrict)
|
||||
: xStatusIndicator(std::move(xTempStatusIndicator))
|
||||
, nRange(nDefaultProgressBarRange)
|
||||
, nReference(100)
|
||||
, nValue(0)
|
||||
, fOldPercent(0.0)
|
||||
, bStrict(bTempStrict)
|
||||
, bRepeat(true)
|
||||
: m_xStatusIndicator(std::move(xTempStatusIndicator))
|
||||
, m_nRange(nDefaultProgressBarRange)
|
||||
, m_nReference(100)
|
||||
, m_nValue(0)
|
||||
, m_fOldPercent(0.0)
|
||||
, m_bStrict(bTempStrict)
|
||||
, m_bRepeat(true)
|
||||
#ifdef DBG_UTIL
|
||||
, bFailure(false)
|
||||
, m_bFailure(false)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
@@ -48,59 +48,59 @@ ProgressBarHelper::~ProgressBarHelper()
|
||||
|
||||
void ProgressBarHelper::ChangeReference(sal_Int32 nNewReference)
|
||||
{
|
||||
if((nNewReference <= 0) || (nNewReference == nReference))
|
||||
if((nNewReference <= 0) || (nNewReference == m_nReference))
|
||||
return;
|
||||
|
||||
if (nReference)
|
||||
if (m_nReference)
|
||||
{
|
||||
double fPercent(static_cast<double>(nNewReference) / nReference);
|
||||
double fValue(nValue * fPercent);
|
||||
nValue = static_cast<sal_Int32>(fValue);
|
||||
nReference = nNewReference;
|
||||
double fPercent(static_cast<double>(nNewReference) / m_nReference);
|
||||
double fValue(m_nValue * fPercent);
|
||||
m_nValue = static_cast<sal_Int32>(fValue);
|
||||
m_nReference = nNewReference;
|
||||
}
|
||||
else
|
||||
{
|
||||
nReference = nNewReference;
|
||||
nValue = 0;
|
||||
m_nReference = nNewReference;
|
||||
m_nValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ProgressBarHelper::SetValue(sal_Int32 nTempValue)
|
||||
{
|
||||
if (!xStatusIndicator.is() || (nReference <= 0))
|
||||
if (!m_xStatusIndicator.is() || (m_nReference <= 0))
|
||||
return;
|
||||
|
||||
if ((nTempValue >= nValue) && (!bStrict || (nTempValue <= nReference)))
|
||||
if ((nTempValue >= m_nValue) && (!m_bStrict || (nTempValue <= m_nReference)))
|
||||
{
|
||||
// #91317# no progress bar with values > 100%
|
||||
if (nTempValue > nReference)
|
||||
if (nTempValue > m_nReference)
|
||||
{
|
||||
if (!bRepeat)
|
||||
nValue = nReference;
|
||||
if (!m_bRepeat)
|
||||
m_nValue = m_nReference;
|
||||
else
|
||||
{
|
||||
xStatusIndicator->reset();
|
||||
nValue = 0;
|
||||
m_xStatusIndicator->reset();
|
||||
m_nValue = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
nValue = nTempValue;
|
||||
m_nValue = nTempValue;
|
||||
|
||||
double fValue(nValue);
|
||||
double fNewValue ((fValue * nRange) / nReference);
|
||||
double fValue(m_nValue);
|
||||
double fNewValue ((fValue * m_nRange) / m_nReference);
|
||||
|
||||
double fPercent((fNewValue * 100) / nRange);
|
||||
if (fPercent >= (fOldPercent + fProgressStep) || fPercent < fOldPercent)
|
||||
double fPercent((fNewValue * 100) / m_nRange);
|
||||
if (fPercent >= (m_fOldPercent + fProgressStep) || fPercent < m_fOldPercent)
|
||||
{
|
||||
xStatusIndicator->setValue(static_cast<sal_Int32>(fNewValue));
|
||||
fOldPercent = fPercent;
|
||||
m_xStatusIndicator->setValue(static_cast<sal_Int32>(fNewValue));
|
||||
m_fOldPercent = fPercent;
|
||||
}
|
||||
}
|
||||
#ifdef DBG_UTIL
|
||||
else if (!bFailure)
|
||||
else if (!m_bFailure)
|
||||
{
|
||||
OSL_FAIL("tried to set a wrong value on the progressbar");
|
||||
bFailure = true;
|
||||
m_bFailure = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ XMLBase64ImportContext::XMLBase64ImportContext(
|
||||
SvXMLImport& rImport,
|
||||
const Reference< XOutputStream >& rOut ) :
|
||||
SvXMLImportContext( rImport ),
|
||||
xOut( rOut )
|
||||
m_xOut( rOut )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ void XMLBase64ImportContext::endFastElement(sal_Int32 )
|
||||
{
|
||||
Sequence< sal_Int8 > aBuffer( (sChars.size() / 4) * 3 );
|
||||
::comphelper::Base64::decodeSomeChars( aBuffer, sChars );
|
||||
xOut->writeBytes( aBuffer );
|
||||
m_xOut->writeBytes( aBuffer );
|
||||
}
|
||||
maCharBuffer.setLength(0);
|
||||
xOut->closeOutput();
|
||||
m_xOut->closeOutput();
|
||||
}
|
||||
|
||||
void XMLBase64ImportContext::characters( const OUString& rChars )
|
||||
|
||||
@@ -96,7 +96,7 @@ void XMLErrors::AddRecord(
|
||||
const OUString& rPublicId,
|
||||
const OUString& rSystemId )
|
||||
{
|
||||
aErrors.emplace_back( nId, rParams, rExceptionMessage,
|
||||
m_aErrors.emplace_back( nId, rParams, rExceptionMessage,
|
||||
nRow, nColumn, rPublicId, rSystemId );
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
@@ -186,12 +186,12 @@ void XMLErrors::AddRecord(
|
||||
void XMLErrors::ThrowErrorAsSAXException(sal_Int32 nIdMask)
|
||||
{
|
||||
// search first error/warning that matches the nIdMask
|
||||
for( const auto& rError : aErrors )
|
||||
for( const auto& rError : m_aErrors )
|
||||
{
|
||||
if ( (rError.nId & nIdMask) != 0 )
|
||||
{
|
||||
// we throw the error
|
||||
ErrorRecord& rErr = aErrors[0];
|
||||
ErrorRecord& rErr = m_aErrors[0];
|
||||
throw SAXParseException(
|
||||
rErr.sExceptionMessage, nullptr, Any(rErr.aParams),
|
||||
rErr.sPublicId, rErr.sSystemId, rErr.nRow, rErr.nColumn );
|
||||
|
||||
Reference in New Issue
Block a user