[Libreoffice-commits] core.git: 4 commits - include/osl sw/source
Stephan Bergmann
sbergman at redhat.com
Mon Jan 6 07:59:23 PST 2014
include/osl/detail/component-defines.h | 46 +++++-----
sw/source/core/text/wrong.cxx | 143 +++++++++++++++------------------
2 files changed, 89 insertions(+), 100 deletions(-)
New commits:
commit be58acfe2b8bc453b1b8b10bd6349599730d0d78
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Jan 6 16:59:02 2014 +0100
Thinko: The macros must be based on service instead of implementation names
Change-Id: I80fe00310f934fa335ade5fcdef41c44cc6ab69c
diff --git a/include/osl/detail/component-defines.h b/include/osl/detail/component-defines.h
index 63893ea..da6856f 100644
--- a/include/osl/detail/component-defines.h
+++ b/include/osl/detail/component-defines.h
@@ -14,30 +14,28 @@
#define LO_URE_CURRENT_ENV 1 /*TODO*/
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_FastParser 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_FastParser com_sun_star_comp_extensions_xml_sax_FastParser
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_ParserExpat 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_extensions_dot_xml_dot_sax_dot_ParserExpat com_sun_star_comp_extensions_xml_sax_ParserExpat
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_DLLComponentLoader 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_DLLComponentLoader com_sun_star_comp_stoc_DLLComponentLoader
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ImplementationRegistration 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ImplementationRegistration com_sun_star_comp_stoc_ImplementationRegistration
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_NestedRegistry 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_NestedRegistry com_sun_star_comp_stoc_NestedRegistry
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ORegistryServiceManager 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_ORegistryServiceManager com_sun_star_comp_stoc_ORegistryServiceManager
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManager 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManager com_sun_star_comp_stoc_OServiceManager
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManagerWrapper 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_OServiceManagerWrapper com_sun_star_comp_stoc_OServiceManagerWrapper
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_SimpleRegistry 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_comp_dot_stoc_dot_SimpleRegistry com_sun_star_comp_stoc_SimpleRegistry
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_extensions_dot_xml_dot_sax_dot_Writer 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_extensions_dot_xml_dot_sax_dot_Writer com_sun_star_extensions_xml_sax_Writer
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_AccessController 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_AccessController com_sun_star_security_comp_stoc_AccessController
-#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_FilePolicy 1 /*TODO*/
-#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_comp_dot_stoc_dot_FilePolicy com_sun_star_security_comp_stoc_FilePolicy
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_lang_dot_RegistryServiceManager 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_lang_dot_RegistryServiceManager com_sun_star_comp_stoc_ORegistryServiceManager
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_lang_dot_ServiceManager 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_lang_dot_ServiceManager com_sun_star_comp_stoc_OServiceManager
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_loader_dot_SharedLibrary 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_loader_dot_SharedLibrary com_sun_star_comp_stoc_DLLComponentLoader
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_ImplementationRegistration 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_ImplementationRegistration com_sun_star_comp_stoc_ImplementationRegistration
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_NestedRegistry 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_NestedRegistry com_sun_star_comp_stoc_NestedRegistry
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_registry_dot_SimpleRegistry 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_registry_dot_SimpleRegistry com_sun_star_comp_stoc_SimpleRegistry
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_AccessController 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_AccessController com_sun_star_security_comp_stoc_AccessController
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_security_dot_Policy 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_security_dot_Policy com_sun_star_security_comp_stoc_FilePolicy
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser com_sun_star_comp_extensions_xml_sax_FastParser
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser com_sun_star_comp_extensions_xml_sax_ParserExpat
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Writer 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Writer com_sun_star_extensions_xml_sax_Writer
#endif
commit 62ab589282ad4fb96e1b8d1f9cc13090276f49ca
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jan 6 16:56:15 2014 +0100
translate German variables nUnten, nOben, nMitte
Change-Id: Ib8a1a7dee98f39f3fe10c0244f1888ecc55e7ff3
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index ade06ed..d4e6c6e 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -185,10 +185,10 @@ sal_Int32 SwWrongList::NextWrong( sal_Int32 nChk ) const
*/
sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
{
- sal_uInt16 nOben = Count();
- sal_uInt16 nUnten = 0;
+ sal_uInt16 nMax = Count();
+ sal_uInt16 nMin = 0;
- if( nOben > 0 )
+ if( nMax > 0 )
{
// For smart tag lists, we may not use a binary search. We return the
// position of the first smart tag which coveres nValue
@@ -203,45 +203,45 @@ sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
if ( nSTPos > nValue )
break;
- ++nUnten;
+ ++nMin;
}
- return nUnten;
+ return nMin;
}
- --nOben;
- sal_uInt16 nMitte = 0;
- while( nUnten <= nOben )
+ --nMax;
+ sal_uInt16 nMid = 0;
+ while( nMin <= nMax )
{
- nMitte = nUnten + ( nOben - nUnten ) / 2;
- const sal_Int32 nTmp = Pos( nMitte );
+ nMid = nMin + ( nMax - nMin ) / 2;
+ const sal_Int32 nTmp = Pos( nMid );
if( nTmp == nValue )
{
- nUnten = nMitte;
+ nMin = nMid;
break;
}
else if( nTmp < nValue )
{
- if( nTmp + Len( nMitte ) >= nValue )
+ if( nTmp + Len( nMid ) >= nValue )
{
- nUnten = nMitte;
+ nMin = nMid;
break;
}
- nUnten = nMitte + 1;
+ nMin = nMid + 1;
}
- else if( nMitte == 0 )
+ else if( nMid == 0 )
{
break;
}
else
- nOben = nMitte - 1;
+ nMax = nMid - 1;
}
}
- // nUnten now points to an index i into the wrong list which
+ // nMin now points to an index i into the wrong list which
// 1. nValue is inside [ Area[i].pos, Area[i].pos + Area[i].len ] (inclusive!!!)
// 2. nValue < Area[i].pos
- return nUnten;
+ return nMin;
}
void SwWrongList::_Invalidate( sal_Int32 nBegin, sal_Int32 nEnd )
commit bf21fbf78567dc526d6dbc2f629d1a579b4c45e2
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jan 6 16:49:42 2014 +0100
translate German comments and convert them to doxygen style
Change-Id: I5e77f951b5a34e54d924c785f277ea88d155c56a
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 59fd2f5..ade06ed 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -90,10 +90,13 @@ void SwWrongList::ClearList()
maList.clear();
}
-/*************************************************************************
- * sal_Bool SwWrongList::InWrongWord() gibt den Anfang und die Laenge des
- * Wortes zurueck, wenn es als falsch markiert ist.
- *************************************************************************/
+/** If a word is incorrectly selected, this method returns begin and length of it.
+
+ @param[in,out] rChk starting position of the word to check
+ @param[out] rLn length of the word
+
+ @return <true> if incorrectly selected, <false> otherwise
+ */
sal_Bool SwWrongList::InWrongWord( sal_Int32 &rChk, sal_Int32 &rLn ) const
{
MSHORT nPos = GetWrongPos( rChk );
@@ -109,9 +112,13 @@ sal_Bool SwWrongList::InWrongWord( sal_Int32 &rChk, sal_Int32 &rLn ) const
return sal_False;
}
-/*************************************************************************
- * sal_Bool SwWrongList::Check() liefert den ersten falschen Bereich
- *************************************************************************/
+/** Calculate first incorrectly selected area.
+
+ @param[in,out] rChk starting position of the word to check
+ @param[in,out] rLn length of the word
+
+ @return <true> if incorrectly selected area was found, <false> otherwise
+ */
sal_Bool SwWrongList::Check( sal_Int32 &rChk, sal_Int32 &rLn ) const
{
MSHORT nPos = GetWrongPos( rChk );
@@ -143,10 +150,12 @@ sal_Bool SwWrongList::Check( sal_Int32 &rChk, sal_Int32 &rLn ) const
return sal_False;
}
-/*************************************************************************
- * sal_Int32 SwWrongList::NextWrong() liefert die naechste Fehlerposition
- *************************************************************************/
+/** Find next incorrectly selected position.
+ @param[in] rChk starting position of the word to check
+
+ @return starting position of incorrectly selected area, <STRING_LEN> otherwise
+ */
sal_Int32 SwWrongList::NextWrong( sal_Int32 nChk ) const
{
sal_Int32 nRet = STRING_LEN;
@@ -167,12 +176,13 @@ sal_Int32 SwWrongList::NextWrong( sal_Int32 nChk ) const
return nRet;
}
-/*************************************************************************
- * sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue )
- * sucht die erste Position im Array, die groessergleich nValue ist,
- * dies kann natuerlich auch hinter dem letzten Element sein!
- *************************************************************************/
+/** Find the first position that is greater or equal to the given value.
+ @note Resulting position might be behind the last element of the array.
+ @param[in] nValue value for comparison
+
+ @return first position that is greater or equal to the given value
+ */
sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
{
sal_uInt16 nOben = Count();
@@ -228,7 +238,7 @@ sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
}
// nUnten now points to an index i into the wrong list which
- // 1. nValue is inside [ Area[i].pos, Area[i].pos + Area[i].len ] (inkl!!!)
+ // 1. nValue is inside [ Area[i].pos, Area[i].pos + Area[i].len ] (inclusive!!!)
// 2. nValue < Area[i].pos
return nUnten;
@@ -248,13 +258,13 @@ void SwWrongList::SetInvalid( sal_Int32 nBegin, sal_Int32 nEnd )
nEndInvalid = nEnd;
}
+/** Change all values after the given postion.
-/*************************************************************************
- * SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
- * veraendert alle Positionen ab nPos um den angegebenen Wert,
- * wird nach Einfuegen oder Loeschen von Buchstaben benoetigt.
- *************************************************************************/
+ Needed after insert/deletion of characters.
+ @param nPos position after that everything should be changed
+ @param nDiff amount how much the positions should be moved
+ */
void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
{
MSHORT i = GetWrongPos( nPos );
@@ -305,8 +315,8 @@ void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
if( nEndInvalid >= nPos )
nEndInvalid += nDiff;
}
- // Wenn wir mitten in einem falschen Wort stehen, muss vom Wortanfang
- // invalidiert werden.
+ // If the pointer is in the middle of a wrong word,
+ // invalidation must happen from the beginning of that word.
if( i < Count() )
{
const sal_Int32 nWrPos = Pos( i );
@@ -327,13 +337,22 @@ void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
}
}
-/*************************************************************************
- * SwWrongList::Fresh
- *
- * For a given range [nPos, nPos + nLen[ and an index nIndex, this function
- * basically counts the number of SwWrongArea entries starting with nIndex
- * up to nPos + nLen. All these entries are removed.
- *************************************************************************/
+// TODO: Complete documentation
+/** Remove given range of entries
+
+ For a given range [nPos, nPos + nLen[ and an index nIndex, this function
+ basically counts the number of SwWrongArea entries starting with nIndex
+ up to nPos + nLen. All these entries are removed.
+
+ @param rStart ???
+ @param rEnd ???
+ @param nPos starting position of the range
+ @param nLen length of the range
+ @param nIndex index to start lookup at
+ @param nCursorPos ???
+
+ @return <true> if ???
+ */
sal_Bool SwWrongList::Fresh( sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPos,
sal_Int32 nLen, MSHORT nIndex, sal_Int32 nCursorPos )
{
commit 721f688b1339f878bce993fefd194304b23cb230
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jan 6 16:42:09 2014 +0100
remove visual noise in sw/source/core/text/wrong.cxx
Change-Id: I8069602fd9d1fe127213bae118fd6ff358703eb3
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 49d76f8..59fd2f5 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -22,10 +22,6 @@
#include "SwGrammarMarkUp.hxx"
-/*************************************************************************
- *SwWrongArea::SwWrongArea
- *************************************************************************/
-
SwWrongArea::SwWrongArea( const rtl::OUString& rType, WrongListType listType,
com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag,
sal_Int32 nPos,
@@ -50,9 +46,6 @@ SwWrongArea::SwWrongArea( const rtl::OUString& rType,
}
}
-/*************************************************************************
- * SwWrongList::SwWrongList()
- *************************************************************************/
SwWrongList::SwWrongList( WrongListType eType ) :
meType (eType),
nBeginInvalid(STRING_LEN), // everything correct... (the invalid area starts beyond the string)
@@ -66,10 +59,6 @@ SwWrongList::~SwWrongList()
ClearList();
}
-/*************************************************************************
- * SwWrongList* SwWrongList::Clone()
- *************************************************************************/
-
SwWrongList* SwWrongList::Clone()
{
SwWrongList* pClone = new SwWrongList( meType );
@@ -77,10 +66,6 @@ SwWrongList* SwWrongList::Clone()
return pClone;
}
-/*************************************************************************
- * void SwWrongList::CopyFrom( const SwWrongList& rCopy )
- *************************************************************************/
-
void SwWrongList::CopyFrom( const SwWrongList& rCopy )
{
maList = rCopy.maList;
@@ -94,9 +79,6 @@ void SwWrongList::CopyFrom( const SwWrongList& rCopy )
}
}
-/*************************************************************************
- * SwWrongList::ClearList()
- *************************************************************************/
void SwWrongList::ClearList()
{
for ( size_t i = 0; i < maList.size(); ++i)
@@ -252,10 +234,6 @@ sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
return nUnten;
}
-/*************************************************************************
- * void SwWrongList::_Invalidate()
- *************************************************************************/
-
void SwWrongList::_Invalidate( sal_Int32 nBegin, sal_Int32 nEnd )
{
if ( nBegin < GetBeginInv() )
@@ -518,7 +496,6 @@ void SwWrongList::JoinList( SwWrongList* pNext, sal_Int32 nInsertPos )
Invalidate( nInsertPos ? nInsertPos - 1 : nInsertPos, nInsertPos + 1 );
}
-
void SwWrongList::InsertSubList( sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList* pSubList )
{
if (pSubList)
@@ -533,7 +510,6 @@ void SwWrongList::InsertSubList( sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt1
maList.insert(i, SwWrongArea( OUString(), 0, nNewPos, nNewLen, pSubList ) );
}
-
// New functions: Necessary because SwWrongList has been changed to use std::vector
void SwWrongList::Insert(sal_uInt16 nWhere, std::vector<SwWrongArea>::iterator startPos, std::vector<SwWrongArea>::iterator endPos)
{
@@ -647,18 +623,14 @@ void SwWrongList::Insert( const OUString& rType,
// insert at current position
break;
}
-
++aIter;
}
-
break;
}
-
++aIter;
}
maList.insert(aIter, SwWrongArea( rType, meType, xPropertyBag, nNewPos, nNewLen) );
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list