[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 4 commits - editeng/source linguistic/source sw/source wizards/com

Andras Timar timar at kemper.freedesktop.org
Mon Apr 23 00:06:45 PDT 2012


 editeng/source/items/frmitems.cxx                               |    3 
 linguistic/source/lngprophelp.cxx                               |    1 
 sw/source/core/doc/doccomp.cxx                                  |   15 ++-
 wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java |   45 +++++++---
 4 files changed, 44 insertions(+), 20 deletions(-)

New commits:
commit cfdd2f747acc85bfc8ee1536ed2e0a4bdfbe2937
Author: Szabolcs Dezsi <dezsiszabi at hotmail.com>
Date:   Sun Mar 4 00:57:53 2012 +0100

    Dropdown list in Letter Wizard are now ordered alphabetically
    
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
index 736233c..c7e6e96 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java
@@ -27,6 +27,8 @@
  ************************************************************************/
 package com.sun.star.wizards.letter;
 
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Vector;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
@@ -65,6 +67,20 @@ import com.sun.star.wizards.common.Helper;
 public class LetterWizardDialogImpl extends LetterWizardDialog
 {
 
+    private class Strings
+    {
+        public String Norm;
+        public String NormPath;
+        public String LanguageLabel;
+
+        public Strings(String norm, String normPath, String languageLabel)
+        {
+            Norm = norm;
+            NormPath = normPath;
+            LanguageLabel = languageLabel;
+        }
+    }
+
     protected void enterStep(int OldStep, int NewStep)
     {
     }
@@ -1163,9 +1179,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
             e.printStackTrace();
         }
 
-        Vector NormsVector = new Vector();
-        Vector NormsPathVector = new Vector();
-        Vector LanguageLabelsVector = new Vector();
+        Vector StringsVector = new Vector();
+
         String[] LanguageLabels;
 
         boolean found = false;
@@ -1202,21 +1217,25 @@ public class LetterWizardDialogImpl extends LetterWizardDialog
 
             if (found)
             {
-                NormsVector.add(cIsoCode);
-                NormsPathVector.add(nameList[i]);
-                LanguageLabelsVector.add(lc.getLanguageString(MSID));
+                StringsVector.add(new Strings(cIsoCode, (String)nameList[i], lc.getLanguageString(MSID)));
             }
         }
 
+        Collections.sort(StringsVector, new Comparator() {
+                public int compare(Object a, Object b) {
+                        return ((Strings)a).LanguageLabel.compareTo(((Strings)b).LanguageLabel);
+                }
+        });
 
-        Norms = new String[NormsVector.size()];
-        NormsVector.toArray(Norms);
-
-        NormPaths = new String[NormsPathVector.size()];
-        NormsPathVector.toArray(NormPaths);
+        Norms = new String[StringsVector.size()];
+        NormPaths = new String[StringsVector.size()];
+        LanguageLabels = new String[StringsVector.size()];
 
-        LanguageLabels = new String[LanguageLabelsVector.size()];
-        LanguageLabelsVector.toArray(LanguageLabels);
+        for(int i = 0; i<StringsVector.size(); i++) {
+                Norms[i] = ((Strings)StringsVector.elementAt(i)).Norm;
+                NormPaths[i] = ((Strings)StringsVector.elementAt(i)).NormPath;
+                LanguageLabels[i] = ((Strings)StringsVector.elementAt(i)).LanguageLabel;
+        }
 
         setControlProperty("lstLetterNorm", PropertyNames.STRING_ITEM_LIST, LanguageLabels);
     }
commit fb172ff8a71765799d5e45edebfeae72243dcf46
Author: Szabolcs Dezsi <dezsiszabi at hotmail.com>
Date:   Thu Mar 8 14:52:14 2012 +0100

    fdo#43424: Comparing empty document with attached one crashes LO
    
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 8f4f56d..1e1bd06 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1327,14 +1327,17 @@ void SwCompareData::ShowDelete( const CompareData& rData, sal_uLong nStt,
         ((SwCompareLine*)rData.GetLine( nEnd-1 ))->GetEndNode(), 1 );
 
     sal_uInt16 nOffset = 0;
-    const CompareLine* pLine;
-    if( GetLineCount() == nInsPos )
+    const CompareLine* pLine = 0;
+    if( nInsPos >= 1 )
     {
-        pLine = GetLine( nInsPos-1 );
-        nOffset = 1;
+        if( GetLineCount() == nInsPos )
+        {
+            pLine = GetLine( nInsPos-1 );
+            nOffset = 1;
+        }
+        else
+            pLine = GetLine( nInsPos );
     }
-    else
-        pLine = GetLine( nInsPos );
 
     const SwNode* pLineNd;
     if( pLine )
commit 1ad284007d898c68665c91979be3bd326c290ba1
Author: Dezsi Szabolcs <dezsiszabi at hotmail.com>
Date:   Fri Apr 20 14:10:56 2012 +0530

    fdo#47436: Fixed crash while opening odt file.
    
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index f01f91e..48beef6 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1943,7 +1943,8 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
                 {
                     editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) );
-                    pLine->SetStyle( eBorderStyle );
+                    if( pLine )
+                        pLine->SetStyle( eBorderStyle );
                 }
                 return sal_True;
             }
commit 563e65eea742df35ab9b620f6384c2918c32915c
Author: Szabolcs Dezsi <dezsiszabi at hotmail.com>
Date:   Sat Apr 21 15:28:50 2012 +0200

    Resolves: fdo#39999: Changing spelling preferences requires application restart
    
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx
index da7c08d..55f83c3 100644
--- a/linguistic/source/lngprophelp.cxx
+++ b/linguistic/source/lngprophelp.cxx
@@ -522,6 +522,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
     nResMaxNumberOfSuggestions  = GetDefaultNumberOfSuggestions();
     bResIsSpellWithDigits       = bIsSpellWithDigits;
     bResIsSpellCapitalization   = bIsSpellCapitalization;
+    bResIsSpellUpperCase        = bIsSpellUpperCase;
 
     sal_Int32 nLen = rPropVals.getLength();
     if (nLen)


More information about the Libreoffice-commits mailing list