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;
/// Content, content of frame (header, footer, fly).
class SW_DLLPUBLIC SwFormatContent: public SfxPoolItem
{
std::unique_ptr<SwNodeIndex> pStartNode;
std::unique_ptr<SwNodeIndex> m_pStartNode;
SwFormatContent &operator=( const SwFormatContent & ) = delete;
......@@ -43,7 +43,7 @@ public:
virtual bool operator==( const SfxPoolItem& ) 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 dumpAsXml(struct _xmlTextWriter* pWriter) const override;
......
......@@ -32,13 +32,13 @@ class IntlWrapper;
class SW_DLLPUBLIC SwFormatURL: public SfxPoolItem
{
OUString sTargetFrameName; ///< Target frame for URL.
OUString sURL; ///< Simple URL.
OUString sName; ///< Name of the anchor.
OUString m_sTargetFrameName; ///< Target frame for URL.
OUString m_sURL; ///< Simple URL.
OUString m_sName; ///< Name of the anchor.
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:
SwFormatURL();
......@@ -58,18 +58,18 @@ public:
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;
void SetTargetFrameName( const OUString& rStr ) { sTargetFrameName = rStr; }
void SetTargetFrameName( const OUString& rStr ) { m_sTargetFrameName = rStr; }
void SetURL(const OUString &rURL, bool bServerMap);
void SetMap( const ImageMap *pM ); ///< Pointer will be copied.
const OUString& GetTargetFrameName()const { return sTargetFrameName; }
const OUString& GetURL() const { return sURL; }
bool IsServerMap() const { return bIsServerMap; }
const ImageMap *GetMap() const { return pMap.get(); }
ImageMap *GetMap() { return pMap.get(); }
const OUString& GetTargetFrameName()const { return m_sTargetFrameName; }
const OUString& GetURL() const { return m_sURL; }
bool IsServerMap() const { return m_bIsServerMap; }
const ImageMap *GetMap() const { return m_pMap.get(); }
ImageMap *GetMap() { return m_pMap.get(); }
const OUString& GetName() const { return sName; }
void SetName( const OUString& rNm ) { sName = rNm; }
const OUString& GetName() const { return m_sName; }
void SetName( const OUString& rNm ) { m_sName = rNm; }
};
inline const SwFormatURL &SwAttrSet::GetURL(bool bInP) const
......
......@@ -35,23 +35,23 @@ using ::com::sun::star::lang::IndexOutOfBoundsException;
SwAccessibleHyperlink::SwAccessibleHyperlink( size_t nHPos,
SwAccessibleParagraph *p, sal_Int32 nStt, sal_Int32 nEnd ) :
nHintPos( nHPos ),
xPara( p ),
nStartIdx( nStt ),
nEndIdx( nEnd )
m_nHintPosition( nHPos ),
m_xParagraph( p ),
m_nStartIndex( nStt ),
m_nEndIndex( nEnd )
{
}
const SwTextAttr *SwAccessibleHyperlink::GetTextAttr() const
{
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();
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() )
pTextAttr = pHt;
}
......@@ -80,7 +80,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
const SwFormatINetFormat& rINetFormat = pTextAttr->GetINetFormat();
if( !rINetFormat.GetValue().isEmpty() )
{
SwViewShell *pVSh = xPara->GetShell();
SwViewShell *pVSh = m_xParagraph->GetShell();
if( pVSh )
{
LoadURL(*pVSh, rINetFormat.GetValue(), LoadUrlFlags::NONE,
......@@ -148,8 +148,8 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionAnchor(
uno::Any aRet;
if(nIndex != 0)
throw lang::IndexOutOfBoundsException();
OUString text( xPara->GetString() );
OUString retText = text.copy(nStartIdx, nEndIdx - nStartIdx);
OUString text( m_xParagraph->GetString() );
OUString retText = text.copy(m_nStartIndex, m_nEndIndex - m_nStartIndex);
aRet <<= retText;
return aRet;
}
......@@ -175,18 +175,18 @@ uno::Any SAL_CALL SwAccessibleHyperlink::getAccessibleActionObject(
sal_Int32 SAL_CALL SwAccessibleHyperlink::getStartIndex()
{
return nStartIdx;
return m_nStartIndex;
}
sal_Int32 SAL_CALL SwAccessibleHyperlink::getEndIndex()
{
return nEndIdx;
return m_nEndIndex;
}
sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
{
SolarMutexGuard aGuard;
if (xPara.is())
if (m_xParagraph.is())
{
const SwTextAttr *pTextAttr = GetTextAttr();
OUString sText;
......@@ -239,7 +239,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::isValid( )
void SwAccessibleHyperlink::Invalidate()
{
SolarMutexGuard aGuard;
xPara = nullptr;
m_xParagraph = nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -34,10 +34,10 @@ class SwAccessibleHyperlink :
{
friend class SwAccessibleParagraph;
friend class SwAccessibleHyperTextData;
size_t nHintPos;
::rtl::Reference< SwAccessibleParagraph > xPara;
sal_Int32 nStartIdx;
sal_Int32 nEndIdx;
size_t m_nHintPosition;
::rtl::Reference< SwAccessibleParagraph > m_xParagraph;
sal_Int32 m_nStartIndex;
sal_Int32 m_nEndIndex;
SwAccessibleHyperlink( size_t nHintPos,
SwAccessibleParagraph *p,
......
......@@ -532,14 +532,14 @@ SfxPoolItem* SwFormatFooter::Clone( SfxItemPool* ) const
SwFormatContent::SwFormatContent( const SwFormatContent &rCpy )
: SfxPoolItem( RES_CNTNT )
{
pStartNode.reset( rCpy.GetContentIdx() ?
m_pStartNode.reset( rCpy.GetContentIdx() ?
new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr);
}
SwFormatContent::SwFormatContent( const SwStartNode *pStartNd )
: SfxPoolItem( RES_CNTNT )
{
pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr);
m_pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr);
}
SwFormatContent::~SwFormatContent()
......@@ -548,16 +548,16 @@ SwFormatContent::~SwFormatContent()
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
{
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;
if( pStartNode )
return ( *pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() );
if( m_pStartNode )
return ( *m_pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() );
return true;
}
......@@ -570,7 +570,7 @@ void SwFormatContent::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatContent"));
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);
}
......@@ -1711,20 +1711,20 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const
// Partially implemented inline in hxx
SwFormatURL::SwFormatURL() :
SfxPoolItem( RES_URL ),
pMap( nullptr ),
bIsServerMap( false )
m_pMap( nullptr ),
m_bIsServerMap( false )
{
}
SwFormatURL::SwFormatURL( const SwFormatURL &rURL) :
SfxPoolItem( RES_URL ),
sTargetFrameName( rURL.GetTargetFrameName() ),
sURL( rURL.GetURL() ),
sName( rURL.GetName() ),
bIsServerMap( rURL.IsServerMap() )
m_sTargetFrameName( rURL.GetTargetFrameName() ),
m_sURL( rURL.GetURL() ),
m_sName( rURL.GetName() ),
m_bIsServerMap( rURL.IsServerMap() )
{
if (rURL.GetMap())
pMap.reset( new ImageMap( *rURL.GetMap() ) );
m_pMap.reset( new ImageMap( *rURL.GetMap() ) );
}
SwFormatURL::~SwFormatURL()
......@@ -1735,16 +1735,16 @@ bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr);
bool bRet = bIsServerMap == rCmp.IsServerMap() &&
sURL == rCmp.GetURL() &&
sTargetFrameName == rCmp.GetTargetFrameName() &&
sName == rCmp.GetName();
bool bRet = m_bIsServerMap == rCmp.IsServerMap() &&
m_sURL == rCmp.GetURL() &&
m_sTargetFrameName == rCmp.GetTargetFrameName() &&
m_sName == rCmp.GetName();
if ( bRet )
{
if ( pMap && rCmp.GetMap() )
bRet = *pMap == *rCmp.GetMap();
if ( m_pMap && rCmp.GetMap() )
bRet = *m_pMap == *rCmp.GetMap();
else
bRet = pMap.get() == rCmp.GetMap();
bRet = m_pMap.get() == rCmp.GetMap();
}
return bRet;
}
......@@ -1756,13 +1756,13 @@ SfxPoolItem* SwFormatURL::Clone( SfxItemPool* ) const
void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap)
{
sURL = rURL;
bIsServerMap = bServerMap;
m_sURL = rURL;
m_bIsServerMap = bServerMap;
}
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
......@@ -1784,9 +1784,9 @@ bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_URL_CLIENTMAP:
{
uno::Reference< uno::XInterface > xInt;
if(pMap)
if(m_pMap)
{
xInt = SvUnoImageMap_createInstance( *pMap, sw_GetSupportedMacroItems() );
xInt = SvUnoImageMap_createInstance( *m_pMap, sw_GetSupportedMacroItems() );
}
else
{
......@@ -1818,7 +1818,7 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
OUString sTmp;
rVal >>= sTmp;
SetURL( sTmp, bIsServerMap );
SetURL( sTmp, m_bIsServerMap );
}
break;
case MID_URL_TARGET:
......@@ -1839,19 +1839,19 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
uno::Reference<container::XIndexContainer> xCont;
if(!rVal.hasValue())
pMap.reset();
m_pMap.reset();
else if(rVal >>= xCont)
{
if(!pMap)
pMap.reset(new ImageMap);
bRet = SvUnoImageMap_fillImageMap( xCont, *pMap );
if(!m_pMap)
m_pMap.reset(new ImageMap);
bRet = SvUnoImageMap_fillImageMap( xCont, *m_pMap );
}
else
bRet = false;
}
break;
case MID_URL_SERVERMAP:
bIsServerMap = *o3tl::doAccess<bool>(rVal);
m_bIsServerMap = *o3tl::doAccess<bool>(rVal);
break;
default:
OSL_ENSURE( false, "unknown MemberId" );
......
......@@ -513,19 +513,19 @@ bool SwFormatURL::GetPresentation
) const
{
rText.clear();
if ( pMap )
if ( m_pMap )
rText += "Client-Map";
if ( !sURL.isEmpty() )
if ( !m_sURL.isEmpty() )
{
if ( pMap )
if ( m_pMap )
rText += " - ";
rText = rText + "URL: " + sURL;
if ( bIsServerMap )
rText = rText + "URL: " + m_sURL;
if ( m_bIsServerMap )
rText += " (Server-Map)";
}
if ( !sTargetFrameName.isEmpty() )
if ( !m_sTargetFrameName.isEmpty() )
{
rText = rText + ", Target: " + sTargetFrameName;
rText = rText + ", Target: " + m_sTargetFrameName;
}
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