[Libreoffice-commits] .: 2 commits - sw/qa writerfilter/source

2012-04-21 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo48023.rtf  |8 
 sw/qa/extras/rtftok/rtftok.cxx |   25 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   17 +++--
 3 files changed, 48 insertions(+), 2 deletions(-)

New commits:
commit e0190ffa766dbe26a9d4e9dd29e00baaf0ccd5b9
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 11:28:41 2012 +0200

rtftok: dump collected strings after encoding

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2b30481..e50cc1f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -818,9 +818,9 @@ int RTFDocumentImpl::resolveChars(char ch)
 m_aStates.top().aLevelNumbers.push_back(sal_Int32(ch));
 return 0;
 }
-SAL_INFO(writerfilter, OSL_THIS_FUNC  : collected '  aStr.getStr() 
 ');
 
 OUString aOUStr(OStringToOUString(aStr, m_aStates.top().nCurrentEncoding));
+SAL_INFO(writerfilter, OSL_THIS_FUNC  : collected '  aOUStr  
');
 
 if (m_aStates.top().nDestinationState == DESTINATION_COLORTABLE)
 {
commit f8bda240a09b4ece1c3401874b3cc8f325dbcedb
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 11:25:18 2012 +0200

fdo#48023 fix RTF import of Russian characters without an encoding specified

lcl_GetDefaultTextEncodingForRTF() in editeng did the same.

diff --git a/sw/qa/extras/rtftok/data/fdo48023.rtf 
b/sw/qa/extras/rtftok/data/fdo48023.rtf
new file mode 100644
index 000..6d6a0d9
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo48023.rtf
@@ -0,0 +1,8 @@
+{\rtf
+{\fonttbl
+{\f1 Arial;}
+}
+\pard
+\f1 Ïðîãðàììèñò
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index fa1321f..6870f02 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -82,6 +82,7 @@ public:
 void testFdo44176();
 void testFdo39053();
 void testFdo48356();
+void testFdo48023();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -106,6 +107,7 @@ public:
 CPPUNIT_TEST(testFdo44176);
 CPPUNIT_TEST(testFdo39053);
 CPPUNIT_TEST(testFdo48356);
+CPPUNIT_TEST(testFdo48023);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -574,6 +576,29 @@ void RtfModelTest::testFdo48356()
 CPPUNIT_ASSERT_EQUAL(1, i);
 }
 
+void RtfModelTest::testFdo48023()
+{
+lang::Locale aLocale;
+aLocale.Language = ru;
+AllSettings aSettings(Application::GetSettings());
+AllSettings aSavedSettings(aSettings);
+aSettings.SetLocale(aLocale);
+Application::SetSettings(aSettings);
+load(fdo48023.rtf);
+Application::SetSettings(aSavedSettings);
+
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+uno::Referencetext::XTextRange xTextRange(xRangeEnum-nextElement(), 
uno::UNO_QUERY);
+
+// Implicit encoding detection based on locale was missing
+OUString aExpected(Программист, 22, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2527cef..2b30481 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -513,13 +513,26 @@ sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 
nIndex)
 return 0;
 }
 
+rtl_TextEncoding lcl_getDefaultTextEncoding()
+{
+
+const OUString rLanguage = 
Application::GetSettings().GetLocale().Language;
+
+if (rLanguage == ru || rLanguage == uk)
+return RTL_TEXTENCODING_MS_1251;
+if (rLanguage == tr)
+return RTL_TEXTENCODING_MS_1254;
+else
+return RTL_TEXTENCODING_MS_1252;
+}
+
 rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex)
 {
 if (!m_pSuperstream)
 {
 if (nFontIndex  m_aFontEncodings.size())
 return m_aFontEncodings[nFontIndex];
-return 0;
+return lcl_getDefaultTextEncoding();
 }
 else
 return m_pSuperstream-getEncoding(nFontIndex);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: fpicker/source

2012-04-21 Thread Thomas Arnhold
 fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx |8 
+++-
 fpicker/source/win32/filepicker/vistatypes.h   |8 
+++-
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit ea822495b776a8b0b9d6b99299fdbc7bfc8db340
Author: Thomas Arnhold tho...@arnhold.org
Date:   Sat Apr 21 13:26:30 2012 +0200

Partially revert: Replace css macro with namespace for nicer namespacing

To fix the build. I can't test it on win32, thought it would work...

diff --git a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx 
b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
index ca1b223..47909d7 100644
--- a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
+++ b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
@@ -45,7 +45,11 @@
 // namespace
 //-
 
-namespace css = ::com::sun::star;
+#ifdef css
+#error Clash on using CSS as namespace define.
+#else
+#define css ::com::sun::star
+#endif
 
 namespace fpicker{
 namespace win32{
@@ -69,6 +73,8 @@ class IVistaFilePickerInternalNotify
 
 }}}
 
+#undef css
+
 #endif // FPICKER_WIN32_VISTA_FILEPICKER_INTERNALNOTIFY_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/vistatypes.h 
b/fpicker/source/win32/filepicker/vistatypes.h
index e1b1fc5..08b4613 100644
--- a/fpicker/source/win32/filepicker/vistatypes.h
+++ b/fpicker/source/win32/filepicker/vistatypes.h
@@ -40,7 +40,11 @@
 // namespace
 //-
 
-namespace css = ::com::sun::star;
+#ifdef css
+#error Clash on using CSS as namespace define.
+#else
+#define css ::com::sun::star
+#endif
 
 namespace fpicker{
 namespace win32{
@@ -60,6 +64,8 @@ typedef ComPtr IFileDialogCustomize, IID_IFileDialogCustomize
 } // namespace win32
 } // namespace fpicker
 
+#undef css
+
 #endif // FPICKER_WIN32_VISTA_TYPES_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: cui/source

2012-04-21 Thread Miklos Vajna
 cui/source/tabpages/paragrph.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29042d096a2c5812ae179e1553367afd21b0f71e
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 14:26:49 2012 +0200

cui: fix position of ED_LINEDISTMETRIC

I broke that when I added CB_CONTEXTUALSPACING

diff --git a/cui/source/tabpages/paragrph.src b/cui/source/tabpages/paragrph.src
index d6de18e..e064ac7 100644
--- a/cui/source/tabpages/paragrph.src
+++ b/cui/source/tabpages/paragrph.src
@@ -235,7 +235,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH
 Disable = TRUE ;
 Border = TRUE ;
 Hide = TRUE ;
-Pos = MAP_APPFONT ( 135 , 133 ) ;
+Pos = MAP_APPFONT ( 135 , 147 ) ;
 Size = MAP_APPFONT ( 40 , 12 ) ;
 Group = TRUE ;
 Left = TRUE ;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa writerfilter/source

2012-04-21 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo48876.rtf  |5 +
 sw/qa/extras/rtftok/rtftok.cxx |   17 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 --
 3 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit 99b875aee04a808fb28715fb0e143a2b00332832
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 12:53:22 2012 +0200

fdo#48876 fix RTF import of \sl without \slmult

diff --git a/sw/qa/extras/rtftok/data/fdo48876.rtf 
b/sw/qa/extras/rtftok/data/fdo48876.rtf
new file mode 100644
index 000..49a6eb0
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo48876.rtf
@@ -0,0 +1,5 @@
+{\rtf
+\sl54
+C
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 6870f02..0bb45e4 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -29,6 +29,8 @@
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
 #include com/sun/star/style/CaseMap.hpp
+#include com/sun/star/style/LineSpacing.hpp
+#include com/sun/star/style/LineSpacingMode.hpp
 #include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/table/BorderLine2.hpp
 #include com/sun/star/table/BorderLineStyle.hpp
@@ -83,6 +85,7 @@ public:
 void testFdo39053();
 void testFdo48356();
 void testFdo48023();
+void testFdo48876();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -108,6 +111,7 @@ public:
 CPPUNIT_TEST(testFdo39053);
 CPPUNIT_TEST(testFdo48356);
 CPPUNIT_TEST(testFdo48023);
+CPPUNIT_TEST(testFdo48876);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -599,6 +603,19 @@ void RtfModelTest::testFdo48023()
 CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
 }
 
+void RtfModelTest::testFdo48876()
+{
+load(fdo48876.rtf);
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+CPPUNIT_ASSERT(xParaEnum-hasMoreElements());
+uno::Referencebeans::XPropertySet xPropertySet(xParaEnum-nextElement(), 
uno::UNO_QUERY);
+style::LineSpacing aSpacing;
+xPropertySet-getPropertyValue(ParaLineSpacing) = aSpacing;
+CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e50cc1f..750e473 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2379,9 +2379,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 }
 break;
 case RTF_SL:
-if (nParam  0)
 {
-// NS_sprm::LN_PDyaLine could be used, but that won't work 
with slmult
+// This is similar to RTF_ABSH, negative value means 'exact', 
positive means 'at least'.
+RTFValue::Pointer_t pValue(new 
RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_atLeast));
+if (nParam  0)
+{
+pValue.reset(new 
RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact));
+pIntValue.reset(new RTFValue(-nParam));
+}
+
m_aStates.top().aParagraphAttributes-push_back(make_pair(NS_ooxml::LN_CT_Spacing_lineRule,
 pValue));
 
m_aStates.top().aParagraphAttributes-push_back(make_pair(NS_ooxml::LN_CT_Spacing_line,
 pIntValue));
 }
 break;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-04-21 Thread Arnaud Versini
 sw/source/filter/ww8/wrtww8.cxx |   46 +---
 sw/source/filter/ww8/wrtww8.hxx |5 ++--
 2 files changed, 23 insertions(+), 28 deletions(-)

