Kaydet (Commit) 5b7ec49f authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwFormatContent, SwAccessibleHyperlink and SwFormatURL

Change-Id: Iae0a540355b6f8c9306d630a417f64cbaef4b07c
Reviewed-on: https://gerrit.libreoffice.org/47297Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 3a355887
...@@ -30,7 +30,7 @@ class SwStartNode; ...@@ -30,7 +30,7 @@ class SwStartNode;
/// Content, content of frame (header, footer, fly). /// Content, content of frame (header, footer, fly).
class SW_DLLPUBLIC SwFormatContent: public SfxPoolItem class SW_DLLPUBLIC SwFormatContent: public SfxPoolItem
{ {
std::unique_ptr<SwNodeIndex> pStartNode; std::unique_ptr<SwNodeIndex> m_pStartNode;
SwFormatContent &operator=( const SwFormatContent & ) = delete; SwFormatContent &operator=( const SwFormatContent & ) = delete;
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
virtual bool operator==( const SfxPoolItem& ) const override; virtual bool operator==( const SfxPoolItem& ) const override;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
const SwNodeIndex *GetContentIdx() const { return pStartNode.get(); } const SwNodeIndex *GetContentIdx() const { return m_pStartNode.get(); }
void SetNewContentIdx( const SwNodeIndex *pIdx ); void SetNewContentIdx( const SwNodeIndex *pIdx );
void dumpAsXml(struct _xmlTextWriter* pWriter) const override; void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
......
...@@ -32,13 +32,13 @@ class IntlWrapper; ...@@ -32,13 +32,13 @@ class IntlWrapper;
class SW_DLLPUBLIC SwFormatURL: public SfxPoolItem class SW_DLLPUBLIC SwFormatURL: public SfxPoolItem
{ {
OUString sTargetFrameName; ///< Target frame for URL. OUString m_sTargetFrameName; ///< Target frame for URL.
OUString sURL; ///< Simple URL. OUString m_sURL; ///< Simple URL.
OUString sName; ///< Name of the anchor. OUString m_sName; ///< Name of the anchor.
std::unique_ptr<ImageMap> std::unique_ptr<ImageMap>
pMap; ///< ClientSide images. m_pMap; ///< ClientSide images.
bool bIsServerMap; ///< A ServerSideImageMap with the URL. bool m_bIsServerMap; ///< A ServerSideImageMap with the URL.
public: public:
SwFormatURL(); SwFormatURL();
...@@ -58,18 +58,18 @@ public: ...@@ -58,18 +58,18 @@ public:
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) 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; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
void SetTargetFrameName( const OUString& rStr ) { sTargetFrameName = rStr; } void SetTargetFrameName( const OUString& rStr ) { m_sTargetFrameName = rStr; }
void SetURL(const OUString &rURL, bool bServerMap); void SetURL(const OUString &rURL, bool bServerMap);
void SetMap( const ImageMap *pM ); ///< Pointer will be copied. void SetMap( const ImageMap *pM ); ///< Pointer will be copied.
const OUString& GetTargetFrameName()const { return sTargetFrameName; } const OUString& GetTargetFrameName()const { return m_sTargetFrameName; }
const OUString& GetURL() const { return sURL; } const OUString& GetURL() const { return m_sURL; }
bool IsServerMap() const { return bIsServerMap; } bool IsServerMap() const { return m_bIsServerMap; }
const ImageMap *GetMap() const { return pMap.get(); } const ImageMap *GetMap() const { return m_pMap.get(); }
ImageMap *GetMap() { return pMap.get(); } ImageMap *GetMap() { return m_pMap.get(); }
const OUString& GetName() const { return sName; } const OUString& GetName() const { return m_sName; }
void SetName( const OUString& rNm ) { sName = rNm; } void SetName( const OUString& rNm ) { m_sName = rNm; }
}; };
inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const
......
...@@ -35,23 +35,23 @@ using ::com::sun::star::lang::IndexOutOfBoundsException; ...@@ -35,23 +35,23 @@ using ::com::sun::star::lang::IndexOutOfBoundsException;
SwAccessibleHyperlink::SwAccessibleHyperlink( size_t nHPos, SwAccessibleHyperlink::SwAccessibleHyperlink( size_t nHPos,
SwAccessibleParagraph *p, sal_Int32 nStt, sal_Int32 nEnd ) : SwAccessibleParagraph *p, sal_Int32 nStt, sal_Int32 nEnd ) :
nHintPos( nHPos ), m_nHintPosition( nHPos ),
xPara( p ), m_xParagraph( p ),
nStartIdx( nStt ), m_nStartIndex( nStt ),
nEndIdx( nEnd ) m_nEndIndex( nEnd )
{ {
} }
const SwTextAttr *SwAccessibleHyperlink::GetTextAttr() const const SwTextAttr *SwAccessibleHyperlink::GetTextAttr() const
{ {
const SwTextAttr *pTextAttr = nullptr; const SwTextAttr *pTextAttr = nullptr;
if( xPara.is() && xPara->GetMap() ) if( m_xParagraph.is() && m_xParagraph->GetMap() )
{ {
const SwTextNode *pTextNd = xPara->GetTextNode(); const SwTextNode *pTextNd = m_xParagraph->GetTextNode();
const SwpHints *pHints = pTextNd->GetpSwpHints(); const SwpHints *pHints = pTextNd->GetpSwpHints();
if( pHints && nHintPos < pHints->Count() ) if( pHints && m_nHintPosition < pHints->Count() )
{ {
const SwTextAttr *pHt = pHints->Get(nHintPos); const SwTextAttr *pHt = pHints->Get(m_nHintPosition);
if( RES_TXTATR_INETFMT == pHt->Which() ) if( RES_TXTATR_INETFMT == pHt->Which() )
pTextAttr = pHt; pTextAttr = pHt;
} }
...@@ -80,7 +80,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) ...@@ -80,7 +80,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
const SwFormatINetFormat& rINetFormat = pTextAttr->GetINetFormat(); const SwFormatINetFormat& rINetFormat = pTextAttr->GetINetFormat();
if( !rINetFormat.GetValue().isEmpty() ) if( !rINetFormat.GetValue().isEmpty() )
{ {
SwViewShell *pVSh = xPara->GetShell(); SwViewShell *pVSh = m_xParagraph->GetShell();
if( pVSh ) if( pVSh )
{ {
LoadURL(*pVSh, rINetFormat.GetValue(), LoadUrlFlags::NONE, LoadURL(*pVSh, rINetFormat.GetValue(), LoadUrlFlags::NONE,
...@@ -148,8 +148,8 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionAnchor( ...@@ -148,8 +148,8 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionAnchor(
uno::Any aRet; uno::Any aRet;
if(nIndex != 0) if(nIndex != 0)
throw lang::IndexOutOfBoundsException(); throw lang::IndexOutOfBoundsException();
OUString text( xPara->GetString() ); OUString text( m_xParagraph->GetString() );
OUString retText = text.copy(nStartIdx, nEndIdx - nStartIdx); OUString retText = text.copy(m_nStartIndex, m_nEndIndex - m_nStartIndex);
aRet <<= retText; aRet <<= retText;
return aRet; return aRet;
} }
...@@ -175,18 +175,18 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionObject( ...@@ -175,18 +175,18 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionObject(
sal_Int32 SAL_CALL SwAccessibleHyperlink::getStartIndex() sal_Int32 SAL_CALL SwAccessibleHyperlink::getStartIndex()
{ {
return nStartIdx; return m_nStartIndex;
} }
sal_Int32 SAL_CALL SwAccessibleHyperlink::getEndIndex() sal_Int32 SAL_CALL SwAccessibleHyperlink::getEndIndex()
{ {
return nEndIdx; return m_nEndIndex;
} }
sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( ) sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (xPara.is()) if (m_xParagraph.is())
{ {
const SwTextAttr *pTextAttr = GetTextAttr(); const SwTextAttr *pTextAttr = GetTextAttr();
OUString sText; OUString sText;
...@@ -239,7 +239,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( ) ...@@ -239,7 +239,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
void SwAccessibleHyperlink::Invalidate() void SwAccessibleHyperlink::Invalidate()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
xPara = nullptr; m_xParagraph = nullptr;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -34,10 +34,10 @@ class SwAccessibleHyperlink : ...@@ -34,10 +34,10 @@ class SwAccessibleHyperlink :
{ {
friend class SwAccessibleParagraph; friend class SwAccessibleParagraph;
friend class SwAccessibleHyperTextData; friend class SwAccessibleHyperTextData;
size_t nHintPos; size_t m_nHintPosition;
::rtl::Reference< SwAccessibleParagraph > xPara; ::rtl::Reference< SwAccessibleParagraph > m_xParagraph;
sal_Int32 nStartIdx; sal_Int32 m_nStartIndex;
sal_Int32 nEndIdx; sal_Int32 m_nEndIndex;
SwAccessibleHyperlink( size_t nHintPos, SwAccessibleHyperlink( size_t nHintPos,
SwAccessibleParagraph *p, SwAccessibleParagraph *p,
......
...@@ -532,14 +532,14 @@ SfxPoolItem* SwFormatFooter::Clone( SfxItemPool* ) const ...@@ -532,14 +532,14 @@ SfxPoolItem* SwFormatFooter::Clone( SfxItemPool* ) const
SwFormatContent::SwFormatContent( const SwFormatContent &rCpy ) SwFormatContent::SwFormatContent( const SwFormatContent &rCpy )
: SfxPoolItem( RES_CNTNT ) : SfxPoolItem( RES_CNTNT )
{ {
pStartNode.reset( rCpy.GetContentIdx() ? m_pStartNode.reset( rCpy.GetContentIdx() ?
new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr); new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr);
} }
SwFormatContent::SwFormatContent( const SwStartNode *pStartNd ) SwFormatContent::SwFormatContent( const SwStartNode *pStartNd )
: SfxPoolItem( RES_CNTNT ) : SfxPoolItem( RES_CNTNT )
{ {
pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr); m_pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr);
} }
SwFormatContent::~SwFormatContent() SwFormatContent::~SwFormatContent()
...@@ -548,16 +548,16 @@ SwFormatContent::~SwFormatContent() ...@@ -548,16 +548,16 @@ SwFormatContent::~SwFormatContent()
void SwFormatContent::SetNewContentIdx( const SwNodeIndex *pIdx ) void SwFormatContent::SetNewContentIdx( const SwNodeIndex *pIdx )
{ {
pStartNode.reset( pIdx ? new SwNodeIndex( *pIdx ) : nullptr ); m_pStartNode.reset( pIdx ? new SwNodeIndex( *pIdx ) : nullptr );
} }
bool SwFormatContent::operator==( const SfxPoolItem& rAttr ) const bool SwFormatContent::operator==( const SfxPoolItem& rAttr ) const
{ {
assert(SfxPoolItem::operator==(rAttr)); assert(SfxPoolItem::operator==(rAttr));
if( (bool)pStartNode != (bool)static_cast<const SwFormatContent&>(rAttr).pStartNode ) if( (bool)m_pStartNode != (bool)static_cast<const SwFormatContent&>(rAttr).m_pStartNode )
return false; return false;
if( pStartNode ) if( m_pStartNode )
return ( *pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() ); return ( *m_pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() );
return true; return true;
} }
...@@ -570,7 +570,7 @@ void SwFormatContent::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -570,7 +570,7 @@ void SwFormatContent::dumpAsXml(xmlTextWriterPtr pWriter) const
{ {
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatContent")); xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatContent"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("startNode"), BAD_CAST(OString::number(pStartNode->GetNode().GetIndex()).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("startNode"), BAD_CAST(OString::number(m_pStartNode->GetNode().GetIndex()).getStr()));
xmlTextWriterEndElement(pWriter); xmlTextWriterEndElement(pWriter);
} }
...@@ -1711,20 +1711,20 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -1711,20 +1711,20 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const
// Partially implemented inline in hxx // Partially implemented inline in hxx
SwFormatURL::SwFormatURL() : SwFormatURL::SwFormatURL() :
SfxPoolItem( RES_URL ), SfxPoolItem( RES_URL ),
pMap( nullptr ), m_pMap( nullptr ),
bIsServerMap( false ) m_bIsServerMap( false )
{ {
} }
SwFormatURL::SwFormatURL( const SwFormatURL &rURL) : SwFormatURL::SwFormatURL( const SwFormatURL &rURL) :
SfxPoolItem( RES_URL ), SfxPoolItem( RES_URL ),
sTargetFrameName( rURL.GetTargetFrameName() ), m_sTargetFrameName( rURL.GetTargetFrameName() ),
sURL( rURL.GetURL() ), m_sURL( rURL.GetURL() ),
sName( rURL.GetName() ), m_sName( rURL.GetName() ),
bIsServerMap( rURL.IsServerMap() ) m_bIsServerMap( rURL.IsServerMap() )
{ {
if (rURL.GetMap()) if (rURL.GetMap())
pMap.reset( new ImageMap( *rURL.GetMap() ) ); m_pMap.reset( new ImageMap( *rURL.GetMap() ) );
} }
SwFormatURL::~SwFormatURL() SwFormatURL::~SwFormatURL()
...@@ -1735,16 +1735,16 @@ bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const ...@@ -1735,16 +1735,16 @@ bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const
{ {
assert(SfxPoolItem::operator==(rAttr)); assert(SfxPoolItem::operator==(rAttr));
const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr); const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr);
bool bRet = bIsServerMap == rCmp.IsServerMap() && bool bRet = m_bIsServerMap == rCmp.IsServerMap() &&
sURL == rCmp.GetURL() && m_sURL == rCmp.GetURL() &&
sTargetFrameName == rCmp.GetTargetFrameName() && m_sTargetFrameName == rCmp.GetTargetFrameName() &&
sName == rCmp.GetName(); m_sName == rCmp.GetName();
if ( bRet ) if ( bRet )
{ {
if ( pMap && rCmp.GetMap() ) if ( m_pMap && rCmp.GetMap() )
bRet = *pMap == *rCmp.GetMap(); bRet = *m_pMap == *rCmp.GetMap();
else else
bRet = pMap.get() == rCmp.GetMap(); bRet = m_pMap.get() == rCmp.GetMap();
} }
return bRet; return bRet;
} }
...@@ -1756,13 +1756,13 @@ SfxPoolItem* SwFormatURL::Clone( SfxItemPool* ) const ...@@ -1756,13 +1756,13 @@ SfxPoolItem* SwFormatURL::Clone( SfxItemPool* ) const
void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap) void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap)
{ {
sURL = rURL; m_sURL = rURL;
bIsServerMap = bServerMap; m_bIsServerMap = bServerMap;
} }
void SwFormatURL::SetMap( const ImageMap *pM ) void SwFormatURL::SetMap( const ImageMap *pM )
{ {
pMap.reset( pM ? new ImageMap( *pM ) : nullptr); m_pMap.reset( pM ? new ImageMap( *pM ) : nullptr);
} }
bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
...@@ -1784,9 +1784,9 @@ bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -1784,9 +1784,9 @@ bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_URL_CLIENTMAP: case MID_URL_CLIENTMAP:
{ {
uno::Reference< uno::XInterface > xInt; uno::Reference< uno::XInterface > xInt;
if(pMap) if(m_pMap)
{ {
xInt = SvUnoImageMap_createInstance( *pMap, sw_GetSupportedMacroItems() ); xInt = SvUnoImageMap_createInstance( *m_pMap, sw_GetSupportedMacroItems() );
} }
else else
{ {
...@@ -1818,7 +1818,7 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -1818,7 +1818,7 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{ {
OUString sTmp; OUString sTmp;
rVal >>= sTmp; rVal >>= sTmp;
SetURL( sTmp, bIsServerMap ); SetURL( sTmp, m_bIsServerMap );
} }
break; break;
case MID_URL_TARGET: case MID_URL_TARGET:
...@@ -1839,19 +1839,19 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -1839,19 +1839,19 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{ {
uno::Reference<container::XIndexContainer> xCont; uno::Reference<container::XIndexContainer> xCont;
if(!rVal.hasValue()) if(!rVal.hasValue())
pMap.reset(); m_pMap.reset();
else if(rVal >>= xCont) else if(rVal >>= xCont)
{ {
if(!pMap) if(!m_pMap)
pMap.reset(new ImageMap); m_pMap.reset(new ImageMap);
bRet = SvUnoImageMap_fillImageMap( xCont, *pMap ); bRet = SvUnoImageMap_fillImageMap( xCont, *m_pMap );
} }
else else
bRet = false; bRet = false;
} }
break; break;
case MID_URL_SERVERMAP: case MID_URL_SERVERMAP:
bIsServerMap = *o3tl::doAccess<bool>(rVal); m_bIsServerMap = *o3tl::doAccess<bool>(rVal);
break; break;
default: default:
OSL_ENSURE( false, "unknown MemberId" ); OSL_ENSURE( false, "unknown MemberId" );
......
...@@ -513,19 +513,19 @@ bool SwFormatURL::GetPresentation ...@@ -513,19 +513,19 @@ bool SwFormatURL::GetPresentation
) const ) const
{ {
rText.clear(); rText.clear();
if ( pMap ) if ( m_pMap )
rText += "Client-Map"; rText += "Client-Map";
if ( !sURL.isEmpty() ) if ( !m_sURL.isEmpty() )
{ {
if ( pMap ) if ( m_pMap )
rText += " - "; rText += " - ";
rText = rText + "URL: " + sURL; rText = rText + "URL: " + m_sURL;
if ( bIsServerMap ) if ( m_bIsServerMap )
rText += " (Server-Map)"; rText += " (Server-Map)";
} }
if ( !sTargetFrameName.isEmpty() ) if ( !m_sTargetFrameName.isEmpty() )
{ {
rText = rText + ", Target: " + sTargetFrameName; rText = rText + ", Target: " + m_sTargetFrameName;
} }
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment