lingucomponent/source/languageguessing/guess.cxx         |    6 
 lingucomponent/source/languageguessing/guess.hxx         |    2 
 lingucomponent/source/languageguessing/simpleguesser.cxx |   95 +++++++--------
 lingucomponent/source/languageguessing/simpleguesser.hxx |    4 
 sfx2/source/dialog/filtergrouping.cxx                    |   41 ++++--
 svx/inc/svx/svddrgv.hxx                                  |    7 -
 svx/source/svdraw/svddrgv.cxx                            |   63 ---------
 unusedcode.easy                                          |   10 -
 8 files changed, 85 insertions(+), 143 deletions(-)

New commits:
commit 45f536210e8c0376bc047db024e88566557994c5
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Sep 27 12:28:42 2011 +0100

    update list

diff --git a/unusedcode.easy b/unusedcode.easy
index 2008d48..51939c1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -74,6 +74,7 @@ CharPosArray::Replace(int const*, unsigned short, unsigned 
short)
 CharPosArray::_ForEach(unsigned short, unsigned short, unsigned char (*)(int 
const&, void*), void*)
 CloneList::Count() const
 Color::IncreaseContrast(unsigned char)
+ComboBox::SetTopEntry(unsigned short)
 CommunicationLinkList::DeleteAndDestroy(unsigned short, unsigned short)
 CommunicationLinkList::Insert(CommunicationLink const*&, unsigned short&)
 CommunicationLinkList::Insert(CommunicationLink const**, unsigned short)
@@ -154,7 +155,6 @@ ElementCollector::setSecurityId(int)
 EnhWMFReader::ReadGDIComment()
 ExtraKernInfo::HasKernPairs() const
 FieldEntry::GetBookmarkType()
-FileControl::ResetButtonText()
 FileControl::SetButtonText(String const&)
 FileList::GetFormat()
 FileStat::FileStat(void const*, void const*)
@@ -526,6 +526,7 @@ ScDPItemData::CreateTypeString()
 ScDPItemData::GetNumFormat() const
 
ScDPSaveData::Refresh(com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>
 const&)
 ScDdeLink::ResetValue()
+ScDocFunc::ModifyAllRangeNames(ScRangeName const*, std::map<short, ScRangeName 
const*, std::less<short>, std::allocator<std::pair<short const, ScRangeName 
const*> > > const&)
 ScDocRowHeightUpdater::TabRanges::TabRanges()
 ScDocument::HasControl(short, Rectangle const&)
 ScDocument::InvalidateControls(Window*, short, Rectangle const&)
@@ -552,6 +553,7 @@ ScMultiTextWnd::GetLineCount()
 ScMyCellInfo::ScMyCellInfo()
 ScMyStyleRanges::SetStylesToRanges(ScRangeList*, rtl::OUString const*, short, 
rtl::OUString const*, ScXMLImport&)
 ScMyStyleRanges::SetStylesToRanges(ScRangeListRef, rtl::OUString const*, 
short, rtl::OUString const*, ScXMLImport&)
+ScNameDlg::CalcCurTableAssign(String&, ScRangeData*)
 ScNamedRangeObj::SetContentWithGrammar(rtl::OUString const&, 
formula::FormulaGrammar::Grammar)
 
ScNamedRangeObj::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
 ScOutputData::DrawEditParam::getEngineWidth(ScFieldEditEngine*) const
@@ -1115,6 +1117,7 @@ SvxLineColorItem::SvxLineColorItem(Color const&, unsigned 
short)
 SvxListBoxControl::RegisterControl(unsigned short, SfxModule*)
 SvxMSConvertOCXControls::OCX_Factory(String const&)
 SvxMSConvertOCXControls::WriteOCXExcelKludgeStream(SotStorageStreamRef&, 
com::sun::star::uno::Reference<com::sun::star::awt::XControlModel> const&, 
com::sun::star::awt::Size const&, String&)
+SvxMSConvertOCXControls::WriteOCXStream(SotStorageRef&, 
com::sun::star::uno::Reference<com::sun::star::awt::XControlModel> const&, 
com::sun::star::awt::Size const&, String&)
 SvxMSDffManager::GetAutoForm(MSO_SPT) const
 SvxMSDffManager::ImportFontWork(SvStream&, SfxItemSet&, Rectangle&) const
 SvxMSDffManager::Scale(PolyPolygon&) const
@@ -2883,6 +2886,7 @@ sw::util::AuthorInfos::Remove(sw::util::AuthorInfo* 
const&, unsigned short)
 sw::util::AuthorInfos::Remove(unsigned short, unsigned short)
 test::OfficeConnection::OfficeConnection()
 test::OfficeConnection::getComponentContext() const
+test::OfficeConnection::isStillAlive() const
 test::OfficeConnection::setUp()
 test::OfficeConnection::tearDown()
 test::OfficeConnection::~OfficeConnection()
commit ca3c96b0753a280021989563422bab7698dc1bd8
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Sep 27 01:18:49 2011 +0100

    callcatcher: some unused methods

diff --git a/svx/inc/svx/svddrgv.hxx b/svx/inc/svx/svddrgv.hxx
index 6c98039..f7ee89c 100644
--- a/svx/inc/svx/svddrgv.hxx
+++ b/svx/inc/svx/svddrgv.hxx
@@ -70,7 +70,6 @@ protected:
 
     sal_uIntPtr                     nDragXorPolyLimit;
     sal_uIntPtr                     nDragXorPointLimit;
-    sal_uInt16                      nRubberEdgeDraggingLimit;
     sal_uInt16                      nDetailedEdgeDraggingLimit;
 
     unsigned                    bFramDrag : 1;        // z.Zt. FrameDrag
@@ -238,10 +237,8 @@ public:
     // Gummibaender sondern komplette Neuberechnunen sind beim Draggen 
sichtbar.
     // Diese detalierte Darstellung ist eh nur beim MoveDrag moeglich.
     // Defaultwert ist 10
-    void SetDetailedEdgeDragging(sal_Bool bOn); // Default an
     sal_Bool IsDetailedEdgeDragging() const { return bDetailedEdgeDragging; }
 
-    void SetDetailedEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz);
     sal_uInt16 GetDetailedEdgeDraggingLimit() const { return 
nDetailedEdgeDraggingLimit; }
 
     // EdgeDraggingLimit: Sind mehr als nEdgeObjAnz Kanten betroffen, werden
@@ -249,12 +246,8 @@ public:
     // Gemeint sind hier die "Gummibaender", die weniger Rechenzeit benoetigen
     // als die kompletten Neuberechnungen beim DetailedEdgeDragging.
     // Defaultwert ist 100
-    void SetRubberEdgeDragging(sal_Bool bOn);  // Default an
     sal_Bool IsRubberEdgeDragging() const { return bRubberEdgeDragging; }
 
-    void SetRubberEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz);
-    sal_uInt16 GetRubberEdgeDraggingLimit() const { return 
nRubberEdgeDraggingLimit; }
-
     // Verbinderhandling also zu deutsch wie folgt (bei Defaulteinstellungen):
     // - Sind bis max 10 Verbinder betroffen werden diese bei jedem
     //   MouseMove neu berechnet
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index e232947..a64c84d 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -91,7 +91,6 @@ void SdrDragView::ImpClearVars()
     bAutoVertexCon=sal_True;
     bAutoCornerCon=sal_False;
     bRubberEdgeDragging=sal_True;
-    nRubberEdgeDraggingLimit=100;
     bDetailedEdgeDragging=sal_True;
     nDetailedEdgeDraggingLimit=10;
     bResizeAtCenter=sal_False;
@@ -919,68 +918,6 @@ sal_Bool SdrDragView::IsOrthoDesired() const
     return sal_False;
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-void SdrDragView::SetRubberEdgeDragging(sal_Bool bOn)
-{
-    if (bOn!=IsRubberEdgeDragging())
-    {
-        sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
-        sal_Bool bShowHide=nAnz!=0 && IsDragObj() &&
-                 (nRubberEdgeDraggingLimit>=nAnz);
-        if (bShowHide)
-            HideDragObj();
-        bRubberEdgeDragging=bOn;
-        if (bShowHide)
-            ShowDragObj();
-    }
-}
-
-void SdrDragView::SetRubberEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz)
-{
-    if (nEdgeObjAnz!=nRubberEdgeDraggingLimit)
-    {
-        sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
-        sal_Bool bShowHide=IsRubberEdgeDragging() && nAnz!=0 && IsDragObj() &&
-                 (nEdgeObjAnz>=nAnz)!=(nRubberEdgeDraggingLimit>=nAnz);
-        if (bShowHide)
-            HideDragObj();
-        nRubberEdgeDraggingLimit=nEdgeObjAnz;
-        if (bShowHide)
-            ShowDragObj();
-    }
-}
-
-void SdrDragView::SetDetailedEdgeDragging(sal_Bool bOn)
-{
-    if (bOn!=IsDetailedEdgeDragging())
-    {
-        sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
-        sal_Bool bShowHide=nAnz!=0 && IsDragObj() &&
-                 (nDetailedEdgeDraggingLimit>=nAnz);
-        if (bShowHide)
-            HideDragObj();
-        bDetailedEdgeDragging=bOn;
-        if (bShowHide)
-            ShowDragObj();
-    }
-}
-
-void SdrDragView::SetDetailedEdgeDraggingLimit(sal_uInt16 nEdgeObjAnz)
-{
-    if (nEdgeObjAnz!=nDetailedEdgeDraggingLimit)
-    {
-        sal_uIntPtr nAnz = GetEdgesOfMarkedNodes().GetMarkCount();
-        sal_Bool bShowHide=IsDetailedEdgeDragging() && nAnz!=0 && IsDragObj() 
&&
-                 (nEdgeObjAnz>=nAnz)!=(nDetailedEdgeDraggingLimit>=nAnz);
-        if (bShowHide)
-            HideDragObj();
-        nDetailedEdgeDraggingLimit=nEdgeObjAnz;
-        if (bShowHide)
-            ShowDragObj();
-    }
-}
-
 void SdrDragView::SetMarkHandles()
 {
     if( pDragHdl )
diff --git a/unusedcode.easy b/unusedcode.easy
index eece014..2008d48 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -631,10 +631,6 @@ SdrCustomShapeDataItem::SdrCustomShapeDataItem(String 
const&)
 SdrCustomShapeEngineItem::SdrCustomShapeEngineItem(String const&)
 SdrCustomShapeGeometryItem::ClearPropertyValue(rtl::OUString const&, 
rtl::OUString const&)
 SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem(String 
const&)
-SdrDragView::SetDetailedEdgeDragging(unsigned char)
-SdrDragView::SetDetailedEdgeDraggingLimit(unsigned short)
-SdrDragView::SetRubberEdgeDragging(unsigned char)
-SdrDragView::SetRubberEdgeDraggingLimit(unsigned short)
 SdrEditView::MoveLayer(String const&, unsigned short)
 SdrEngineDefaults::LanguageHasChanged()
 SdrExchangeView::GetPastePos(SdrObjList*, OutputDevice*)
commit 7c1a3fc43a2f606f387ef30085fc72389551bfed
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Sep 27 01:06:52 2011 +0100

    ByteString->rtl::OStringBuffer

diff --git a/sfx2/source/dialog/filtergrouping.cxx 
b/sfx2/source/dialog/filtergrouping.cxx
index bc2672f..43fd007 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -35,6 +35,7 @@
 #include <sfx2/docfac.hxx>
 #include "sfx2/sfxresid.hxx"
 #include <osl/thread.h>
+#include <rtl/strbuf.hxx>
 #include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
 #include <com/sun/star/beans/StringPair.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
@@ -825,9 +826,11 @@ namespace sfx2
             catch( const IllegalArgumentException& )
             {
 #ifdef DBG_UTIL
-                ByteString aMsg( "sfx2::lcl_EnsureAllFilesEntry: could not 
append Filter" );
-                aMsg += ByteString( String( sAllFilterName ), 
RTL_TEXTENCODING_UTF8 );
-                OSL_FAIL( aMsg.GetBuffer() );
+                rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
+                    "sfx2::lcl_EnsureAllFilesEntry: could not append Filter"));
+                aMsg.append(rtl::OUStringToOString(sAllFilterName,
+                    RTL_TEXTENCODING_UTF8));
+                OSL_FAIL( aMsg.getStr() );
 #endif
             }
         }
@@ -977,9 +980,11 @@ namespace sfx2
         catch( const IllegalArgumentException& )
         {
 #ifdef DBG_UTIL
-            ByteString aMsg( "Could not append DefaultFilter" );
-            aMsg += ByteString( String( sUIName ), osl_getThreadTextEncoding() 
);
-            DBG_ERRORFILE( aMsg.GetBuffer() );
+            rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
+                "Could not append DefaultFilter"));
+            aMsg.append(rtl::OUStringToOString(sUIName,
+                osl_getThreadTextEncoding()));
+            DBG_ERRORFILE(aMsg.getStr());
 #endif
         }
 