New commits:
commit a3c7602ba3ed1ab57adab797a5820c8b0cb42abe
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Sat Apr 21 15:02:50 2012 +0200

Use boost::ptr_vector in WW8_WrPct instead of SV_DECL_PTRARR_DEL

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 0dbf05c..f3ade78 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -228,10 +228,6 @@ public:
 
 SV_IMPL_PTRARR( WW8_WrFkpPtrs, WW8_FkpPtr )
 
-typedef WW8_WrPc* WW8_WrPcPtr;
-SV_DECL_PTRARR_DEL( WW8_WrPcPtrs, WW8_WrPcPtr, 4 )
-SV_IMPL_PTRARR( WW8_WrPcPtrs, WW8_WrPcPtr )
-
 static void WriteDop( WW8Export rWrt )
 {
 WW8Dop rDop = *rWrt.pDop;
@@ -1153,14 +1149,13 @@ WW8_FC WW8_WrFkp::GetEndFc() const
 //--
 
 WW8_WrPct::WW8_WrPct(WW8_FC nfcMin, bool bSaveUniCode)
-: pPcts(new WW8_WrPcPtrs), nOldFc(nfcMin), bIsUni(bSaveUniCode)
+: nOldFc(nfcMin), bIsUni(bSaveUniCode)
 {
 AppendPc( nOldFc, bIsUni );
 }
 
 WW8_WrPct::~WW8_WrPct()
 {
-delete pPcts;
 }
 
 // Piece fuellen und neues Piece erzeugen
@@ -1169,10 +1164,10 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc, bool 
bIsUnicode)
 WW8_CP nStartCp = nStartFc - nOldFc;// Textbeginn abziehen
 if ( !nStartCp )
 {
-if ( 0 != pPcts-Count() )
+if ( !aPcts.empty() )
 {
-OSL_ENSURE( 1 == pPcts-Count(), Leeres Piece !!);
-pPcts-DeleteAndDestroy( pPcts-Count() - 1 , 1);
+OSL_ENSURE( 1 == aPcts.size(), Leeres Piece !!);
+aPcts.pop_back( );
 }
 }
 
@@ -1188,11 +1183,11 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc, bool 
bIsUnicode)
 nStartFc |= 0x4000; // Vorletztes Bit setzen fuer !Unicode
 }
 
-if( pPcts-Count() )
-nStartCp += pPcts-GetObject( pPcts-Count()- 1 )-GetStartCp();
+if( !aPcts.empty() )
+nStartCp += aPcts.back().GetStartCp();
 
-WW8_WrPcPtr pPc = new WW8_WrPc( nStartFc, nStartCp );
-pPcts-Insert( pPc, pPcts-Count() );
+WW8_WrPc* pPc = new WW8_WrPc( nStartFc, nStartCp );
+aPcts.push_back( pPc );
 
 bIsUni = bIsUnicode;
 }
