[Libreoffice-commits] core.git: 3 commits - boost/boost.wunused-local-typedef.patch.1 boost/UnpackedTarball_boost.mk include/sfx2 sc/inc sc/source sfx2/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Fri May 31 18:16:54 PDT 2013
boost/UnpackedTarball_boost.mk | 2
boost/boost.wunused-local-typedef.patch.1 | 91 ++++++++++++++++++++++++++++
include/sfx2/linkmgr.hxx | 2
sc/inc/document.hxx | 13 ++--
sc/inc/linkuno.hxx | 4 -
sc/source/core/data/documen8.cxx | 35 +++++-----
sc/source/core/tool/interpr2.cxx | 14 ++--
sc/source/filter/excel/xelink.cxx | 2
sc/source/filter/excel/xestyle.cxx | 2
sc/source/filter/xml/XMLDDELinksContext.cxx | 13 +---
sc/source/ui/docshell/docsh6.cxx | 14 ++--
sc/source/ui/unoobj/linkuno.cxx | 68 ++++++++++----------
sfx2/source/appl/linkmgr2.cxx | 29 ++++----
13 files changed, 192 insertions(+), 97 deletions(-)
New commits:
commit c3f55ac35a0c051b39d608d89558f741f347a898
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jun 1 03:08:05 2013 +0200
switch to size_t in sfx2::LinkManager
Change-Id: I7558ead872ab0e6894689f78fcfbbd1d8fb69877
diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index 27b84b6..768e913 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -90,7 +90,7 @@ public:
void SetPersist( SfxObjectShell * p ) { pPersist = p; }
void Remove( SvBaseLink *pLink );
- void Remove( sal_uInt16 nPos, sal_uInt16 nCnt = 1 );
+ void Remove( size_t nPos, size_t nCnt = 1 );
sal_Bool Insert( SvBaseLink* pLink );
// the links connect to a SvLinkSource and adds to the list
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 61483de..6c0219b 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -70,7 +70,7 @@ LinkManager::LinkManager(SfxObjectShell* p)
LinkManager::~LinkManager()
{
- for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n)
+ for( size_t n = 0; n < aLinkTbl.size(); ++n)
{
SvBaseLinkRef* pTmp = aLinkTbl[ n ];
if( pTmp->Is() )
@@ -107,7 +107,7 @@ void LinkManager::Remove( SvBaseLink *pLink )
{
// No duplicate links inserted
int bFound = sal_False;
- for( sal_uInt16 n = 0; n < aLinkTbl.size(); )
+ for( size_t n = 0; n < aLinkTbl.size(); )
{
SvBaseLinkRef* pTmp = aLinkTbl[ n ];
if( pLink == *pTmp )
@@ -132,14 +132,14 @@ void LinkManager::Remove( SvBaseLink *pLink )
}
-void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt )
+void LinkManager::Remove( size_t nPos, size_t nCnt )
{
if( nCnt && nPos < aLinkTbl.size() )
{
if (sal::static_int_cast<size_t>(nPos + nCnt) > aLinkTbl.size())
nCnt = aLinkTbl.size() - nPos;
- for( sal_uInt16 n = nPos; n < nPos + nCnt; ++n)
+ for( size_t n = nPos; n < nPos + nCnt; ++n)
{
SvBaseLinkRef* pTmp = aLinkTbl[ n ];
if( pTmp->Is() )
@@ -156,7 +156,7 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt )
sal_Bool LinkManager::Insert( SvBaseLink* pLink )
{
- for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n )
+ for( size_t n = 0; n < aLinkTbl.size(); ++n )
{
SvBaseLinkRef* pTmp = aLinkTbl[ n ];
if( !pTmp->Is() )
@@ -308,8 +308,7 @@ void LinkManager::UpdateAllLinks(
// First make a copy of the array in order to update links
// links in ... no contact between them!
std::vector<SvBaseLink*> aTmpArr;
- sal_uInt16 n;
- for( n = 0; n < aLinkTbl.size(); ++n )
+ for( size_t n = 0; n < aLinkTbl.size(); ++n )
{
SvBaseLink* pLink = *aLinkTbl[ n ];
if( !pLink )
@@ -320,20 +319,20 @@ void LinkManager::UpdateAllLinks(
aTmpArr.push_back( pLink );
}
- for( n = 0; n < aTmpArr.size(); ++n )
+ for( size_t n = 0; n < aTmpArr.size(); ++n )
{
SvBaseLink* pLink = aTmpArr[ n ];
// search first in the array after the entry
- sal_uInt16 nFndPos = USHRT_MAX;
- for( sal_uInt16 i = 0; i < aLinkTbl.size(); ++i )
+ bool bFound = false;
+ for( size_t i = 0; i < aLinkTbl.size(); ++i )
if( pLink == *aLinkTbl[ i ] )
{
- nFndPos = i;
+ bFound = true;
break;
}
- if( USHRT_MAX == nFndPos )
+ if( !bFound )
continue; // was not available!
// Graphic-Links not to update yet
@@ -421,9 +420,9 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer)
return;
const ::sfx2::SvBaseLinks& rLinks = GetLinks();
- sal_uInt16 n = rLinks.size();
+ size_t n = rLinks.size();
- for (sal_uInt16 i = 0; i < n; ++i)
+ for (size_t i = 0; i < n; ++i)
{
::sfx2::SvBaseLink* p = *rLinks[i];
String aType, aFile, aLink, aFilter;
@@ -515,7 +514,7 @@ void LinkManager::CancelTransfers()
sfx2::SvBaseLink* pLnk;
const sfx2::SvBaseLinks& rLnks = GetLinks();
- for( sal_uInt16 n = rLnks.size(); n; )
+ for( size_t n = rLnks.size(); n; )
if( 0 != ( pLnk = &(*rLnks[ --n ])) &&
OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) &&
0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) )
commit cc50d6744f4d07356761021e336e63a96fd86fcc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Jun 1 00:38:59 2013 +0200
remove some Wunused-local-typedef warnings from boost with gcc4.8
Change-Id: Ia026b679ddbea780179a88c9782e24eb9c7f44bb
diff --git a/boost/UnpackedTarball_boost.mk b/boost/UnpackedTarball_boost.mk
index fefe8fa..39aa383 100644
--- a/boost/UnpackedTarball_boost.mk
+++ b/boost/UnpackedTarball_boost.mk
@@ -26,6 +26,8 @@ boost_patches += boost.4510.warnings.patch
boost_patches += boost.6142.warnings.patch.1
boost_patches += boost.libcdr.warnings.patch.1
+boost_patches += boost.wunused-local-typedef.patch.1
+
# Help static analysis tools (see SAL_UNUSED_PARAMETER in sal/types.h):
ifeq (GCC,$(COM))
boost_patches += boost_1_44_0-unused-parameters.patch
diff --git a/boost/boost.wunused-local-typedef.patch.1 b/boost/boost.wunused-local-typedef.patch.1
new file mode 100644
index 0000000..069241c
--- /dev/null
+++ b/boost/boost.wunused-local-typedef.patch.1
@@ -0,0 +1,91 @@
+diff -ur boost.org/boost/date_time/gregorian/greg_facet.hpp boost/boost/date_time/gregorian/greg_facet.hpp
+--- boost.org/boost/date_time/gregorian/greg_facet.hpp 2013-05-31 21:56:34.677809902 +0200
++++ boost/boost/date_time/gregorian/greg_facet.hpp 2013-05-31 22:57:29.671660310 +0200
+@@ -215,7 +215,6 @@
+ {
+ std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos;
+
+- typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def;
+ d = from_stream(beg, eos);
+ return is;
+ }
+diff -ur boost.org/boost/lexical_cast.hpp boost/boost/lexical_cast.hpp
+--- boost.org/boost/lexical_cast.hpp 2013-05-31 21:56:34.685809901 +0200
++++ boost/boost/lexical_cast.hpp 2013-05-31 21:58:15.899805759 +0200
+@@ -865,7 +865,6 @@
+ #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+ #endif
+- typedef typename Traits::int_type int_type;
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ --end;
+ value = 0;
+diff -ur boost.org/boost/math/special_functions/fpclassify.hpp boost/boost/math/special_functions/fpclassify.hpp
+--- boost.org/boost/math/special_functions/fpclassify.hpp 2013-05-31 21:56:34.756809898 +0200
++++ boost/boost/math/special_functions/fpclassify.hpp 2013-05-31 22:56:08.456663634 +0200
+@@ -327,7 +327,6 @@
+ { //!< \brief return true if floating-point type t is finite.
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+- typedef typename boost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type value_type;
+ return detail::isfinite_impl(static_cast<value_type>(x), method());
+ }
+@@ -487,7 +486,6 @@
+ {
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+- typedef typename boost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type value_type;
+ return detail::isinf_impl(static_cast<value_type>(x), method());
+ }
+@@ -570,7 +568,6 @@
+ { //!< \brief return true if floating-point type t is NaN (Not A Number).
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+- typedef typename boost::is_floating_point<T>::type fp_tag;
+ return detail::isnan_impl(x, method());
+ }
+
+diff -ur boost.org/boost/math/special_functions/sign.hpp boost/boost/math/special_functions/sign.hpp
+--- boost.org/boost/math/special_functions/sign.hpp 2013-05-31 21:56:34.756809898 +0200
++++ boost/boost/math/special_functions/sign.hpp 2013-05-31 22:56:53.787661778 +0200
+@@ -110,7 +110,6 @@
+ {
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+- typedef typename boost::is_floating_point<T>::type fp_tag;
+ return detail::signbit_impl(x, method());
+ }
+
+@@ -124,7 +123,6 @@
+ { //!< \brief return unchanged binary pattern of x, except for change of sign bit.
+ typedef typename detail::fp_traits<T>::sign_change_type traits;
+ typedef typename traits::method method;
+- typedef typename boost::is_floating_point<T>::type fp_tag;
+
+ return detail::changesign_impl(x, method());
+ }
+diff -ur boost.org/boost/tuple/detail/tuple_basic.hpp boost/boost/tuple/detail/tuple_basic.hpp
+--- boost.org/boost/tuple/detail/tuple_basic.hpp 2013-05-31 21:56:34.846809895 +0200
++++ boost/boost/tuple/detail/tuple_basic.hpp 2013-05-31 22:58:11.116658614 +0200
+@@ -225,7 +225,6 @@
+ get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<cons<HT, TT> > impl;
+- typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
+ return impl::call(c).head;
+ }
+
+diff -ur boost.org/boost/unordered/detail/unique.hpp boost/boost/unordered/detail/unique.hpp
+--- boost.org/boost/unordered/detail/unique.hpp 2013-05-31 21:56:34.721809901 +0200
++++ boost/boost/unordered/detail/unique.hpp 2013-05-31 22:59:03.466656471 +0200
+@@ -334,8 +334,6 @@
+
+ value_type& operator[](key_type const& k)
+ {
+- typedef typename value_type::second_type mapped_type;
+-
+ std::size_t key_hash = this->hash(k);
+ iterator pos = this->find_node(key_hash, k);
+
commit a11be8a87a749f56d5c5514bbd9ffd90b3f75392
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri May 31 21:54:22 2013 +0200
use size_t where possible and fix some more places
Change-Id: I43c315aa9867cf871657064fd9455700b31879ab
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 427ab2c..d7d63f7 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -668,13 +668,14 @@ public:
void DisconnectDdeLinks();
// for StarOne Api:
- sal_uInt16 GetDdeLinkCount() const;
+ size_t GetDdeLinkCount() const;
bool UpdateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem );
/** Tries to find a DDE link with the specified connection data.
@param rnDdePos (out-param) Returns the index of the DDE link (does not include other links from link manager).
@return true = DDE link found, rnDdePos valid. */
- SC_DLLPUBLIC bool FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos );
+ SC_DLLPUBLIC bool FindDdeLink( const OUString& rAppl, const OUString& rTopic,
+ const OUString& rItem, sal_uInt8 nMode, size_t& rnDdePos );
/** Returns the connection data of the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@@ -682,16 +683,16 @@ public:
@param rTopic (out-param) The DDE topic.
@param rItem (out-param) The DDE item.
@return true = DDE link found, out-parameters valid. */
- bool GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const;
+ bool GetDdeLinkData( size_t nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const;
/** Returns the link mode of the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@param rnMode (out-param) The link mode of the specified DDE link.
@return true = DDE link found, rnMode valid. */
- bool GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const;
+ bool GetDdeLinkMode( size_t nDdePos, sal_uInt8& rnMode ) const;
/** Returns the result matrix of the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@return The result matrix, if the DDE link has been found, 0 otherwise. */
- SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const;
+ SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( sal_uInt16 size_t ) const;
/** Tries to find a DDE link or creates a new, if not extant.
@param pResults If not 0, sets the matrix as as DDE link result matrix (also for existing links).
@@ -701,7 +702,7 @@ public:
@param nDdePos Index of the DDE link (does not include other links from link manager).
@param pResults The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
@return true = DDE link found and matrix set. */
- bool SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults );
+ bool SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults );
SfxBindings* GetViewBindings();
diff --git a/sc/inc/linkuno.hxx b/sc/inc/linkuno.hxx
index 61c0bc3..318a390 100644
--- a/sc/inc/linkuno.hxx
+++ b/sc/inc/linkuno.hxx
@@ -219,7 +219,7 @@ class ScAreaLinkObj : public cppu::WeakImplHelper4<
private:
SfxItemPropertySet aPropSet;
ScDocShell* pDocShell;
- sal_uInt16 nPos;
+ size_t nPos;
XRefreshListenerArr_Impl aRefreshListeners;
void Modify_Impl( const OUString* pNewFile, const OUString* pNewFilter,
@@ -229,7 +229,7 @@ private:
void Refreshed_Impl();
public:
- ScAreaLinkObj(ScDocShell* pDocSh, sal_uInt16 nP);
+ ScAreaLinkObj(ScDocShell* pDocSh, size_t nP);
virtual ~ScAreaLinkObj();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 5c19499..d090ad0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1257,8 +1257,8 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
else if (GetLinkManager()) // Links direkt kopieren
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- sal_uInt16 nCount = rLinks.size();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = rLinks.size();
+ for (size_t i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *rLinks[i];
if (pBase->ISA(ScDdeLink))
@@ -1272,14 +1272,14 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const
}
}
-sal_uInt16 ScDocument::GetDdeLinkCount() const
+size_t ScDocument::GetDdeLinkCount() const
{
- sal_uInt16 nDdeCount = 0;
+ size_t nDdeCount = 0;
if (GetLinkManager())
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- sal_uInt16 nCount = rLinks.size();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = rLinks.size();
+ for (size_t i=0; i<nCount; i++)
if ((*rLinks[i])->ISA(ScDdeLink))
++nDdeCount;
}
@@ -1297,14 +1297,14 @@ namespace {
ScDdeLink* lclGetDdeLink(
const sfx2::LinkManager* pLinkManager,
const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode,
- sal_uInt16* pnDdePos = NULL )
+ size_t* pnDdePos = NULL )
{
if( pLinkManager )
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- sal_uInt16 nCount = rLinks.size();
+ size_t nCount = rLinks.size();
if( pnDdePos ) *pnDdePos = 0;
- for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
+ for( size_t nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
@@ -1324,14 +1324,14 @@ ScDdeLink* lclGetDdeLink(
/** Returns a pointer to the specified DDE link.
@param nDdePos Index of the DDE link (does not include other links from link manager).
@return The DDE link, if it exists, otherwise 0. */
-ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDdePos )
+ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, size_t nDdePos )
{
if( pLinkManager )
{
const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
- sal_uInt16 nCount = rLinks.size();
- sal_uInt16 nDdeIndex = 0; // counts only the DDE links
- for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex )
+ size_t nCount = rLinks.size();
+ size_t nDdeIndex = 0; // counts only the DDE links
+ for( size_t nIndex = 0; nIndex < nCount; ++nIndex )
{
::sfx2::SvBaseLink* pLink = *rLinks[ nIndex ];
if( ScDdeLink* pDdeLink = PTR_CAST( ScDdeLink, pLink ) )
@@ -1349,12 +1349,13 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDde
// ----------------------------------------------------------------------------
-bool ScDocument::FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos )
+bool ScDocument::FindDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem,
+ sal_uInt8 nMode, size_t& rnDdePos )
{
return lclGetDdeLink( GetLinkManager(), rAppl, rTopic, rItem, nMode, &rnDdePos ) != NULL;
}
-bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const
+bool ScDocument::GetDdeLinkData( size_t nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const
{
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1366,7 +1367,7 @@ bool ScDocument::GetDdeLinkData( sal_uInt16 nDdePos, OUString& rAppl, OUString&
return false;
}
-bool ScDocument::GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const
+bool ScDocument::GetDdeLinkMode( size_t nDdePos, sal_uInt8& rnMode ) const
{
if( const ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
@@ -1408,7 +1409,7 @@ bool ScDocument::CreateDdeLink( const OUString& rAppl, const OUString& rTopic, c
return false;
}
-bool ScDocument::SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrixRef pResults )
+bool ScDocument::SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults )
{
if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
{
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 4e0cde4..f4afd4e 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2223,15 +2223,15 @@ void ScInterpreter::ScStyle()
}
static ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr,
- const String& rA, const String& rT, const String& rI, sal_uInt8 nM )
+ const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM )
{
- sal_uInt16 nCount = pLinkMgr->GetLinks().size();
- for (sal_uInt16 i=0; i<nCount; i++ )
+ size_t nCount = pLinkMgr->GetLinks().size();
+ for (size_t i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i];
if (pBase->ISA(ScDdeLink))
{
- ScDdeLink* pLink = (ScDdeLink*)pBase;
+ ScDdeLink* pLink = static_cast<ScDdeLink*>(pBase);
if ( pLink->GetAppl() == rA &&
pLink->GetTopic() == rT &&
pLink->GetItem() == rI &&
@@ -2255,9 +2255,9 @@ void ScInterpreter::ScDde()
sal_uInt8 nMode = SC_DDE_DEFAULT;
if (nParamCount == 4)
nMode = (sal_uInt8) ::rtl::math::approxFloor(GetDouble());
- String aItem = GetString();
- String aTopic = GetString();
- String aAppl = GetString();
+ const OUString& aItem = GetString();
+ const OUString& aTopic = GetString();
+ const OUString& aAppl = GetString();
if (nMode > SC_DDE_TEXT)
nMode = SC_DDE_DEFAULT;
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index 5b6e37a..6ba0612 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1052,7 +1052,7 @@ sal_uInt16 XclExpExtNameBuffer::InsertDde(
sal_uInt16 nIndex = GetIndex( rItem );
if( nIndex == 0 )
{
- sal_uInt16 nPos;
+ size_t nPos;
if( GetDoc().FindDdeLink( rApplic, rTopic, rItem, SC_DDE_IGNOREMODE, nPos ) )
{
// create the leading 'StdDocumentName' EXTERNNAME record
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 0623ae5..c5cb5a3 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1552,7 +1552,7 @@ void lclGetBorderLine(
rnXclLine = EXC_LINE_NONE;
if( pLine )
{
- sal_uInt16 nOuterWidth = pLine->GetOutWidth();
+ sal_uInt16 nOuterWidth = pLine->GetWidth();
sal_uInt16 nDistance = pLine->GetDistance();
if( nDistance > 0 )
rnXclLine = EXC_LINE_DOUBLE;
diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx
index 184de3b..4f6d51f 100644
--- a/sc/source/filter/xml/XMLDDELinksContext.cxx
+++ b/sc/source/filter/xml/XMLDDELinksContext.cxx
@@ -116,16 +116,15 @@ void ScXMLDDELinkContext::CreateDDELink()
!sTopic.isEmpty() &&
!sItem.isEmpty())
{
- String sAppl(sApplication);
- String sTop(sTopic);
- String sIt(sItem);
- GetScImport().GetDocument()->CreateDdeLink(sAppl, sTop, sIt, nMode, ScMatrixRef());
- sal_uInt16 nPos;
- if(GetScImport().GetDocument()->FindDdeLink(sAppl, sTop, sIt, nMode, nPos))
+ GetScImport().GetDocument()->CreateDdeLink(sApplication, sTopic, sItem, nMode, ScMatrixRef());
+ size_t nPos;
+ if(GetScImport().GetDocument()->FindDdeLink(sApplication, sTopic, sItem, nMode, nPos))
nPosition = nPos;
else
+ {
nPosition = -1;
- OSL_ENSURE(nPosition > -1, "DDE Link not inserted");
+ SAL_WARN("sc" , "DDE Link not inserted");
+ }
}
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 283fe42..ecfed5d 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -370,14 +370,14 @@ void ScDocShell::UpdateLinks()
// nicht mehr benutzte Links raus
- sal_uInt16 nCount = pLinkManager->GetLinks().size();
- for (sal_uInt16 k=nCount; k>0; )
+ size_t nCount = pLinkManager->GetLinks().size();
+ for (size_t k=nCount; k>0; )
{
--k;
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[k];
if (pBase->ISA(ScTableLink))
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
+ ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
if (pTabLink->IsUsed())
aNames.insert(pTabLink->GetFileName());
else // nicht mehr benutzt -> loeschen
@@ -434,14 +434,14 @@ sal_Bool ScDocShell::ReloadTabLinks()
{
sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager();
- sal_Bool bAny = false;
- sal_uInt16 nCount = pLinkManager->GetLinks().size();
- for (sal_uInt16 i=0; i<nCount; i++ )
+ bool bAny = false;
+ size_t nCount = pLinkManager->GetLinks().size();
+ for (size_t i=0; i<nCount; i++ )
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
if (pBase->ISA(ScTableLink))
{
- ScTableLink* pTabLink = (ScTableLink*)pBase;
+ ScTableLink* pTabLink = static_cast<ScTableLink*>(pBase);
// pTabLink->SetAddUndo(sal_False); //! Undo's zusammenfassen
// Painting only after Update() makes no sense:
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 3cff46b..897d4aa 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -112,8 +112,8 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const
if (pDocShell)
{
sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
- sal_uInt16 nCount = pLinkManager->GetLinks().size();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pLinkManager->GetLinks().size();
+ for (size_t i=0; i<nCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
if (pBase->ISA(ScTableLink))
@@ -170,8 +170,8 @@ void SAL_CALL ScSheetLinkObj::removeRefreshListener(
throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
- sal_uInt16 nCount = aRefreshListeners.size();
- for ( sal_uInt16 n=nCount; n--; )
+ size_t nCount = aRefreshListeners.size();
+ for ( size_t n=nCount; n--; )
{
uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n];
if ( rObj == xListener )
@@ -188,7 +188,7 @@ void ScSheetLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set((cppu::OWeakObject*)this);
- for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ )
+ for ( size_t n=0; n<aRefreshListeners.size(); n++ )
aRefreshListeners[n]->refreshed( aEvent );
}
@@ -565,7 +565,7 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R
sal_Int32 nLinkCount = getCount();
uno::Sequence<OUString> aSeq(nLinkCount);
OUString* pAry = aSeq.getArray();
- sal_uInt16 nPos = 0;
+ size_t nPos = 0;
for (SCTAB nTab = 0; nTab < nTabCount; ++nTab)
{
if (!pDoc->IsLinked(nTab))
@@ -575,26 +575,26 @@ uno::Sequence<OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(uno::R
if (aNames.insert(aLinkDoc).second)
pAry[nPos++] = aLinkDoc;
}
- OSL_ENSURE( nPos==nLinkCount, "verzaehlt" );
+ OSL_ENSURE( nPos==static_cast<size_t>(nLinkCount), "verzaehlt" );
return aSeq;
}
//------------------------------------------------------------------------
-static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos )
+static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, size_t nPos )
{
if (pDocShell)
{
sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
- sal_uInt16 nTotalCount = pLinkManager->GetLinks().size();
- sal_uInt16 nAreaCount = 0;
- for (sal_uInt16 i=0; i<nTotalCount; i++)
+ size_t nTotalCount = pLinkManager->GetLinks().size();
+ size_t nAreaCount = 0;
+ for (size_t i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
if (pBase->ISA(ScAreaLink))
{
if ( nAreaCount == nPos )
- return (ScAreaLink*)pBase;
+ return static_cast<ScAreaLink*>(pBase);
++nAreaCount;
}
}
@@ -602,7 +602,7 @@ static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos )
return NULL; // nicht gefunden
}
-ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, sal_uInt16 nP) :
+ScAreaLinkObj::ScAreaLinkObj(ScDocShell* pDocSh, size_t nP) :
aPropSet( lcl_GetSheetLinkMap() ),
pDocShell( pDocSh ),
nPos( nP )
@@ -720,8 +720,8 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener(
throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
- sal_uInt16 nCount = aRefreshListeners.size();
- for ( sal_uInt16 n=nCount; n--; )
+ size_t nCount = aRefreshListeners.size();
+ for ( size_t n=nCount; n--; )
{
uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n];
if ( rObj == xListener )
@@ -731,6 +731,9 @@ void SAL_CALL ScAreaLinkObj::removeRefreshListener(
release(); // release ref for listeners
break;
}
+
+ if(n == 0)
+ break;
}
}
@@ -738,7 +741,7 @@ void ScAreaLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set((cppu::OWeakObject*)this);
- for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ )
+ for ( size_t n=0; n<aRefreshListeners.size(); n++ )
aRefreshListeners[n]->refreshed( aEvent );
}
@@ -945,7 +948,7 @@ void ScAreaLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScAreaLinkObj* ScAreaLinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
{
if ( pDocShell && nIndex >= 0 && nIndex < getCount() )
- return new ScAreaLinkObj( pDocShell, (sal_uInt16)nIndex );
+ return new ScAreaLinkObj( pDocShell, (size_t)nIndex );
return NULL; // nicht gefunden
}
@@ -976,7 +979,7 @@ void SAL_CALL ScAreaLinksObj::insertAtPosition( const table::CellAddress& aDestP
void SAL_CALL ScAreaLinksObj::removeByIndex( sal_Int32 nIndex ) throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
- ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, (sal_uInt16)nIndex);
+ ScAreaLink* pLink = lcl_GetAreaLink(pDocShell, (size_t)nIndex);
if (pLink)
{
//! SetAddUndo oder so
@@ -1004,8 +1007,8 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException)
if (pDocShell)
{
sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager();
- sal_uInt16 nTotalCount = pLinkManager->GetLinks().size();
- for (sal_uInt16 i=0; i<nTotalCount; i++)
+ size_t nTotalCount = pLinkManager->GetLinks().size();
+ for (size_t i=0; i<nTotalCount; i++)
{
::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i];
if (pBase->ISA(ScAreaLink))
@@ -1161,8 +1164,8 @@ void SAL_CALL ScDDELinkObj::removeRefreshListener(
throw(uno::RuntimeException)
{
SolarMutexGuard aGuard;
- sal_uInt16 nCount = aRefreshListeners.size();
- for ( sal_uInt16 n=nCount; n--; )
+ size_t nCount = aRefreshListeners.size();
+ for ( size_t n=nCount; n--; )
{
uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n];
if ( rObj == xListener )
@@ -1189,7 +1192,7 @@ uno::Sequence< uno::Sequence< uno::Any > > ScDDELinkObj::getResults( )
ScDocument* pDoc = pDocShell->GetDocument();
if ( pDoc )
{
- sal_uInt16 nPos = 0;
+ size_t nPos = 0;
if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
{
const ScMatrix* pMatrix = pDoc->GetDdeLinkResultMatrix( nPos );
@@ -1227,7 +1230,7 @@ void ScDDELinkObj::setResults( const uno::Sequence< uno::Sequence< uno::Any > >&
ScDocument* pDoc = pDocShell->GetDocument();
if ( pDoc )
{
- sal_uInt16 nPos = 0;
+ size_t nPos = 0;
if ( pDoc->FindDdeLink( aAppl, aTopic, aItem, SC_DDE_IGNOREMODE, nPos ) )
{
uno::Any aAny;
@@ -1250,7 +1253,7 @@ void ScDDELinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set((cppu::OWeakObject*)this);
- for ( sal_uInt16 n=0; n<aRefreshListeners.size(); n++ )
+ for ( size_t n=0; n<aRefreshListeners.size(); n++ )
aRefreshListeners[n]->refreshed( aEvent );
}
@@ -1286,8 +1289,7 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByIndex_Impl(sal_Int32 nIndex)
if (pDocShell)
{
OUString aAppl, aTopic, aItem;
- if ( nIndex <= USHRT_MAX &&
- pDocShell->GetDocument()->GetDdeLinkData( (sal_uInt16)nIndex, aAppl, aTopic, aItem ) )
+ if ( pDocShell->GetDocument()->GetDdeLinkData( (size_t)nIndex, aAppl, aTopic, aItem ) )
return new ScDDELinkObj( pDocShell, aAppl, aTopic, aItem );
}
return NULL;
@@ -1301,8 +1303,8 @@ ScDDELinkObj* ScDDELinksObj::GetObjectByName_Impl(const OUString& aName)
OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
- sal_uInt16 nCount = pDoc->GetDdeLinkCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pDoc->GetDdeLinkCount();
+ for (size_t i=0; i<nCount; i++)
{
pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
@@ -1376,11 +1378,11 @@ uno::Sequence<OUString> SAL_CALL ScDDELinksObj::getElementNames() throw(uno::Run
OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
- sal_uInt16 nCount = pDoc->GetDdeLinkCount();
+ size_t nCount = pDoc->GetDdeLinkCount();
uno::Sequence<OUString> aSeq(nCount);
OUString* pAry = aSeq.getArray();
- for (sal_uInt16 i=0; i<nCount; i++)
+ for (size_t i=0; i<nCount; i++)
{
pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
pAry[i] = lcl_BuildDDEName(aAppl, aTopic, aItem);
@@ -1400,8 +1402,8 @@ sal_Bool SAL_CALL ScDDELinksObj::hasByName( const OUString& aName )
OUString aAppl, aTopic, aItem;
ScDocument* pDoc = pDocShell->GetDocument();
- sal_uInt16 nCount = pDoc->GetDdeLinkCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ size_t nCount = pDoc->GetDdeLinkCount();
+ for (size_t i=0; i<nCount; i++)
{
pDoc->GetDdeLinkData( i, aAppl, aTopic, aItem );
if ( lcl_BuildDDEName(aAppl, aTopic, aItem) == aNamStr )
More information about the Libreoffice-commits
mailing list