summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-09-14 17:01:50 +0200
committerMichael Stahl <mstahl@redhat.com>2016-09-15 12:01:11 +0200
commitb647996a9babbee7b33cf45192e57df6a124628b (patch)
treeddc6dfe8a62ec53fbacc4eeccfeb20019f3ef4f0 /writerfilter
parenta19a67e20e847a42063559694ec5beec71abcfb3 (diff)
replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdispatchdestination.cxx6
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx12
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx10
-rw-r--r--writerfilter/source/rtftok/rtflookahead.cxx4
-rw-r--r--writerfilter/source/rtftok/rtflookahead.hxx2
-rw-r--r--writerfilter/source/rtftok/rtftokenizer.cxx10
-rw-r--r--writerfilter/source/rtftok/rtftokenizer.hxx6
7 files changed, 25 insertions, 25 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
index af8a3f19b933..75d70199b01f 100644
--- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
@@ -61,7 +61,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_FLDINST:
{
// Look for the field type
- sal_Size nPos = Strm().Tell();
+ sal_uInt64 const nPos = Strm().Tell();
OStringBuffer aBuf;
char ch = 0;
bool bFoundCode = false;
@@ -192,7 +192,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
if (!m_pSuperstream)
{
Id nId = 0;
- sal_Size nPos = m_nGroupStartPos - 1;
+ std::size_t nPos = m_nGroupStartPos - 1;
switch (nKeyword)
{
case RTF_HEADER:
@@ -235,7 +235,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
// Check if this is an endnote.
OStringBuffer aBuf;
char ch;
- sal_Size nCurrent = Strm().Tell();
+ sal_uInt64 const nCurrent = Strm().Tell();
for (int i = 0; i < 7; ++i)
{
Strm().ReadChar(ch);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 60872d3259ca..92b9b96f8c86 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -338,14 +338,14 @@ void RTFDocumentImpl::setIgnoreFirst(OUString& rIgnoreFirst)
m_aIgnoreFirst = rIgnoreFirst;
}
-void RTFDocumentImpl::resolveSubstream(sal_Size nPos, Id nId)
+void RTFDocumentImpl::resolveSubstream(std::size_t nPos, Id nId)
{
OUString aStr;
resolveSubstream(nPos, nId, aStr);
}
-void RTFDocumentImpl::resolveSubstream(sal_Size nPos, Id nId, OUString& rIgnoreFirst)
+void RTFDocumentImpl::resolveSubstream(std::size_t nPos, Id nId, OUString& rIgnoreFirst)
{
- sal_Size nCurrent = Strm().Tell();
+ sal_uInt64 const nCurrent = Strm().Tell();
// Seek to header position, parse, then seek back.
auto pImpl = std::make_shared<RTFDocumentImpl>(m_xContext, m_xInputStream, m_xDstDoc, m_xFrame, m_xStatusIndicator, m_rMediaDescriptor);
pImpl->setSuperstream(this);
@@ -600,7 +600,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal)
}
while (!m_nHeaderFooterPositions.empty())
{
- std::pair<Id, sal_Size> aPair = m_nHeaderFooterPositions.front();
+ std::pair<Id, std::size_t> aPair = m_nHeaderFooterPositions.front();
m_nHeaderFooterPositions.pop();
resolveSubstream(aPair.second, aPair.first);
}
@@ -635,7 +635,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal)
m_bNeedSect = false;
}
-void RTFDocumentImpl::seek(sal_Size nPos)
+void RTFDocumentImpl::seek(sal_uInt64 const nPos)
{
Strm().Seek(nPos);
}
@@ -1545,7 +1545,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer,
else if (std::get<0>(aTuple) == BUFFER_RESOLVESUBSTREAM)
{
RTFSprms& rAttributes = std::get<1>(aTuple)->getAttributes();
- sal_Size nPos = rAttributes.find(0)->getInt();
+ std::size_t nPos = rAttributes.find(0)->getInt();
Id nId = rAttributes.find(1)->getInt();
OUString aCustomMark = rAttributes.find(2)->getString();
resolveSubstream(nPos, nId, aCustomMark);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 66588ba35436..d1b5ca1f1bad 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -417,7 +417,7 @@ public:
void setAuthor(OUString& rAuthor);
void setAuthorInitials(OUString& rAuthorInitials);
void setIgnoreFirst(OUString& rIgnoreFirst);
- void seek(sal_Size nPos);
+ void seek(sal_uInt64 nPos);
const css::uno::Reference<css::lang::XMultiServiceFactory>& getModelFactory()
{
return m_xModelFactory;
@@ -460,8 +460,8 @@ private:
writerfilter::Reference<Properties>::Pointer_t createStyleProperties();
void resetSprms();
void resetAttributes();
- void resolveSubstream(sal_Size nPos, Id nId);
- void resolveSubstream(sal_Size nPos, Id nId, OUString& rIgnoreFirst);
+ void resolveSubstream(std::size_t nPos, Id nId);
+ void resolveSubstream(std::size_t nPos, Id nId, OUString& rIgnoreFirst);
void text(OUString& rString);
// Sends a single character to dmapper, taking care of buffering.
@@ -585,8 +585,8 @@ private:
RTFDocumentImpl* m_pSuperstream;
/// Type of the stream: header, footer, footnote, etc.
Id m_nStreamType;
- std::queue< std::pair<Id, sal_Size> > m_nHeaderFooterPositions;
- sal_Size m_nGroupStartPos;
+ std::queue< std::pair<Id, std::size_t> > m_nHeaderFooterPositions;
+ std::size_t m_nGroupStartPos;
/// Ignore the first occurrence of this text.
OUString m_aIgnoreFirst;
/// Bookmark name <-> index map.
diff --git a/writerfilter/source/rtftok/rtflookahead.cxx b/writerfilter/source/rtftok/rtflookahead.cxx
index 8a3fc95c060c..9f43301666e6 100644
--- a/writerfilter/source/rtftok/rtflookahead.cxx
+++ b/writerfilter/source/rtftok/rtflookahead.cxx
@@ -17,11 +17,11 @@ namespace writerfilter
namespace rtftok
{
-RTFLookahead::RTFLookahead(SvStream& rStream, sal_Size nGroupStart)
+RTFLookahead::RTFLookahead(SvStream& rStream, sal_uInt64 nGroupStart)
: m_rStream(rStream),
m_bHasTable(false)
{
- sal_Size nPos = m_rStream.Tell();
+ sal_uInt64 const nPos = m_rStream.Tell();
m_rStream.Seek(nGroupStart);
uno::Reference<task::XStatusIndicator> xStatusIndicator;
m_pTokenizer.reset(new RTFTokenizer(*this, &m_rStream, xStatusIndicator));
diff --git a/writerfilter/source/rtftok/rtflookahead.hxx b/writerfilter/source/rtftok/rtflookahead.hxx
index f96b2f7cf37f..aa17ab5776ae 100644
--- a/writerfilter/source/rtftok/rtflookahead.hxx
+++ b/writerfilter/source/rtftok/rtflookahead.hxx
@@ -27,7 +27,7 @@ namespace rtftok
class RTFLookahead : public RTFListener
{
public:
- RTFLookahead(SvStream& rStream, sal_Size nGroupStart);
+ RTFLookahead(SvStream& rStream, sal_uInt64 nGroupStart);
virtual ~RTFLookahead() override;
virtual RTFError dispatchDestination(RTFKeyword nKeyword) override;
virtual RTFError dispatchFlag(RTFKeyword nKeyword) override;
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index 5afceabaaaa4..8ca74334707d 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -59,16 +59,16 @@ RTFError RTFTokenizer::resolveParse()
RTFError ret;
// for hex chars
int b = 0, count = 2;
- sal_Size nPercentSize = 0;
- sal_Size nLastPos = 0;
+ std::size_t nPercentSize = 0;
+ sal_uInt64 nLastPos = 0;
if (m_xStatusIndicator.is())
{
static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag());
OUString sDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr).toString());
- sal_Size nCurrentPos = Strm().Tell();
- sal_Size nEndPos = nCurrentPos + Strm().remainingSize();
+ sal_uInt64 const nCurrentPos = Strm().Tell();
+ sal_uInt64 const nEndPos = nCurrentPos + Strm().remainingSize();
m_xStatusIndicator->start(sDocLoad, nEndPos);
nPercentSize = nEndPos / 100;
@@ -79,7 +79,7 @@ RTFError RTFTokenizer::resolveParse()
{
//SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'");
- sal_Size nCurrentPos = Strm().Tell();
+ sal_uInt64 const nCurrentPos = Strm().Tell();
if (m_xStatusIndicator.is() && nCurrentPos > (nLastPos + nPercentSize))
m_xStatusIndicator->setValue(nLastPos = nCurrentPos);
diff --git a/writerfilter/source/rtftok/rtftokenizer.hxx b/writerfilter/source/rtftok/rtftokenizer.hxx
index 9701f65918d6..0e2039d61674 100644
--- a/writerfilter/source/rtftok/rtftokenizer.hxx
+++ b/writerfilter/source/rtftok/rtftokenizer.hxx
@@ -42,7 +42,7 @@ public:
/// To be invoked by the popState() callback to single when the importer leaves a group.
void popGroup();
OUString getPosition();
- sal_Size getGroupStart()
+ std::size_t getGroupStart()
{
return m_nGroupStart;
}
@@ -68,8 +68,8 @@ private:
/// Same as the size of the importer's states, except that this can be negative for invalid input.
int m_nGroup;
sal_Int32 m_nLineNumber;
- sal_Size m_nLineStartPos;
- sal_Size m_nGroupStart;
+ std::size_t m_nLineStartPos;
+ std::size_t m_nGroupStart;
};
} // namespace rtftok
} // namespace writerfilter