@@ -1202,31 +1197,30 @@ void WW8_WrPct::WritePc( WW8Export rWrt )
 {
 sal_uLong nPctStart;
 sal_uLong nOldPos, nEndPos;
-sal_uInt16 i;
+boost::ptr_vectorWW8_WrPc::iterator aIter;
 
 nPctStart = rWrt.pTableStrm-Tell();// Beginn 
Piece-Table
 *rWrt.pTableStrm  ( char )0x02;   // Statusbyte PCT
 nOldPos = nPctStart + 1;// Position merken
 SwWW8Writer::WriteLong( *rWrt.pTableStrm, 0 );  // Laenge folgt
-for( i = 0; i  pPcts-Count(); ++i )   // Bereiche
+
+for( aIter = aPcts.begin(); aIter != aPcts.end(); ++aIter ) // Bereiche
 SwWW8Writer::WriteLong( *rWrt.pTableStrm,
-pPcts-GetObject( i )-GetStartCp() );
+aIter-GetStartCp() );
 
 
 // die letzte Pos noch errechnen
 sal_uLong nStartCp = rWrt.pFib-fcMac - nOldFc;
 if( bIsUni )
 nStartCp = 1; // Bei Unicode Anzahl der Zeichen / 2
-nStartCp += pPcts-GetObject( i-1 )-GetStartCp();
+nStartCp += aPcts.back().GetStartCp();
 SwWW8Writer::WriteLong( *rWrt.pTableStrm, nStartCp );
 
 // Pieceverweise
-for ( i = 0; i  pPcts-Count(); ++i )
+for ( aIter = aPcts.begin(); aIter != aPcts.end(); ++aIter )
 {
-WW8_WrPcPtr pPc = pPcts-GetObject( i );
-
-SwWW8Writer::WriteShort( *rWrt.pTableStrm, pPc-GetStatus());
-SwWW8Writer::WriteLong( *rWrt.pTableStrm, pPc-GetStartFc());
+SwWW8Writer::WriteShort( *rWrt.pTableStrm, aIter-GetStatus());
+SwWW8Writer::WriteLong( *rWrt.pTableStrm, aIter-GetStartFc());
 SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0);  // PRM=0
 }
 
@@ -1243,19 +1237,19 @@ void WW8_WrPct::WritePc( WW8Export rWrt )
 
 void WW8_WrPct::SetParaBreak()
 {
-OSL_ENSURE( pPcts-Count(),SetParaBreak : aPcts.Count = 0 );
-pPcts-GetObject( pPcts-Count() - 1)-SetStatus();
+OSL_ENSURE( !aPcts.empty(),SetParaBreak : aPcts.empty() );
+aPcts.back().SetStatus();
 }
 
 WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const
 {
 OSL_ENSURE( nFc = (sal_uLong)nOldFc, FilePos liegt vorm letzten Piece );
-OSL_ENSURE( pPcts-Count(), Fc2Cp noch kein Piece vorhanden );
+OSL_ENSURE( ! aPcts.empty(), Fc2Cp noch kein Piece vorhanden );
 
 nFc -= nOldFc;
 if( bIsUni )
 nFc /= 2;
-return nFc + pPcts-GetObject( pPcts-Count() - 1 )-GetStartCp();
+return nFc + aPcts.back().GetStartCp();
 }
 
 //--
diff --git a/sw/source/filter/ww8/wrtww8.hxx 

[Libreoffice-commits] .: 2 commits - sw/source

2012-04-21 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.hxx  |4 -
 sw/source/filter/ww8/ww8par3.cxx |  112 +--
 2 files changed, 52 insertions(+), 64 deletions(-)

New commits:
commit 2457f8f5b88028d0248943e2f80fce55913312f1
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 21 14:54:15 2012 +0100

clarify DelNumRule comment

diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index f909f77..357119b 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1411,9 +1411,8 @@ WW8ListManager::WW8ListManager(SvStream rSt_, 
SwWW8ImplReader rReader_)
 WW8ListManager::~WW8ListManager()
 {
 /*
-named lists remain in doc!!!
-unnamed lists are deleted when unused
-pLFOInfos are in any case destructed
+ named lists remain in document
+ unused automatic lists are removed from document (DelNumRule)
 */
 for(std::vectorWW8LSTInfo *::iterator aIter = maLSTInfos.begin();
 aIter != maLSTInfos.end(); ++aIter)
@@ -1426,18 +1425,18 @@ WW8ListManager::~WW8ListManager()
 delete *aIter;
 }
 boost::ptr_vectorWW8LFOInfo ::reverse_iterator aIter;
-for (aIter = pLFOInfos.rbegin() ;
-aIter  pLFOInfos.rend();
-++aIter )
+for (aIter = pLFOInfos.rbegin() ;
+aIter  pLFOInfos.rend();
+++aIter )
+{
+if (aIter-bOverride
+ aIter-pNumRule
+ !aIter-bUsedInDoc
+ aIter-pNumRule-IsAutoRule())
 {
-if (aIter-bOverride
- aIter-pNumRule
- !aIter-bUsedInDoc
- aIter-pNumRule-IsAutoRule())
-{
-rDoc.DelNumRule( aIter-pNumRule-GetName() );
-}
+rDoc.DelNumRule( aIter-pNumRule-GetName() );
 }
+}
 }
 
 bool IsEqualFormatting(const SwNumRule rOne, const SwNumRule rTwo)
commit 1f98094fc61f39f349c7d6cd3f59a8c9cd0626fc
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Sat Apr 7 19:46:32 2012 +0200