@@ -1001,9 +1006,11 @@ namespace sfx2
             catch( const IllegalArgumentException& )
             {
     #ifdef DBG_UTIL
-                ByteString aMsg( "Could not append Filter" );
-                aMsg += ByteString( String( sUIName ), 
osl_getThreadTextEncoding() );
-                DBG_ERRORFILE( aMsg.GetBuffer() );
+                rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
+                    "Could not append Filter"));
+                aMsg.append(rtl::OUStringToOString(sUIName,
+                    osl_getThreadTextEncoding()));
+                DBG_ERRORFILE( aMsg.getStr() );
     #endif
             }
         }
@@ -1155,9 +1162,11 @@ namespace sfx2
                 catch( const IllegalArgumentException& )
                 {
         #ifdef DBG_UTIL
-                    ByteString aMsg( "Could not append Filter" );
-                    aMsg += ByteString( String( sUIName ), 
osl_getThreadTextEncoding() );
-                    DBG_ERRORFILE( aMsg.GetBuffer() );
+                    rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
+                        "Could not append Filter"));
+                    aMsg.append(rtl::OUStringToOString(sUIName,
+                        osl_getThreadTextEncoding()));
+                    DBG_ERRORFILE( aMsg.getStr() );
         #endif
                 }
             }
@@ -1177,9 +1186,11 @@ namespace sfx2
                 catch( const IllegalArgumentException& )
                 {
         #ifdef DBG_UTIL
-                    ByteString aMsg( "Could not append Filter" );
-                    aMsg += ByteString( String( sUIName ), 
osl_getThreadTextEncoding() );
-                    DBG_ERRORFILE( aMsg.GetBuffer() );
+                    rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM(
+                        "Could not append Filter"));
+                    aMsg.append(rtl::OUStringToOString(sUIName,
+                        osl_getThreadTextEncoding()));
+                    DBG_ERRORFILE( aMsg.getStr() );
         #endif
                 }
             }
commit 04b95fc8d06f9f6b01ec47101b293c5db7b27c8a
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Sep 26 22:38:26 2011 +0100

    decast this a bit

diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx 
b/lingucomponent/source/languageguessing/simpleguesser.cxx
index 5f18ebc..1a87ca0 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -155,9 +155,7 @@ vector<Guess> SimpleGuesser::GuessLanguage(const char* text)
 Guess SimpleGuesser::GuessPrimaryLanguage(const char* text)
 {
     vector<Guess> ret = GuessLanguage(text);
-    if (!ret.empty())
-        return ret[0];
-    return Guess();
+    return ret.empty() ? Guess() : ret[0];
 }
 /**
  * Is used to know wich language is available, unavailable or both
@@ -167,17 +165,18 @@ Guess SimpleGuesser::GuessPrimaryLanguage(const char* 
text)
  */
 vector<Guess> SimpleGuesser::GetManagedLanguages(const char mask)
 {
-    size_t i;
     textcat_t *tables = (textcat_t*)h;
 
     vector<Guess> lang;
     if(!h){return lang;}
 
-    for (i=0; i<tables->size; i++) {
-        if(tables->fprint_disable[i] & mask){
+    for (size_t i=0; i<tables->size; ++i)
+    {
+        if (tables->fprint_disable[i] & mask)
+        {
             string langStr = "[";
-            langStr += (char*)fp_Name(tables->fprint[i]);
-            Guess g( (char *)langStr.c_str());
+            langStr += fp_Name(tables->fprint[i]);
+            Guess g(langStr.c_str());
             lang.push_back(g);
         }
     }
@@ -185,49 +184,52 @@ vector<Guess> SimpleGuesser::GetManagedLanguages(const 
char mask)
     return lang;
 }
 
-vector<Guess> SimpleGuesser::GetAvailableLanguages(){
+vector<Guess> SimpleGuesser::GetAvailableLanguages()
+{
     return GetManagedLanguages( sal::static_int_cast< char >( 0xF0 ) );
 }
 
-vector<Guess> SimpleGuesser::GetUnavailableLanguages(){
+vector<Guess> SimpleGuesser::GetUnavailableLanguages()
+{
     return GetManagedLanguages( sal::static_int_cast< char >( 0x0F ));
 }
 
-vector<Guess> SimpleGuesser::GetAllManagedLanguages(){
+vector<Guess> SimpleGuesser::GetAllManagedLanguages()
+{
     return GetManagedLanguages( sal::static_int_cast< char >( 0xFF ));
 }
 
-void SimpleGuesser::XableLanguage(string lang, char mask){
-    size_t i;
+void SimpleGuesser::XableLanguage(string lang, char mask)
+{
     textcat_t *tables = (textcat_t*)h;
 
     if(!h){return;}
 
-    for (i=0; i<tables->size; i++) {
+    for (size_t i=0; i<tables->size; i++)
+    {
         string language(fp_Name(tables->fprint[i]));
-        if(start(language,lang) == 0){
-            //cout << language << endl;
+        if (start(language,lang) == 0)
             tables->fprint_disable[i] = mask;
-            //continue;
-        }
     }
 }
 
-void SimpleGuesser::EnableLanguage(string lang){
+void SimpleGuesser::EnableLanguage(string lang)
+{
     XableLanguage(lang,  sal::static_int_cast< char >( 0xF0 ));
 }
 
-void SimpleGuesser::DisableLanguage(string lang){
+void SimpleGuesser::DisableLanguage(string lang)
+{
     XableLanguage(lang,  sal::static_int_cast< char >( 0x0F ));
 }
 
 /**
 *
 */
-void SimpleGuesser::SetDBPath(const char* path, const char* prefix){
-    if(h){
+void SimpleGuesser::SetDBPath(const char* path, const char* prefix)
+{
+    if (h)
         textcat_Done(h);
-    }
     h = special_textcat_Init(path, prefix);
 }
 
commit 602b63b0e4b81b416e8c2682750e97a20b74c7d9
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Sep 26 22:34:08 2011 +0100

    why call twice, we've already got the result

diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx 
b/lingucomponent/source/languageguessing/simpleguesser.cxx
index 0b8e59f..5f18ebc 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -156,7 +156,7 @@ Guess SimpleGuesser::GuessPrimaryLanguage(const char* text)
 {
     vector<Guess> ret = GuessLanguage(text);
     if (!ret.empty())
-        return GuessLanguage(text)[0];
+        return ret[0];
     return Guess();
 }
 /**
commit fcd9b06ac744b1c709ab754a123bad64405dabc9
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Sep 26 22:32:26 2011 +0100

    constify some of this

diff --git a/lingucomponent/source/languageguessing/guess.cxx 
b/lingucomponent/source/languageguessing/guess.cxx
index 3885a41..dc0a743 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -51,7 +51,7 @@ Guess::Guess()
 *
 */
 
-Guess::Guess(char * guess_str)
+Guess::Guess(const char * guess_str)
 {
     Guess();
 
@@ -108,7 +108,9 @@ Guess::Guess(char * guess_str)
     }
 }
 
-Guess::~Guess(){}
+Guess::~Guess()
+{
+}
 
 string Guess::GetLanguage()
 {
diff --git a/lingucomponent/source/languageguessing/guess.hxx 
b/lingucomponent/source/languageguessing/guess.hxx
index 5b601ed..50e7b00 100644
--- a/lingucomponent/source/languageguessing/guess.hxx
+++ b/lingucomponent/source/languageguessing/guess.hxx
@@ -53,7 +53,7 @@ class Guess{
         /**
          * Init from a string like [en-UK-utf8] and the rank
          */
-        Guess(char * guess_str);
+        Guess(const char * guess_str);
 
         ~Guess();
 
diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx 
b/lingucomponent/source/languageguessing/simpleguesser.cxx
index eab9f2a..0b8e59f 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -112,7 +112,7 @@ SimpleGuesser::~SimpleGuesser()
 /*!
     \fn SimpleGuesser::GuessLanguage(char* text)
  */
-vector<Guess> SimpleGuesser::GuessLanguage(char* text)
+vector<Guess> SimpleGuesser::GuessLanguage(const char* text)
 {
     vector<Guess> guesses;
 
@@ -125,7 +125,7 @@ vector<Guess> SimpleGuesser::GuessLanguage(char* text)
     if (len > MAX_STRING_LENGTH_TO_ANALYSE)
         len = MAX_STRING_LENGTH_TO_ANALYSE;
 
-    char *guess_list = textcat_Classify(h, text, len);
+    const char *guess_list = textcat_Classify(h, text, len);
 
     if (strcmp(guess_list, _TEXTCAT_RESULT_SHORT) == 0)
         return guesses;
@@ -134,11 +134,11 @@ vector<Guess> SimpleGuesser::GuessLanguage(char* text)
 
     for(int i = 0; guess_list[current_pointer] != '\0'; i++)
     {
-        while(guess_list[current_pointer] != GUESS_SEPARATOR_OPEN && 
guess_list[current_pointer] != '\0')
+        while (guess_list[current_pointer] != GUESS_SEPARATOR_OPEN && 
guess_list[current_pointer] != '\0')
             current_pointer++;
         if(guess_list[current_pointer] != '\0')
         {
-            Guess g((char*)(guess_list + current_pointer));
+            Guess g(guess_list + current_pointer);
 
             guesses.push_back(g);
 
@@ -152,15 +152,12 @@ vector<Guess> SimpleGuesser::GuessLanguage(char* text)
 /*!
     \fn SimpleGuesser::GuessPrimaryLanguage(char* text)
  */
-Guess SimpleGuesser::GuessPrimaryLanguage(char* text)
+Guess SimpleGuesser::GuessPrimaryLanguage(const char* text)
 {
     vector<Guess> ret = GuessLanguage(text);
-    if(!ret.empty()){
+    if (!ret.empty())
         return GuessLanguage(text)[0];
-    }
-    else{
-        return Guess();
-    }
+    return Guess();
 }
 /**
  * Is used to know wich language is available, unavailable or both
diff --git a/lingucomponent/source/languageguessing/simpleguesser.hxx 
b/lingucomponent/source/languageguessing/simpleguesser.hxx
index 4a164c7..2863a6e 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.hxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.hxx
@@ -61,14 +61,14 @@ public:
      * @param char* text is the text to analyze
      * @return the list of guess
      */
-    vector<Guess> GuessLanguage(char* text);
+    vector<Guess> GuessLanguage(const char* text);
 
     /**
      * Analyze a text and return the most probable language of the text
      * @param char* text is the text to analyze
      * @return the guess (containing language)
      */
-    Guess GuessPrimaryLanguage(char* text);
+    Guess GuessPrimaryLanguage(const char* text);
 
     /**
      * List all available languages (possibly to be in guesses)
commit dd32608012fdd017ab8ad303cca2453f2f8dcbd7
Author: Caolán McNamara <caol...@redhat.com>
Date:   Mon Sep 26 22:23:37 2011 +0100

    fix mangled indent

diff --git a/lingucomponent/source/languageguessing/simpleguesser.cxx 
b/lingucomponent/source/languageguessing/simpleguesser.cxx
index 53279f8..eab9f2a 100644
--- a/lingucomponent/source/languageguessing/simpleguesser.cxx
+++ b/lingucomponent/source/languageguessing/simpleguesser.cxx
@@ -114,37 +114,37 @@ SimpleGuesser::~SimpleGuesser()
  */
 vector<Guess> SimpleGuesser::GuessLanguage(char* text)
 {
-        vector<Guess> guesses;
+    vector<Guess> guesses;
 
-        if(!h){return guesses;}
+    if (!h)
+        return guesses;
 
-        //calculate le number of unicode charcters (symbols)
-        int len = utfstrlen(text);
+    //calculate le number of unicode charcters (symbols)
+    int len = utfstrlen(text);
 
-    if( len > MAX_STRING_LENGTH_TO_ANALYSE ){len = 
MAX_STRING_LENGTH_TO_ANALYSE ;}
+    if (len > MAX_STRING_LENGTH_TO_ANALYSE)
+        len = MAX_STRING_LENGTH_TO_ANALYSE;
 
-        char *guess_list = textcat_Classify(h, text, len);
+    char *guess_list = textcat_Classify(h, text, len);
 
-        if(strcmp(guess_list, _TEXTCAT_RESULT_SHORT) == 0){
-            return guesses;
-        }
+    if (strcmp(guess_list, _TEXTCAT_RESULT_SHORT) == 0)
+        return guesses;
 
-        int current_pointer = 0;
+    int current_pointer = 0;
 
-        for(int i = 0; guess_list[current_pointer] != '\0'; i++)
+    for(int i = 0; guess_list[current_pointer] != '\0'; i++)
+    {
+        while(guess_list[current_pointer] != GUESS_SEPARATOR_OPEN && 
guess_list[current_pointer] != '\0')
+            current_pointer++;
+        if(guess_list[current_pointer] != '\0')
         {
-            while(guess_list[current_pointer] != GUESS_SEPARATOR_OPEN && 
guess_list[current_pointer] != '\0'){
-                current_pointer++;
-            }
-            if(guess_list[current_pointer] != '\0')
-            {
-                Guess g((char*)(guess_list + current_pointer));
+            Guess g((char*)(guess_list + current_pointer));
 
-                guesses.push_back(g);
+            guesses.push_back(g);
 
-                current_pointer++;
-            }
+            current_pointer++;
         }
+    }
 
     return guesses;
 }
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to