Use boost::ptr_vector in WW8ListManager instead of SV_DECL_PTRARR_DEL

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index de9219d..e2cc680 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -142,8 +142,6 @@ namespace com{namespace sun {namespace star{
 //-
 
 struct WW8LFOInfo;
-typedef WW8LFOInfo* WW8LFOInfo_Ptr;
-SV_DECL_PTRARR_DEL(WW8LFOInfos,WW8LFOInfo_Ptr,16)
 
 class WW8Reader : public StgReader
 {
@@ -177,7 +175,7 @@ private:
 const WW8FibrFib;
 SvStreamrSt;
 std::vectorWW8LSTInfo*  maLSTInfos;
-WW8LFOInfos* pLFOInfos;// D. aus PLF LFO, sortiert genau wie im WW8 Stream
+boost::ptr_vectorWW8LFOInfo  pLFOInfos;// D. aus PLF LFO, sortiert genau 
wie im WW8 Stream
 sal_uInt16   nUniqueList; // current number for creating unique list 
names
 sal_uInt8* GrpprlHasSprm(sal_uInt16 nId, sal_uInt8 rSprms, sal_uInt8 
nLen);
 WW8LSTInfo* GetLSTByListId(sal_uInt32  nIdLst ) const;
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 4a39b5d..f909f77 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -457,7 +457,6 @@ WW8LFOInfo::WW8LFOInfo(const WW8LFO rLFO)
 {
 }
 
-SV_IMPL_PTRARR( WW8LFOInfos, WW8LFOInfo_Ptr );
 
 
 // Hilfs-Methoden 
@@ -1052,7 +1051,7 @@ SwNumRule* WW8ListManager::CreateNextRule(bool bSimple)
 //
 WW8ListManager::WW8ListManager(SvStream rSt_, SwWW8ImplReader rReader_)
 : maSprmParser(rReader_.GetFib().GetFIBVersion()), rReader(rReader_),
-rDoc(rReader.GetDoc()), rFib(rReader.GetFib()), rSt(rSt_), pLFOInfos(0),
+rDoc(rReader.GetDoc()), rFib(rReader.GetFib()), rSt(rSt_),
 nUniqueList(1)
 {
 // LST und LFO gibts erst ab WW8
@@ -1062,7 +1061,6 @@ WW8ListManager::WW8ListManager(SvStream rSt_, 
SwWW8ImplReader rReader_)
 || ( rFib.lcbPlfLfo  2) ) return; // offensichtlich keine Listen 
da
 
 // Arrays anlegen
-pLFOInfos = new WW8LFOInfos;
 bool bLVLOk = true;
 
 nLastLFOPosition = USHRT_MAX;
@@ -1243,7 +1241,7 @@ WW8ListManager::WW8ListManager(SvStream rSt_, 
SwWW8ImplReader rReader_)
 for (int i = 0; i  nMaxSize; ++i)
 pLFOInfo-maParaSprms[i] = pParentListInfo-maParaSprms[i];
 }
-pLFOInfos-Insert(pLFOInfo, pLFOInfos-Count());
+pLFOInfos.push_back(pLFOInfo);
 bOk = true;
 }
 
@@ -1252,23 +1250,21 @@ WW8ListManager::WW8ListManager(SvStream rSt_, 
SwWW8ImplReader rReader_)
 //
 // 2.2 fuer alle LFO die zugehoerigen LFOLVL einlesen
 //
-sal_uInt16 nLFOInfos = pLFOInfos ? pLFOInfos-Count() : 0;
-for (sal_uInt16 nLfo = 0; nLfo  nLFOInfos; ++nLfo)
+size_t nLFOInfos = pLFOInfos.size();
+for (size_t nLfo = 0; nLfo  nLFOInfos; ++nLfo)
  

[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-04-21 Thread Miklos Vajna
 writerfilter/source/filter/RtfFilter.cxx   |4 ++-
 writerfilter/source/rtftok/rtfcontrolwords.cxx |   18 
 writerfilter/source/rtftok/rtfcontrolwords.hxx |4 +++
 writerfilter/source/rtftok/rtftokenizer.cxx|   28 -
 writerfilter/source/rtftok/rtftokenizer.hxx|2 +
 5 files changed, 41 insertions(+), 15 deletions(-)

New commits:
commit 22eb78b6eee38e11aec32909b6983becb309ce13
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 18:58:31 2012 +0200

fdo#44736 speed up RTF import a bit by sorting keywords

If we sort the keywords once in the constructor, then we can do binary
search when looking up RTF keywords, and that speeds up the import by
about 20% using the first testcase from the bug.

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index cce0c2e..11c4d3d 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -27,6 +27,7 @@
 
 #include rtfcontrolwords.hxx
 #include sal/macros.h
+#include string.h
 
 namespace writerfilter {
 namespace rtftok {
@@ -1856,6 +1857,23 @@ RTFSymbol aRTFControlWords[] = {
 };
 int nRTFControlWords = SAL_N_ELEMENTS(aRTFControlWords);
 
+bool RTFSymbol::operator(const RTFSymbol rOther) const
+{
+return strcmp(sKeyword, rOther.sKeyword)  0;
+}
+
+RTFSymbol::RTFSymbol(const char* pKeyword)
+: sKeyword(pKeyword)
+{
+}
+
+RTFSymbol::RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex)
+: sKeyword(pKeyword),
+nControlType(pControlType),
+nIndex(pIndex)
+{
+}
+
 } // namespace rtftok
 } // namespace writerfilter
 
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx 
b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index 5afb8c6..477ddb5 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -1866,6 +1866,10 @@ struct RTFSymbol
 const char *sKeyword;
 int nControlType;
 RTFKeyword nIndex;
+
+bool operator(const RTFSymbol rOther) const;
+RTFSymbol(const char* pKeyword);
+RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex);
 };
 
 extern RTFSymbol aRTFControlWords[];
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index f247317..b40a912 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -45,8 +45,10 @@ namespace rtftok {
 RTFTokenizer::RTFTokenizer(RTFDocumentImpl rImport, SvStream* pInStream, 
uno::Referencetask::XStatusIndicator const xStatusIndicator)
 : m_rImport(rImport),
 m_pInStream(pInStream),
-m_xStatusIndicator(xStatusIndicator)
+m_xStatusIndicator(xStatusIndicator),
+m_aRTFControlWords(std::vectorRTFSymbol(aRTFControlWords, 
aRTFControlWords + nRTFControlWords))
 {
+std::sort(m_aRTFControlWords.begin(), m_aRTFControlWords.end());
 }
 
 RTFTokenizer::~RTFTokenizer()
@@ -266,13 +268,10 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 /*SAL_INFO(writefilter, OSL_THIS_FUNC  : keyword '\\  
rKeyword.getStr() 
' with param?   (bParam ? 1 : 0)  param val: '  
(bParam ? nParam : 0)  ');*/
-int i, ret;
-for (i = 0; i  nRTFControlWords; i++)
-{
-if (!strcmp(rKeyword.getStr(), aRTFControlWords[i].sKeyword))
-break;
-}
-if (i == nRTFControlWords)
+RTFSymbol aSymbol(rKeyword.getStr());
+std::vectorRTFSymbol::iterator low = 
std::lower_bound(m_aRTFControlWords.begin(), m_aRTFControlWords.end(), aSymbol);
+int i = low - m_aRTFControlWords.begin();
+if (low == m_aRTFControlWords.end() || aSymbol  *low)
 {
 SAL_INFO(writerfilter, OSL_THIS_FUNC  : unknown keyword '\\  
rKeyword.getStr()  ');
 RTFSkipDestination aSkip(m_rImport);
@@ -280,35 +279,36 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 }
 
-switch (aRTFControlWords[i].nControlType)
+int ret;
+switch (m_aRTFControlWords[i].nControlType)
 {
 case CONTROL_FLAG:
 // flags ignore any parameter by definition
-ret = m_rImport.dispatchFlag(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchFlag(m_aRTFControlWords[i].nIndex);
 if (ret)
 return ret;
 break;
 case CONTROL_DESTINATION:
 // same for destinations
-ret = m_rImport.dispatchDestination(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchDestination(m_aRTFControlWords[i].nIndex);
 if (ret)
 return ret;
 break;
 case CONTROL_SYMBOL:
 // and symbols
-ret = m_rImport.dispatchSymbol(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchSymbol(m_aRTFControlWords[i].nIndex);

[Libreoffice-commits] .: writerfilter/source

2012-04-21 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfcontrolwords.cxx |   12 
 writerfilter/source/rtftok/rtfcontrolwords.hxx |2 --
 writerfilter/source/rtftok/rtftokenizer.cxx|3 ++-
 3 files changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 9fda7a919f31a192b9bd2938139b6566b7fc2935
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 20:00:08 2012 +0200

rtftok: try to make tinderboxes happy

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 11c4d3d..516a9b8 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -1862,18 +1862,6 @@ bool RTFSymbol::operator(const RTFSymbol rOther) const
 return strcmp(sKeyword, rOther.sKeyword)  0;
 }
 
-RTFSymbol::RTFSymbol(const char* pKeyword)
-: sKeyword(pKeyword)
-{
-}
-
-RTFSymbol::RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex)
-: sKeyword(pKeyword),
-nControlType(pControlType),
-nIndex(pIndex)
-{
-}
-
 } // namespace rtftok
 } // namespace writerfilter
 
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx 
b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index 477ddb5..1088982 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -1868,8 +1868,6 @@ struct RTFSymbol
 RTFKeyword nIndex;
 
 bool operator(const RTFSymbol rOther) const;
-RTFSymbol(const char* pKeyword);
-RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex);
 };
 
 extern RTFSymbol aRTFControlWords[];
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index b40a912..709bb30 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -268,7 +268,8 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 /*SAL_INFO(writefilter, OSL_THIS_FUNC  : keyword '\\  
rKeyword.getStr() 
' with param?   (bParam ? 1 : 0)  param val: '  
(bParam ? nParam : 0)  ');*/
-RTFSymbol aSymbol(rKeyword.getStr());
+RTFSymbol aSymbol;
+aSymbol.sKeyword = rKeyword.getStr();
 std::vectorRTFSymbol::iterator low = 
std::lower_bound(m_aRTFControlWords.begin(), m_aRTFControlWords.end(), aSymbol);
 int i = low - m_aRTFControlWords.begin();
 if (low == m_aRTFControlWords.end() || aSymbol  *low)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - linguistic/source sc/inc sc/source unusedcode.easy

2012-04-21 Thread Caolán McNamara
 linguistic/source/lngprophelp.cxx |1 +
 sc/inc/cell.hxx   |1 -
 sc/source/core/data/cell.cxx  |5 -
 unusedcode.easy   |1 -
 4 files changed, 1 insertion(+), 7 deletions(-)

New commits:
commit d2bfa5cfdaaa68a3e2bd751cc45955e4ea41f36b
Author: Szabolcs Dezsi dezsisz...@hotmail.com
Date:   Sat Apr 21 15:28:50 2012 +0200

Resolves: fdo#3: Changing spelling preferences requires application 
restart

diff --git a/linguistic/source/lngprophelp.cxx 
b/linguistic/source/lngprophelp.cxx
index b93971f..82a7c4d 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)
commit dd2230c90ff41b667bf0d750801eb0d2ab3b0317
Author: Ferran Vidal vidalmargi...@hotmail.com
Date:   Sat Apr 21 18:08:11 2012 +0200

Remove unused code from Spreadsheet application code

diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 08fbdfa..b4549d1 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -207,7 +207,6 @@ public:
 DECL_FIXEDMEMPOOL_NEWDEL( ScStringCell )
 #endif
 
-ScStringCell();
 explicitScStringCell(const rtl::OUString rString);
 
 #if OSL_DEBUG_LEVEL  0
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 9ccadde..a4e5361 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -657,11 +657,6 @@ ScValueCell::~ScValueCell()
 
 // 
 
-ScStringCell::ScStringCell() :
-ScBaseCell( CELLTYPE_STRING )
-{
-}
-
 ScStringCell::ScStringCell( const rtl::OUString rString ) :
 ScBaseCell( CELLTYPE_STRING ),
 maString( rString.intern() )
diff --git a/unusedcode.easy b/unusedcode.easy
index 89aa3c8..b62d53a 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -86,7 +86,6 @@ ScRTFColTwips_SAR::_ForEach(unsigned short, unsigned short, 
unsigned char (*)(un
 ScRangeData::ReplaceRangeNamesInUse(std::__debug::mapunsigned short, unsigned 
short, std::lessunsigned short, std::allocatorstd::pairunsigned short 
const, unsigned short   const)
 ScRangeData::ScRangeData(unsigned short)
 ScSimpleRangeList::Range::contains(ScSimpleRangeList::Range const) const
-ScStringCell::ScStringCell()
 ScTable::ReplaceRangeNamesInUse(short, int, short, int, 
std::__debug::mapunsigned short, unsigned short, std::lessunsigned short, 
std::allocatorstd::pairunsigned short const, unsigned short   const)
 ScTypedStrData::GetValue() const
 ScValidationEntries_Impl::Insert(ScValidationData* const, unsigned short)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sdext/source

2012-04-21 Thread Caolán McNamara
 sdext/source/pdfimport/tree/pdfiprocessor.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bcb4defef7c9147a94ef19a51a18715449d3572d
Author: Korrawit Pruegsanusak detective.conan.1...@gmail.com
Date:   Sat Apr 21 10:06:19 2012 +0700

Fix fdo#45848

regression from 5dd4f9ecb2f50cf76b44472e4438297b6c65184c
The change:
-if(m_GlyphsList.size()1)
+if(!m_GlyphsList.empty())
is incorrect, so change it back.

diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx 
b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index d0ec397..12d2ab4 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -399,7 +399,7 @@ void PDFIProcessor::processGlyphLine()
 
 }
 
-if(!m_GlyphsList.empty())
+if(m_GlyphsList.size()1)
  processGlyph( 0,
   m_GlyphsList[m_GlyphsList.size()-1],
   pPara,
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sdext/source

2012-04-21 Thread Caolán McNamara
 sdext/source/pdfimport/tree/pdfiprocessor.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fc0c85e8628bf90afd4a47c20b3d1bc2a9c01b36
Author: Korrawit Pruegsanusak detective.conan.1...@gmail.com
Date:   Sat Apr 21 10:06:19 2012 +0700

Fix fdo#45848

regression from 5dd4f9ecb2f50cf76b44472e4438297b6c65184c
The change:
-if(m_GlyphsList.size()1)
+if(!m_GlyphsList.empty())
is incorrect, so change it back.
(cherry picked from commit bcb4defef7c9147a94ef19a51a18715449d3572d)

Signed-off-by: Caolán McNamara caol...@redhat.com

diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx 
b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 6d0e34e..a800643 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -399,7 +399,7 @@ void PDFIProcessor::processGlyphLine()
 
 }
 
-if(!m_GlyphsList.empty())
+if(m_GlyphsList.size()1)
  processGlyph( 0,
   m_GlyphsList[m_GlyphsList.size()-1],
   pPara,
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - cui/source

2012-04-21 Thread Takeshi Abe
 cui/source/customize/macropg.cxx  |1 -
 cui/source/inc/iconcdlg.hxx   |1 -
 cui/source/options/cuisrchdlg.cxx |2 --
 cui/source/options/fontsubs.cxx   |4 
 cui/source/options/optdict.cxx|1 -
 cui/source/options/optfltr.cxx|3 ---
 cui/source/options/optgdlg.cxx|8 
 cui/source/options/optgdlg.hxx|1 -
 cui/source/options/optinet2.hxx   |   13 -
 cui/source/options/optlingu.cxx   |7 ---
 cui/source/options/optmemory.cxx  |2 --
 cui/source/options/optmemory.hxx  |1 -
 cui/source/options/optpath.cxx|1 -
 cui/source/tabpages/border.cxx|2 --
 cui/source/tabpages/macroass.cxx  |3 ---
 cui/source/tabpages/numpages.cxx  |1 -
 cui/source/tabpages/transfrm.cxx  |3 ---
 17 files changed, 54 deletions(-)

New commits:
commit 2496eb6fd40ed6d91bdbc4a85e5b30b1afc707d1
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sun Apr 22 05:08:10 2012 +0900

removed unused static data

diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 30f74ec..f850929 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -55,7 +55,6 @@ using namespace ::com::sun::star::linguistic2;
 
 // static 
 
-static const sal_uInt16 nNameLen= 8;
 static const short  NOACTDICT   = -1;
 
 static long nStaticTabs[]=
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ea17472..418455e 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1228,10 +1228,6 @@ static const OUString 
sInstalledLocalesPath(RTL_CONSTASCII_USTRINGPARAM(org.ope
 static OUString 
sUserLocalePath(RTL_CONSTASCII_USTRINGPARAM(org.openoffice.Office.Linguistic/General));
 //static const OUString 
sUserLocalePath(RTL_CONSTASCII_USTRINGPARAM(org.openoffice.Office/Linguistic));
 static const OUString sUserLocaleKey(RTL_CONSTASCII_USTRINGPARAM(UILocale));
-static const OUString 
sSystemLocalePath(RTL_CONSTASCII_USTRINGPARAM(org.openoffice.System/L10N));
-static const OUString 
sSystemLocaleKey(RTL_CONSTASCII_USTRINGPARAM(UILocale));
-static const OUString 
sOfficeLocalePath(RTL_CONSTASCII_USTRINGPARAM(org.openoffice.Office/L10N));
-static const OUString 
sOfficeLocaleKey(RTL_CONSTASCII_USTRINGPARAM(ooLocale));
 static Sequence OUString  seqInstalledLanguages;
 
 OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet 
rSet ) :
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index e433c44..198eff8 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -167,8 +167,6 @@ static void lcl_OpenURL( ::rtl::OUString sURL )
 }
 }
 
-static const sal_uInt16 nNameLen = 8;
-
 static sal_uInt16 pRanges[] =
 {
 SID_ATTR_SPELL,
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 0b4dfa1..a4d3837 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -104,7 +104,6 @@ 
SV_IMPL_PTRARR(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr);
 
 static sal_Bool bLastRelative = sal_False;
 static const sal_Char cNumberingType[] = NumberingType;
-static const sal_Char cValue[] = Value;
 static const sal_Char cParentNumbering[] = ParentNumbering;
 static const sal_Char cPrefix[] = Prefix;
 static const sal_Char cSuffix[] = Suffix;
commit 2ce52cbb18e8083dc14c6701a2dab8ca32b81967
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sun Apr 22 05:07:37 2012 +0900

removed unused defines

diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 94719ff..6e5a4ff 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -104,7 +104,6 @@ static long nTabs[] =
 #defineITMEID_ASSMACRO2
 
 
-#define LB_EVENTS_ITEMPOS1
 #define LB_MACROS_ITEMPOS2
 
 
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 41bdf61..ed7079d 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -40,7 +40,6 @@
 #include vector
 
 #define CTRLS_OFFSET3
-#define BUTTON_DISTANCE 8
 #define RET_USER100
 #define RET_USER_CANCEL 101
 
diff --git a/cui/source/options/cuisrchdlg.cxx 
b/cui/source/options/cuisrchdlg.cxx
index 7422230..aba0b5b 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -47,8 +47,6 @@
 
 #include cuires.hrc
 
-#define ITEMID_SETITEM  0
-
 #include svl/srchitem.hxx
 #include svx/pageitem.hxx
 #include dialmgr.hxx
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 0646287..d59c5ee 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -46,10 +46,6 @@
 /*   */
 /*/
 
-#define CBCOL_FIRST 0
-#define 

[Libreoffice-commits] .: 2 commits - crashrep/source

2012-04-21 Thread Caolán McNamara
 crashrep/source/unx/main.cxx |   33 ++---
 1 file changed, 10 insertions(+), 23 deletions(-)

New commits:
commit 461b786be77a2116673915d56e1bf875cac792b5
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 21 21:42:18 2012 +0100

make comment reflect reality

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index d4c17bd..493c21f 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -1032,38 +1032,17 @@ static bool setup_version()
 return 0 != g_strReportServer.length();
 }
 
-#if 0
-// Use gconftool-2 to determine if gnome accessiblity is enabled
-// unused
-static bool get_accessibility_state()
-{
-bool bAccessible = false;
-FILE *fin = popen( gconftool-2 -g 
/desktop/gnome/interface/accessibility, r);
-
-if ( fin )
-{
-char buffer[sizeof(true)];
-
-bAccessible = fgets( buffer, sizeof(buffer), fin )  0 == strcmp( 
buffer, true );
-
-pclose( fin );
-}
-
-return bAccessible;
-}
-#endif
-
 int main( int argc, char** argv )
 {
 FILE *fin = freopen( /dev/null, w, stderr );
-if (!fin) 
+if (!fin)
 {
 return -1;
 }
 
 setup_program_dir( argv[0] );
 
-// Don't start if accessiblity is enabled or report server is not given
+// Don't start if report server is not given
 
 if ( setup_version() )
 {
commit ad4f72560627a2d75c71a34f2a37ab1f5a2bf05d
Author: David Ostrovsky david.ostrov...@gmx.de
Date:   Sat Apr 21 14:27:43 2012 +0200

WaE: crashrep warnings fixed

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index f9a6320..d4c17bd 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -592,7 +592,11 @@ static void setup_program_dir( const char* progname )
 
 g_strProgramDir = aDir.substr( 0, pos + 1 );
 aDir.erase( pos );
-chdir( aDir.c_str() );
+int ret = chdir( aDir.c_str() );
+if (!ret)
+{
+return;
+}
 }
 }
 
@@ -1051,7 +1055,11 @@ static bool get_accessibility_state()
 
 int main( int argc, char** argv )
 {
-freopen( /dev/null, w, stderr );
+FILE *fin = freopen( /dev/null, w, stderr );
+if (!fin) 
+{
+return -1;
+}
 
 setup_program_dir( argv[0] );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - extensions/source

2012-04-21 Thread Caolán McNamara
 extensions/source/nsplugin/source/npshell.cxx |   10 --
 extensions/source/scanner/sane.cxx|   26 +-
 2 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit e37ae322b07a02714b22cb663e1d7ab4f2072730
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 21 22:24:03 2012 +0100

fill in some sane defaults on read/write failure

diff --git a/extensions/source/nsplugin/source/npshell.cxx 
b/extensions/source/nsplugin/source/npshell.cxx
index f6b4ea4..33c282f 100644
--- a/extensions/source/nsplugin/source/npshell.cxx
+++ b/extensions/source/nsplugin/source/npshell.cxx
@@ -761,7 +761,7 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const 
char* fname)
 return;
 }
 char buffer[NPP_BUFFER_SIZE] = {0};
-int ret;
+ssize_t ret;
 while(0 = (ret = read(fdSrc, buffer, NPP_BUFFER_SIZE)))
 {
 if (0 == ret)
@@ -773,8 +773,10 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const 
char* fname)
 break;
 }
 ssize_t written_bytes = write(fdDst, buffer, ret);
-if (written_bytes == -1)
+if (written_bytes != ret)
 {
+debug_fprintf(NSP_LOG_APPEND, NPP_StreamAsFile:short write to 
%s. error: %s \n,
+localPathNew, strerror(errno));
 return;
 }
 }
diff --git a/extensions/source/scanner/sane.cxx 
b/extensions/source/scanner/sane.cxx
index ca2cec1..b89f9bd 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -526,21 +526,20 @@ static inline sal_uInt8 _ReadValue( FILE* fp, int depth )
 // as we do
 size_t items_read = fread( nWord, 1, 2, fp );
 
-// fread() does not distinguish between end-of-file and error, and 
callers
-//   must use feof(3) and ferror(3) to determine which occurred.
-if (items_read == 0)
+if (items_read != 2)
 {
- // nothing todo?
- // WaE is happy!
+ SAL_WARN( extensions.scanner, short read, abandoning );
+ return 0;
 }
+
 return (sal_uInt8)( nWord / 256 );
 }
 sal_uInt8 nByte;
 size_t items_read = fread( nByte, 1, 1, fp );
-if (items_read == 0)
+if (items_read != 1)
 {
- // nothing todo?
- // WaE is happy!
+SAL_WARN( extensions.scanner, short read, abandoning );
+return 0;
 }
 return nByte;
 }
@@ -819,22 +818,18 @@ sal_Bool Sane::Start( BitmapTransporter rBitmap )
 aConverter.Seek( 1084 );
 }
 
-for( nLine = nHeight-1;
- nLine = 0; nLine-- )
+for (nLine = nHeight-1; nLine = 0; --nLine)
 {
 fseek( pFrame, nLine * aParams.bytes_per_line, SEEK_SET );
 if( eType == FrameStyle_BW ||
 ( eType == FrameStyle_Gray  aParams.depth == 8 )
 )
 {
-size_t items_read = fread( pBuffer, 1, 
aParams.bytes_per_line, pFrame );
-
-// fread() does not distinguish between end-of-file and 
error, and callers
-//   must use feof(3) and ferror(3) to determine which 
occurred.
-if (items_read == 0)
+SANE_Int items_read = fread( pBuffer, 1, 
aParams.bytes_per_line, pFrame );
+if (items_read != aParams.bytes_per_line)
 {
-// nothing todo?
-// WaE is happy!
+SAL_WARN( extensions.scanner, short read, padding 
with zeros );
+memset(pBuffer + items_read, 0, aParams.bytes_per_line 
- items_read);
 }
 aConverter.Write( pBuffer, aParams.bytes_per_line );
 }
commit 6ef852f160b88b2052c150374fb9aeab43a29804
Author: David Ostrovsky david.ostrov...@gmx.de
Date:   Sat Apr 21 14:29:14 2012 +0200

WaE: extensions warnings fixed

diff --git a/extensions/source/nsplugin/source/npshell.cxx 
b/extensions/source/nsplugin/source/npshell.cxx
index 81ce8fb..f6b4ea4 100644
--- a/extensions/source/nsplugin/source/npshell.cxx
+++ b/extensions/source/nsplugin/source/npshell.cxx
@@ -772,7 +772,11 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const 
char* fname)
 
 break;
 }
-write(fdDst, buffer, ret);
+ssize_t written_bytes = write(fdDst, buffer, ret);
+if (written_bytes == -1)
+{
+return;
+}
 }
 close(fdSrc);
 close(fdDst);
diff --git a/extensions/source/scanner/sane.cxx 
b/extensions/source/scanner/sane.cxx
index aaefbf4..ca2cec1 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -524,11 +524,24 @@ static 

[Libreoffice-commits] .: 3 commits - idlc/source l10ntools/source solenv/gbuild solenv/inc

2012-04-21 Thread Tor Lillqvist
 idlc/source/wrap_scanner.cxx  |6 ++
 l10ntools/source/cfg_yy_wrapper.c |3 +++
 l10ntools/source/src_yy_wrapper.c |3 +++
 l10ntools/source/xrm_yy_wrapper.c |3 +++
 solenv/gbuild/platform/macosx.mk  |2 +-
 solenv/inc/unxmacx.mk |4 
 6 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 8c1e9c7dfdc17b156931bbbe42851c08c7281be5
Author: Tor Lillqvist t...@iki.fi
Date:   Sun Apr 22 01:29:07 2012 +0300

WaE: comparison of integers of different signs and unused functions

diff --git a/idlc/source/wrap_scanner.cxx b/idlc/source/wrap_scanner.cxx
index f058db1..94a068a 100644
--- a/idlc/source/wrap_scanner.cxx
+++ b/idlc/source/wrap_scanner.cxx
@@ -26,7 +26,13 @@
  *
  /
 
+#ifdef __clang__
+#pragma clang diagnostic ignored -Wsign-compare
+#endif
 
 #include scanner.cxx
 
+void (*avoid_unused_yyunput_in_scanner_cxx)(int, char*) = yyunput;
+int (*avoid_unused_yyinput_in_scanner_cxx)() = yyinput;
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1ac9f91198889cc5cee40ba9ef2b0255183ee195
Author: Tor Lillqvist t...@iki.fi
Date:   Sun Apr 22 00:59:45 2012 +0300

WaE: unused functions

diff --git a/l10ntools/source/cfg_yy_wrapper.c 
b/l10ntools/source/cfg_yy_wrapper.c
index ecfb35b..b22d2a7 100644
--- a/l10ntools/source/cfg_yy_wrapper.c
+++ b/l10ntools/source/cfg_yy_wrapper.c
@@ -2,4 +2,7 @@
 // Helper to suppress warnings in lex generated c code, see #i57362#
 #include cfg_yy.c
 
+void (*avoid_unused_yyunput_in_cfg_yy_c)() = yyunput;
+int (*avoid_unused_yy_flex_strlen_in_cfg_yy_c)() = yy_flex_strlen;
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/src_yy_wrapper.c 
b/l10ntools/source/src_yy_wrapper.c
index 974068d..da9c17f 100644
--- a/l10ntools/source/src_yy_wrapper.c
+++ b/l10ntools/source/src_yy_wrapper.c
@@ -2,4 +2,7 @@
 // Helper to suppress warnings in lex generated c code, see #i57362#
 #include src_yy.c
 
+void (*avoid_unused_yyunput_in_src_yy_c)() = yyunput;
+int (*avoid_unused_yy_flex_strlen_in_src_yy_c)() = yy_flex_strlen;
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/xrm_yy_wrapper.c 
b/l10ntools/source/xrm_yy_wrapper.c
index 2724ad0..191d16f 100644
--- a/l10ntools/source/xrm_yy_wrapper.c
+++ b/l10ntools/source/xrm_yy_wrapper.c
@@ -2,4 +2,7 @@
 // Helper to suppress warnings in lex generated c code, see #i57362#
 #include xrm_yy.c
 
+void (*avoid_unused_yyunput_in_xrm_yy_c)() = yyunput;
+int (*avoid_unused_yy_flex_strlen_in_xrm_yy_c)() = yy_flex_strlen;
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1bf04b934a8f51ac50be4cb9b6eacbb092871383
Author: Tor Lillqvist t...@iki.fi
Date:   Sun Apr 22 00:09:44 2012 +0300

Don't use -Wl,-syslibroot when building against more current SDKs

diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index ab955cf..d4d113d 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -95,7 +95,7 @@ gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
 gb_OBJCFLAGS := -x objective-c -fobjc-exceptions
 
 gb_LinkTarget_LDFLAGS := \
-   -Wl,-syslibroot,$(gb_SDKDIR) \
+   $(if $(filter 1040 
1050,$(MAC_OS_X_VERSION_MIN_REQUIRED)),-Wl$(COMMA)-syslibroot$(COMMA)$(gb_SDKDIR))
 \
$(subst -L../lib , ,$(SOLARLIB)) \
 #man ld says: obsolete -Wl,-multiply_defined,suppress \
 
diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk
index e402783..1ca6a82 100644
--- a/solenv/inc/unxmacx.mk
+++ b/solenv/inc/unxmacx.mk
@@ -178,8 +178,12 @@ LINK*=$(CXX)
 LINKC*=$(CC)
 
 LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
+
+.IF $(MAC_OS_X_VERSION_MIN_REQUIRED) = 1050
 # assure backwards-compatibility
 EXTRA_LINKFLAGS*:=-Wl,-syslibroot,$(MACOSX_SDK_PATH)
+.ENDIF
+
 # Very long install_names are needed so that install_name_tool -change later on
 # does not complain that larger updated load commands do not fit:
 LINKFLAGSRUNPATH_URELIB=-install_name 
'@__URELIB/$(@:f)'
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits