[Libreoffice-commits] .: 24 commits - comphelper/prj comphelper/qa cppcanvas/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Mon Feb 7 17:12:53 PST 2011
comphelper/prj/build.lst | 1 -
comphelper/qa/makefile.mk | 1 +
cppcanvas/source/mtfrenderer/implrenderer.cxx | 17 +++++++++++++++--
3 files changed, 16 insertions(+), 3 deletions(-)
New commits:
commit 4e043a2fff67ec6124f5772b47e533f5521e29cc
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Feb 8 01:35:32 2011 +0100
Fix comphelper parallel build, so that the tests may run.
diff --git a/comphelper/prj/build.lst b/comphelper/prj/build.lst
index d5eced0..25aa17f 100644
--- a/comphelper/prj/build.lst
+++ b/comphelper/prj/build.lst
@@ -11,4 +11,4 @@ ph comphelper\source\compare nmake - all ph_compare ph_inc NULL
ph comphelper\source\officeinstdir nmake - all ph_officeinstdir ph_inc NULL
ph comphelper\source\xml nmake - all ph_xml NULL
ph comphelper\util nmake - all ph_util ph_container ph_evtatmgr ph_misc ph_procfact ph_property ph_streaming ph_compare ph_officeinstdir ph_xml NULL
-ph comphelper\qa nmake - all ph_complex NULL
\ No newline at end of file
+ph comphelper\qa nmake - all ph_complex ph_util NULL
diff --git a/comphelper/qa/makefile.mk b/comphelper/qa/makefile.mk
index 9c86c24..8d06d9b 100644
--- a/comphelper/qa/makefile.mk
+++ b/comphelper/qa/makefile.mk
@@ -32,6 +32,7 @@ TARGET := qa
ENABLE_EXCEPTIONS := TRUE
.INCLUDE: settings.mk
+.INCLUDE : $(PRJ)$/version.mk
#building with stlport, but cppunit was not built with stlport
.IF "$(USE_SYSTEM_STL)"!="YES"
commit ec429247fb8613ab7e030d42db8efbc75bed6e8f
Merge: 195e11a... 55b6486...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Feb 8 00:19:54 2011 +0100
Merge remote branch 'origin/libreoffice-3-3'
Conflicts:
vcl/unx/kde4/KDESalGraphics.cxx
vcl/unx/source/gdi/salgdi.cxx
commit 55b64863ec6eec23de004be6de7bcea7d47d806c
Author: Rene Engelhard <rene at debian.org>
Date: Fri Feb 4 20:31:55 2011 +0100
add explicit QRegion* for clipRegion to fix compile
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index af1ac3b..d3eb7e7 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -354,7 +354,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{ // reduce paint area only to the handle area
const int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QRect rect( 0, 0, width, widgetRect.height());
- clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
+ QRegion* clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
QStyleOption option;
option.state = QStyle::State_Horizontal;
commit 1a4f2c597e4881271d6ffe1a4d726ec738f66b7e
Author: Michael Meeks <michael.meeks at novell.com>
Date: Fri Jan 28 17:15:32 2011 +0000
remove obsolete m_bSingleAltPress
(cherry picked from commit a63e78439ca947499a4678cea4dd8e9e07054ab9)
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 56552b3..3061ae0 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -559,7 +559,6 @@ void GtkSalFrame::InitCommon()
// init members
m_pCurrentCursor = NULL;
m_nKeyModifiers = 0;
- m_bSingleAltPress = false;
m_bFullscreen = false;
m_nState = GDK_WINDOW_STATE_WITHDRAWN;
m_nVisibility = GDK_VISIBILITY_FULLY_OBSCURED;
@@ -2851,7 +2850,6 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
if( !pEvent->in )
{
pThis->m_nKeyModifiers = 0;
- pThis->m_bSingleAltPress = false;
pThis->m_bSendModChangeOnRelease = false;
}
@@ -3055,10 +3053,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pThis->m_pIMHandler )
{
if( pThis->m_pIMHandler->handleKeyEvent( pEvent ) )
- {
- pThis->m_bSingleAltPress = false;
return TRUE;
- }
}
GTK_YIELD_GRAB();
@@ -3157,10 +3152,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
(pEvent->type == GDK_KEY_PRESS),
false );
if( ! aDel.isDeleted() )
- {
pThis->m_bSendModChangeOnRelease = false;
- pThis->m_bSingleAltPress = false;
- }
}
if( !aDel.isDeleted() && pThis->m_pIMHandler )
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index 350185c..2831f33 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -185,7 +185,6 @@ class GtkSalFrame : public SalFrame
guint m_nGSMCookie;
int m_nWorkArea;
bool m_bFullscreen;
- bool m_bSingleAltPress;
bool m_bDefaultPos;
bool m_bDefaultSize;
bool m_bSendModChangeOnRelease;
commit ba110ce308ac66d568a1f6430d4e3217a1849716
Author: Lucas Baudin <xapantu at gmail.com>
Date: Fri Jan 28 16:41:29 2011 +0100
Remove the menu when Left Alt Key was pressed; for GTK
(cherry picked from commit db1f9d326bdd678c177eea337997b3c0aefa0c19)
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 18ac631..56552b3 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3145,36 +3145,6 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
- if( ! aDel.isDeleted() )
- {
- // emulate KEY_MENU
- if( ( pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R ) &&
- ( nModCode & ~(KEY_MOD3|KEY_MOD2)) == 0 )
- {
- if( pEvent->type == GDK_KEY_PRESS )
- pThis->m_bSingleAltPress = true;
-
- else if( pThis->m_bSingleAltPress )
- {
- SalKeyEvent aKeyEvt;
-
- aKeyEvt.mnCode = KEY_MENU | nModCode;
- aKeyEvt.mnRepeat = 0;
- aKeyEvt.mnTime = pEvent->time;
- aKeyEvt.mnCharCode = 0;
-
- // simulate KEY_MENU
- pThis->CallCallback( SALEVENT_KEYINPUT, &aKeyEvt );
- if( ! aDel.isDeleted() )
- {
- pThis->CallCallback( SALEVENT_KEYUP, &aKeyEvt );
- pThis->m_bSingleAltPress = false;
- }
- }
- }
- else
- pThis->m_bSingleAltPress = false;
- }
}
else
{
commit f58ea508ad11a0ad4b581ef51e7a307d1cf87f48
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Jan 31 14:51:36 2011 +0100
fdo#33459: year of era in long format for zh_TW by default
diff --git a/i18npool/source/localedata/data/zh_TW.xml b/i18npool/source/localedata/data/zh_TW.xml
index aa53647..3d99713 100644
--- a/i18npool/source/localedata/data/zh_TW.xml
+++ b/i18npool/source/localedata/data/zh_TW.xml
@@ -129,11 +129,11 @@
<DefaultName></DefaultName>
</FormatElement>
<FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="24">
-<FormatCode>GGGE"å¹´"M"æ"D"æ¥"</FormatCode>
+<FormatCode>GGGEE"å¹´"M"æ"D"æ¥"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey8" default="false" type="long" usage="DATE" formatindex="25">
-<FormatCode>GGGE"å¹´"M"æ"D"æ¥"</FormatCode>
+<FormatCode>GGGEE"å¹´"M"æ"D"æ¥"</FormatCode>
<DefaultName></DefaultName>
</FormatElement>
<FormatElement msgid="DateFormatskey9" default="false" type="long" usage="DATE" formatindex="26">
@@ -149,11 +149,11 @@
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey12" default="false" type="long" usage="DATE" formatindex="29">
-<FormatCode>GGE"å¹´"M"æ"D"æ¥" NNNN</FormatCode>
+<FormatCode>GGEE"å¹´"M"æ"D"æ¥" NNNN</FormatCode>
<DefaultName></DefaultName>
</FormatElement>
<FormatElement msgid="DateFormatskey13" default="false" type="long" usage="DATE" formatindex="30">
-<FormatCode>GGGE"å¹´"M"æ"D"æ¥" NNNN</FormatCode>
+<FormatCode>GGGEE"å¹´"M"æ"D"æ¥" NNNN</FormatCode>
<DefaultName></DefaultName>
</FormatElement>
<FormatElement msgid="DateFormatskey14" default="true" type="short" usage="DATE" formatindex="31">
@@ -161,11 +161,11 @@
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey15" default="false" type="medium" usage="DATE" formatindex="32">
-<FormatCode>E"å¹´"M"æ"D"æ¥"</FormatCode>
+<FormatCode>EE"å¹´"M"æ"D"æ¥"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey16" default="false" type="medium" usage="DATE" formatindex="33">
-<FormatCode>GGGE"å¹´"M"æ"D"æ¥"</FormatCode>
+<FormatCode>GGGEE"å¹´"M"æ"D"æ¥"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey17" default="false" type="short" usage="DATE" formatindex="34">
@@ -181,7 +181,7 @@
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey20" default="false" type="medium" usage="DATE" formatindex="37">
-<FormatCode>GGE"年度"QQ</FormatCode>
+<FormatCode>GGEE"年度"QQ</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateFormatskey21" default="false" type="short" usage="DATE" formatindex="38">
@@ -251,7 +251,7 @@
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateTimeFormatskey3" default="true" type="long" usage="DATE_TIME" formatindex="56">
-<FormatCode>E"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
+<FormatCode>EE"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateTimeFormatskey4" default="false" type="long" usage="DATE_TIME" formatindex="57">
@@ -259,11 +259,11 @@
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateTimeFormatskey5" default="false" type="long" usage="DATE_TIME" formatindex="58">
-<FormatCode>GGE"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
+<FormatCode>GGEE"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateTimeFormatskey6" default="false" type="long" usage="DATE_TIME" formatindex="59">
-<FormatCode>GGGE"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
+<FormatCode>GGGEE"å¹´"M"æ"D"æ¥" HH"æ"MM"å"SS"ç§"</FormatCode>
<DefaultName/>
</FormatElement>
<FormatElement msgid="DateTimeFormatskey7" default="false" type="long" usage="DATE_TIME" formatindex="60">
commit c73ce65d4269861712a1febbc69c1c39193914e0
Author: Jesús Corrius <jesus at softcatala.org>
Date: Sun Jan 30 15:00:14 2011 +0100
Fix wrong collation for Catalan language
diff --git a/i18npool/source/collator/data/ca_charset.txt b/i18npool/source/collator/data/ca_charset.txt
new file mode 100755
index 0000000..1cd90a1
--- /dev/null
+++ b/i18npool/source/collator/data/ca_charset.txt
@@ -0,0 +1,4 @@
+#
+# Collation of Catalan letters
+#
+& L << Š= l· <<< Ŀ = L·
diff --git a/i18npool/source/collator/data/collator_data.map b/i18npool/source/collator/data/collator_data.map
index 412635f..86b874e 100644
--- a/i18npool/source/collator/data/collator_data.map
+++ b/i18npool/source/collator/data/collator_data.map
@@ -19,6 +19,7 @@ global:
get_hu_charset;
get_ln_charset;
get_my_dictionary;
+ get_ca_charset;
local:
*;
diff --git a/i18npool/source/localedata/data/ca_ES.xml b/i18npool/source/localedata/data/ca_ES.xml
index 42fd55f..b73579a 100644
--- a/i18npool/source/localedata/data/ca_ES.xml
+++ b/i18npool/source/localedata/data/ca_ES.xml
@@ -176,7 +176,12 @@
<FormatCode>DD/MM/YYYY HH:MM:SS</FormatCode>
</FormatElement>
</LC_FORMAT>
- <LC_COLLATION ref="en_US" />
+ <LC_COLLATION>
+ <Collator unoid="charset" default="true"/>
+ <CollationOptions>
+ <TransliterationModules>IGNORE_CASE</TransliterationModules>
+ </CollationOptions>
+ </LC_COLLATION>
<LC_SEARCH ref="en_US"/>
<LC_INDEX ref="en_US"/>
<LC_CALENDAR>
commit d1fa75c09bfd65232fab21712fde7daac736e78e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 29 12:51:52 2011 +0000
Resolves: fdo#31271 wrong line break with (
(cherry picked from commit f36959ea3f48c491739deee1e152240ece9397f1)
diff --git a/i18npool/source/breakiterator/makefile.mk b/i18npool/source/breakiterator/makefile.mk
index f308812..fc6561c 100644
--- a/i18npool/source/breakiterator/makefile.mk
+++ b/i18npool/source/breakiterator/makefile.mk
@@ -79,7 +79,17 @@ GENBRK:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genbrk
GENCCODE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genccode
.ENDIF
-$(MISC)$/%.brk : data/%.txt
+.INCLUDE .IGNORE : icuversion.mk
+
+$(MISC)$/%.txt : data/%.txt
+# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
+.IF "$(ICU_MAJOR)" >= "5" || ("$(ICU_MAJOR)" == "4" && "$(ICU_MINOR)" >= "4")
+ $(SED) "s#\[:LineBreak = Close_Punctuation:\]#\[\[:LineBreak = Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@
+.ELSE
+ $(COPY) $< $@
+.ENDIF
+
+$(MISC)$/%.brk : $(MISC)/%.txt
$(WRAPCMD) $(GENBRK) -r $< -o $(MISC)$/$*.brk
$(MISC)$/%_brk.c : $(MISC)$/%.brk
commit e479fe60e9ebefd18b591f48574c0b2424d4321f
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Jan 21 20:44:45 2011 +0100
fix KDE3 library search order (fdo#32797)
Use LINKFLAGS instead of STDLIBS, as the latter comes way too late
in the link command and may result in some stray -L/usr/lib getting
before -L$KDEDIR/lib. Since KDE4 libs often tend to be installed
under /usr while KDE3 libs are often somewhere else such as /opt/kde3/lib,
this could cause using wrong libraries.
(cherry picked from commit b799041d66f5f5ec944b6baeec43df01fd3ace2c)
Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 983530c..8f2a61a 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -416,7 +416,7 @@ SHL5STDLIBS+= $(XRANDR_LIBS)
.ENDIF
.ENDIF
-SHL5STDLIBS+=$(KDE_LIBS)
+SHL5LINKFLAGS+=$(KDE_LIBS)
.ENDIF # "$(ENABLE_KDE)" != ""
commit 9885200e656f9bbfdea90d5fc6701707a689dd40
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 26 10:18:34 2011 +0000
fix for fdo#32561
crash when iterating over the database types, see the bug ( fdo#32561 ) for more details
Signed-off-by: Noel Power <noel.power at novell.com>
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index 950ef90..a93318f 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -485,8 +485,6 @@ namespace comphelper
try
{
- ::cppu::IPropertyArrayHelper& rPropInfo = getInfoHelper();
-
// check for unknown properties
// we cannot simply rely on the XMultiPropertySet::setPropertyValues
// implementation of our base class, since it does not throw
@@ -503,6 +501,7 @@ namespace comphelper
++pName, ++pHandle, ++pProperty
)
{
+ ::cppu::IPropertyArrayHelper& rPropInfo = getInfoHelper();
*pHandle = rPropInfo.getHandleByName( *pName );
if ( *pHandle != -1 )
continue;
@@ -513,9 +512,6 @@ namespace comphelper
// add the property
sal_Int16 nAttributes = PropertyAttribute::BOUND | PropertyAttribute::REMOVEABLE | PropertyAttribute::MAYBEDEFAULT;
addProperty( *pName, nAttributes, pProperty->Value );
- // rPropInfo is invalid, refetch
- rPropInfo = getInfoHelper();
- *pHandle = rPropInfo.getHandleByName( *pName );
continue;
}
commit e0328aba6a27485e7f71f95ca14c2f95bd7e698c
Author: Andras Timar <timar at fsf.hu>
Date: Sat Jan 15 19:49:16 2011 +0100
Default currency for Estonia should be Euro - fdo#33160
Signed-off-by: Kohei Yoshida <kyoshida at novell.com>
diff --git a/i18npool/source/localedata/data/et_EE.xml b/i18npool/source/localedata/data/et_EE.xml
index 2509c52..6b215af 100644
--- a/i18npool/source/localedata/data/et_EE.xml
+++ b/i18npool/source/localedata/data/et_EE.xml
@@ -311,7 +311,14 @@
</Calendar>
</LC_CALENDAR>
<LC_CURRENCY>
- <Currency default="true" usedInCompatibleFormatCodes="true">
+ <Currency default="true" usedInCompatibleFormatCodes="false">
+ <CurrencyID>EUR</CurrencyID>
+ <CurrencySymbol>â¬</CurrencySymbol>
+ <BankSymbol>EUR</BankSymbol>
+ <CurrencyName>Euro</CurrencyName>
+ <DecimalPlaces>2</DecimalPlaces>
+ </Currency>
+ <Currency default="false" usedInCompatibleFormatCodes="true">
<CurrencyID>EEK</CurrencyID>
<CurrencySymbol>kr</CurrencySymbol>
<BankSymbol>EEK</BankSymbol>
diff --git a/i18npool/source/localedata/data/mr_IN.xml b/i18npool/source/localedata/data/mr_IN.xml
old mode 100755
new mode 100644
commit 6daaf110b9d13220763bb0fe6041fd38c95ba797
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Fri Jan 21 13:31:46 2011 +0200
Avoid a pointless GetHelpText() call in the toolbox, too
Fixes fdo#33315. GetHelpText() can be quite heavy, see fdo#33088. Also
here the return value is passed to ShowHelpStatusText() which doesn't
do anything at all.
Signed-off-by: Caolan McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index d101122..29ef64c 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -521,13 +521,6 @@ void ToolBox::Highlight()
{
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT );
maHighlightHdl.Call( this );
-
- XubString aStr = GetHelpText( mnCurItemId );
- if ( aStr.Len() || mbHideStatusText )
- {
- GetpApp()->ShowHelpStatusText( aStr );
- mbHideStatusText = TRUE;
- }
}
// -----------------------------------------------------------------------
commit 699eac6373807f2ce2d731dd2f2640a540020f92
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Tue Jan 18 16:25:52 2011 +0200
Avoid GetHelpText() call which can be quite heavy
GetHelpText() can cause a quite heavy sequence of file and directory
lookups. See fdo#33088. As its return value here was just passed on to
ShowHelpStatusText() which doesn't do anything at all, it was
completely unnecessary. The GetHelpText() calls here caused the
noticeable slowdown in highlighting menu items on Windows with lots of
localised help files for some bundled extensions.
(cherry picked from commit 6fc21aa74b4d2aba07d854d5d3c2f404905b40ef)
Signed-off-by: Caolan McNamara <caolanm at redhat.com>
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
Signed-off-by: Thorsten Behrens <thb at documentfoundation.org>
Signed-off-by: fstrba at novell.com
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e4e2716..e269766 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1119,9 +1119,6 @@ void Menu::Highlight()
if ( pStartMenu && ( pStartMenu != this ) )
pStartMenu->aHighlightHdl.Call( this );
}
-
- if ( !aDelData.isDeleted() && GetCurItemId() )
- GetpApp()->ShowHelpStatusText( GetHelpText( GetCurItemId() ) );
}
void Menu::ImplSelect()
commit 3c13a7752cc1904e7a6a88380c10a2433a83feb8
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Jan 18 12:33:16 2011 +0100
paint toolbar handle positioned properly (fdo#32558)
ACK by Kendy.
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index fb8b3b9..af1ac3b 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -40,6 +40,7 @@
#include <QLabel>
#include <kapplication.h>
+#include <kdebug.h>
#undef Region
@@ -174,12 +175,10 @@ namespace
kapp->style()->drawControl(element, option, &painter);
}
- void draw( QStyle::PrimitiveElement element, QStyleOption* option, QImage* image, QStyle::State state, int nAdjust = 0 )
+ void draw( QStyle::PrimitiveElement element, QStyleOption* option, QImage* image, QStyle::State state, QRect rect = QRect())
{
option->state |= state;
- option->rect = image->rect();
- if( nAdjust )
- option->rect.adjust( nAdjust, nAdjust, -nAdjust, -nAdjust );
+ option->rect = !rect.isNull() ? rect : image->rect();
QPainter painter(image);
kapp->style()->drawPrimitive(element, option, &painter);
@@ -352,26 +351,25 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
vclStateValue2StateFlag(nControlState, value) );
}
else if ( (type == CTRL_TOOLBAR) && (part == PART_THUMB_VERT) )
- {
- const int tw = widgetRect.width();
- widgetRect.setWidth(kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent));
+ { // reduce paint area only to the handle area
+ const int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
+ QRect rect( 0, 0, width, widgetRect.height());
+ clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
QStyleOption option;
option.state = QStyle::State_Horizontal;
draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image,
- vclStateValue2StateFlag(nControlState, value) );
-
- widgetRect.setWidth(tw);
+ vclStateValue2StateFlag(nControlState, value), rect );
}
else if (type == CTRL_EDITBOX)
{
QStyleOptionFrameV2 option;
draw( QStyle::PE_PanelLineEdit, &option, m_image,
- vclStateValue2StateFlag(nControlState, value), 2 );
+ vclStateValue2StateFlag(nControlState, value), m_image->rect().adjusted( 2, 2, -2, -2 ));
draw( QStyle::PE_FrameLineEdit, &option, m_image,
- vclStateValue2StateFlag(nControlState, value), 0 );
+ vclStateValue2StateFlag(nControlState, value));
}
else if (type == CTRL_COMBOBOX)
{
commit ea29f32bd5bc1a937a747bd5a1f5b37f570ed25f
Author: Andre Fischer <andre.f.fischer at oracle.com>
Date: Tue Jan 18 10:41:22 2011 +0100
calc65: #i116318# Fixed the painting of axial gradients.
Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 4429ece..9c026b1 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -686,10 +686,23 @@ namespace cppcanvas
case GRADIENT_AXIAL:
{
- basegfx::tools::createLinearODFGradientInfo(aGradInfo,
+ // Adapt the border so that it is suitable
+ // for the axial gradient. An axial
+ // gradient consists of two linear
+ // gradients. Each of those covers half
+ // of the total size. In order to
+ // compensate for the condensed display of
+ // the linear gradients, we have to
+ // enlarge the area taken up by the actual
+ // gradient (1-fBorder). After that we
+ // have to turn the result back into a
+ // border value, hence the second (left
+ // most 1-...
+ const double fAxialBorder (1-2*(1-fBorder));
+ basegfx::tools::createAxialODFGradientInfo(aGradInfo,
aBounds,
nSteps,
- fBorder,
+ fAxialBorder,
fRotation);
// map odf to svg gradient orientation - x
// instead of y direction
commit 0ac6ad70d230f9115bd4dfa1ff45bf5991142603
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date: Mon Jan 17 20:37:33 2011 +0100
fix after struct member renaminge (pXRenderFormat)
the right one, this time.... sorry.
diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx
index f469d1b..3ce0994 100644
--- a/canvas/source/cairo/cairo_xlib_cairo.cxx
+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx
@@ -76,7 +76,7 @@ namespace cairo
nScreen(pSysDat.nScreen),
nDepth(pSysDat.nDepth),
aColormap(pSysDat.aColormap),
- pXRenderFormat(pSysDat.pRenderFormat)
+ pRenderFormat(pSysDat.pXRenderFormat)
{}
X11SysData::X11SysData( const SystemEnvData& pSysDat ) :
commit 74da9d0752269ff4c750d89fe3d9024d46dfd81d
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date: Mon Jan 17 20:33:32 2011 +0100
fix after variable renaming (pXrenderformat)
diff --git a/canvas/source/cairo/cairo_xlib_cairo.cxx b/canvas/source/cairo/cairo_xlib_cairo.cxx
index a7df2f7..f469d1b 100644
--- a/canvas/source/cairo/cairo_xlib_cairo.cxx
+++ b/canvas/source/cairo/cairo_xlib_cairo.cxx
@@ -76,7 +76,7 @@ namespace cairo
nScreen(pSysDat.nScreen),
nDepth(pSysDat.nDepth),
aColormap(pSysDat.aColormap),
- pRenderFormat(pSysDat.pRenderFormat)
+ pXRenderFormat(pSysDat.pRenderFormat)
{}
X11SysData::X11SysData( const SystemEnvData& pSysDat ) :
@@ -263,7 +263,7 @@ namespace cairo
aSystemGraphicsData.nSize = sizeof(SystemGraphicsData);
aSystemGraphicsData.hDrawable = getDrawable();
- aSystemGraphicsData.pRenderFormat = getRenderFormat();
+ aSystemGraphicsData.pXRenderFormat = getRenderFormat();
return boost::shared_ptr<VirtualDevice>(
new VirtualDevice( &aSystemGraphicsData, getDepth() ));
commit 828d4e5f3dd64c2986cc2dbc0491f28d6e0c6db7
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Wed Nov 3 15:17:33 2010 +0100
use sane scrollbar sizes when drawing
bnc#619772 leads to a crash because maximum = minimum = 0, and this
strange (but for whatever reason needed) '- mnVisibleSize' hack
makes maximum be -1, eventually leading to a crash
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 1689b28..fb8b3b9 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -441,6 +441,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
//setup parameters from the OO values
option.minimum = sbVal->mnMin;
option.maximum = sbVal->mnMax - sbVal->mnVisibleSize;
+ option.maximum = qMax( option.maximum, option.minimum ); // bnc#619772
option.sliderValue = sbVal->mnCur;
option.sliderPosition = sbVal->mnCur;
option.pageStep = sbVal->mnVisibleSize;
commit d46f89c39109a2ca351104c7feaefe59f187052a
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jan 17 16:06:05 2011 +0100
cleanup into one patch: do not mix unrelated X11 Visuals (fdo#33108)
Do not assume that there is just one generic Visual, as today's
XServers are ARGB-capable and cases of both the default depth
and 32bit visuals can happen.
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 1a8f56d..108371b 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -122,7 +122,7 @@ struct SystemGraphicsData
int nScreen; // the current screen of the drawable
int nDepth; // depth of said visual
long aColormap; // the colormap being used
- void* pRenderFormat; // render format for drawable
+ void* pXRenderFormat; // render format for drawable
#endif
};
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 8b20514..301fd21 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -577,7 +577,7 @@ SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
SystemGraphicsData aRes;
aRes.nSize = sizeof(aRes);
aRes.hDrawable = 0;
- aRes.pRenderFormat = 0;
+ aRes.pXRenderFormat = 0;
return aRes;
}
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 42f95f5..a7b3c11 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -1363,7 +1363,7 @@ SystemGraphicsData PspGraphics::GetGraphicsData() const
SystemGraphicsData aRes;
aRes.nSize = sizeof(aRes);
aRes.hDrawable = 0;
- aRes.pRenderFormat = 0;
+ aRes.pXRenderFormat = 0;
return aRes;
}
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index ef7cf8c..038e129 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -89,8 +89,8 @@ protected:
SalColormap *m_pDeleteColormap;
Drawable hDrawable_; // use
int m_nScreen;
- void* m_pRenderFormat;
- XID m_aRenderPicture;
+ mutable XRenderPictFormat* m_pXRenderFormat;
+ XID m_aXRenderPicture;
CairoFontsCache m_aCairoFontsCache;
XLIB_Region pPaintRegion_;
@@ -221,8 +221,8 @@ public:
inline Drawable GetDrawable() const { return hDrawable_; }
void SetDrawable( Drawable d, int nScreen );
XID GetXRenderPicture();
- void* GetXRenderFormat() const { return m_pRenderFormat; }
- inline void SetXRenderFormat( void* pRenderFormat ) { m_pRenderFormat = pRenderFormat; }
+ XRenderPictFormat* GetXRenderFormat() const;
+ inline void SetXRenderFormat( XRenderPictFormat* pXRenderFormat ) { m_pXRenderFormat = pXRenderFormat; }
inline const SalColormap& GetColormap() const { return *m_pColormap; }
using SalGraphics::GetPixel;
inline Pixel GetPixel( SalColor nSalColor ) const;
diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h
index 35ba9f9..81f1e80 100644
--- a/vcl/unx/inc/salvd.h
+++ b/vcl/unx/inc/salvd.h
@@ -62,7 +62,7 @@ public:
USHORT nBitCount,
int nScreen,
Pixmap hDrawable = None,
- void* pRenderFormat = NULL );
+ XRenderPictFormat* pXRenderFormat = NULL );
inline void InitGraphics( X11SalVirtualDevice *pVD );
inline Display *GetXDisplay() const;
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 29f7eba..c25e065 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -1472,7 +1472,7 @@ SystemGraphicsData PspGraphics::GetGraphicsData() const
SystemGraphicsData aRes;
aRes.nSize = sizeof(aRes);
aRes.hDrawable = 0;
- aRes.pRenderFormat = 0;
+ aRes.pXRenderFormat = 0;
return aRes;
}
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 4746e94..2b803a2 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -102,8 +102,8 @@ X11SalGraphics::X11SalGraphics()
m_pVDev = NULL;
m_pDeleteColormap = NULL;
hDrawable_ = None;
- m_aRenderPicture = 0;
- m_pRenderFormat = NULL;
+ m_aXRenderPicture = 0;
+ m_pXRenderFormat = NULL;
pClipRegion_ = NULL;
pPaintRegion_ = NULL;
@@ -187,8 +187,8 @@ void X11SalGraphics::freeResources()
if( m_pDeleteColormap )
delete m_pDeleteColormap, m_pColormap = m_pDeleteColormap = NULL;
- if( m_aRenderPicture )
- XRenderPeer::GetInstance().FreePicture( m_aRenderPicture ), m_aRenderPicture = 0;
+ if( m_aXRenderPicture )
+ XRenderPeer::GetInstance().FreePicture( m_aXRenderPicture ), m_aXRenderPicture = 0;
bPenGC_ = bFontGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = bTrackingGC_ = false;
}
@@ -209,10 +209,10 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, int nScreen )
hDrawable_ = aDrawable;
SetXRenderFormat( NULL );
- if( m_aRenderPicture )
+ if( m_aXRenderPicture )
{
- XRenderPeer::GetInstance().FreePicture( m_aRenderPicture );
- m_aRenderPicture = 0;
+ XRenderPeer::GetInstance().FreePicture( m_aXRenderPicture );
+ m_aXRenderPicture = 0;
}
if( hDrawable_ )
@@ -1021,23 +1021,14 @@ XID X11SalGraphics::GetXRenderPicture()
{
XRenderPeer& rRenderPeer = XRenderPeer::GetInstance();
- if( !m_aRenderPicture )
+ if( !m_aXRenderPicture )
{
// check xrender support for matching visual
- // find a XRenderPictFormat compatible with the Drawable
- XRenderPictFormat* pVisualFormat = static_cast<XRenderPictFormat*>(GetXRenderFormat());
- if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = rRenderPeer.FindVisualFormat( pVisual );
- if( !pVisualFormat )
- return 0;
- // cache the XRenderPictFormat
- SetXRenderFormat( static_cast<void*>(pVisualFormat) );
- }
-
+ XRenderPictFormat* pXRenderFormat = GetXRenderFormat();
+ if( !pXRenderFormat )
+ return 0;
// get the matching xrender target for drawable
- m_aRenderPicture = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL );
+ m_aXRenderPicture = rRenderPeer.CreatePicture( hDrawable_, pXRenderFormat, 0, NULL );
}
{
@@ -1045,10 +1036,17 @@ XID X11SalGraphics::GetXRenderPicture()
// TODO: avoid clip reset if already done
XRenderPictureAttributes aAttr;
aAttr.clip_mask = None;
- rRenderPeer.ChangePicture( m_aRenderPicture, CPClipMask, &aAttr );
+ rRenderPeer.ChangePicture( m_aXRenderPicture, CPClipMask, &aAttr );
}
- return m_aRenderPicture;
+ return m_aXRenderPicture;
+}
+
+XRenderPictFormat* X11SalGraphics::GetXRenderFormat() const
+{
+ if( m_pXRenderFormat == NULL )
+ m_pXRenderFormat = XRenderPeer::GetInstance().FindVisualFormat( GetVisual().visual );
+ return m_pXRenderFormat;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1064,7 +1062,7 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const
aRes.nScreen = m_nScreen;
aRes.nDepth = GetDisplay()->GetVisual( m_nScreen ).GetDepth();
aRes.aColormap = GetDisplay()->GetColormap( m_nScreen ).GetXColormap();
- aRes.pRenderFormat = m_pRenderFormat;
+ aRes.pXRenderFormat = m_pXRenderFormat;
return aRes;
}
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 02d9491..767c91d 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -985,15 +985,7 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
return;
// find a XRenderPictFormat compatible with the Drawable
- XRenderPictFormat* pVisualFormat = static_cast<XRenderPictFormat*>(GetXRenderFormat());
- if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = XRenderPeer::GetInstance().FindVisualFormat( pVisual );
- // cache the XRenderPictFormat
- SetXRenderFormat( static_cast<void*>(pVisualFormat) );
- }
-
+ XRenderPictFormat* pVisualFormat = GetXRenderFormat();
DBG_ASSERT( pVisualFormat!=NULL, "no matching XRenderPictFormat for text" );
if( !pVisualFormat )
return;
diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx
index ac1a03c..dc8b4b1 100644
--- a/vcl/unx/source/gdi/salvd.cxx
+++ b/vcl/unx/source/gdi/salvd.cxx
@@ -68,7 +68,8 @@ SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
}
nDX = (long)w;
nDY = (long)h;
- if( !pVDev->Init( GetX11SalData()->GetDisplay(), nDX, nDY, nBitCount, nScreen, pData->hDrawable, pData->pRenderFormat ) )
+ if( !pVDev->Init( GetX11SalData()->GetDisplay(), nDX, nDY, nBitCount, nScreen, pData->hDrawable,
+ static_cast< XRenderPictFormat* >( pData->pXRenderFormat )) )
{
delete pVDev;
return NULL;
@@ -136,7 +137,7 @@ BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
USHORT nBitCount,
int nScreen,
Pixmap hDrawable,
- void* pRenderFormatVoid )
+ XRenderPictFormat* pXRenderFormat )
{
SalColormap* pColormap = NULL;
bool bDeleteColormap = false;
@@ -144,11 +145,10 @@ BOOL X11SalVirtualDevice::Init( SalDisplay *pDisplay,
pDisplay_ = pDisplay;
pGraphics_ = new X11SalGraphics();
m_nScreen = nScreen;
- if( pRenderFormatVoid ) {
- XRenderPictFormat *pRenderFormat = ( XRenderPictFormat* )pRenderFormatVoid;
- pGraphics_->SetXRenderFormat( pRenderFormat );
- if( pRenderFormat->colormap )
- pColormap = new SalColormap( pDisplay, pRenderFormat->colormap, m_nScreen );
+ if( pXRenderFormat ) {
+ pGraphics_->SetXRenderFormat( pXRenderFormat );
+ if( pXRenderFormat->colormap )
+ pColormap = new SalColormap( pDisplay, pXRenderFormat->colormap, m_nScreen );
else
pColormap = new SalColormap( nBitCount );
bDeleteColormap = true;
commit 6ac877774a2b0c067df150ef6abcf501b2c9ff23
Author: Andras Timar <timar at fsf.hu>
Date: Sat Jan 15 19:55:40 2011 +0100
translation fix in hu_HU.xml (felette/alatta -> fentebb/alább)
diff --git a/i18npool/source/localedata/data/hu_HU.xml b/i18npool/source/localedata/data/hu_HU.xml
index f8ddd78..2f52515 100644
--- a/i18npool/source/localedata/data/hu_HU.xml
+++ b/i18npool/source/localedata/data/hu_HU.xml
@@ -329,8 +329,8 @@
<quarter2Word>II. negyedév</quarter2Word>
<quarter3Word>III. negyedév</quarter3Word>
<quarter4Word>IV. negyedév</quarter4Word>
- <aboveWord>felett</aboveWord>
- <belowWord>alatt</belowWord>
+ <aboveWord>fentebb</aboveWord>
+ <belowWord>alább</belowWord>
<quarter1Abbreviation>N1</quarter1Abbreviation>
<quarter2Abbreviation>N2</quarter2Abbreviation>
<quarter3Abbreviation>N3</quarter3Abbreviation>
commit 0d057e9a0c8bfd78ee6bc04b65b3ffe64508ef6e
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jan 11 23:05:57 2011 +0100
Please, ignore the previous message; it was for the libreoffice-3-3-0 branch
This is 'libreoffice-3-3' - the stable branch for the 3.3.x releases.
Only safe changes, reviewed by anoter person are allowed.
If you want to build something cool, unstable, and risky, use master.
commit 913e3efa97a6c675f9a1187aa1d4d42449a76041
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jan 11 22:39:08 2011 +0100
Branch libreoffice-3-3-0
This is 'libreoffice-3-3-0' - the stable branch for the 3.3.0 release.
Only very safe changes, reviewed by three people are allowed.
If you want to commit more complicated fix for the next 3.3.x release,
please use the 'libreoffice-3-3' branch.
If you want to build something cool, unstable, and risky, use master.
commit ca986ad6c4fbc59f54cdf363b40e1b423db4aeb3
Author: Petr Mladek <pmladek at suse.cz>
Date: Mon Jan 10 19:47:11 2011 +0100
Version 3.3.0.3, tag libreoffice-3.3.0.3 (3.3-rc3)
commit e8bee3c77008cae166916bfe0cca2111063845bd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jan 6 17:05:14 2011 +0000
Resolves: rhbz#666088 clean up search cache singleton in correct order
Signed-off-by: Kohei Yoshida <kyoshida at novell.com>
diff --git a/unotools/inc/unotools/textsearch.hxx b/unotools/inc/unotools/textsearch.hxx
index 0aaa123..16ae82f 100644
--- a/unotools/inc/unotools/textsearch.hxx
+++ b/unotools/inc/unotools/textsearch.hxx
@@ -128,15 +128,6 @@ public:
class UNOTOOLS_DLLPUBLIC TextSearch
{
- struct CachedTextSearch
- {
- ::osl::Mutex mutex;
- ::com::sun::star::util::SearchOptions Options;
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch > xTextSearch;
- };
-
- static CachedTextSearch maCache;
-
static ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch >
getXTextSearch( const ::com::sun::star::util::SearchOptions& rPara );
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 8f8f780..8085045 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -36,6 +36,7 @@
#include <unotools/charclass.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/textsearch.hxx>
+#include <rtl/instance.hxx>
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::uno;
@@ -86,13 +87,6 @@ SearchParam::SearchParam( const SearchParam& rParam )
nTransliterationFlags = rParam.nTransliterationFlags;
}
-// Klasse zum Suchen eines Strings in einem Text. Es wird genau nach
-// dem String gesucht.
-// ( Die Unterscheidung der Gross/Klein-Schreibung kann mit einen Flag
-// unterdrueckt werden )
-
-TextSearch::CachedTextSearch TextSearch::maCache;
-
static bool lcl_Equals( const SearchOptions& rSO1, const SearchOptions& rSO2 )
{
return rSO1.algorithmType == rSO2.algorithmType &&
@@ -108,27 +102,42 @@ static bool lcl_Equals( const SearchOptions& rSO1, const SearchOptions& rSO2 )
rSO1.transliterateFlags == rSO2.transliterateFlags;
}
+namespace
+{
+ struct CachedTextSearch
+ {
+ ::osl::Mutex mutex;
+ ::com::sun::star::util::SearchOptions Options;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XTextSearch > xTextSearch;
+ };
+
+ struct theCachedTextSearch
+ : public rtl::Static< CachedTextSearch, theCachedTextSearch > {};
+}
+
Reference<XTextSearch> TextSearch::getXTextSearch( const SearchOptions& rPara )
{
- osl::MutexGuard aGuard(maCache.mutex);
+ CachedTextSearch &rCache = theCachedTextSearch::get();
+
+ osl::MutexGuard aGuard(rCache.mutex);
- if ( lcl_Equals(maCache.Options, rPara) )
- return maCache.xTextSearch;
+ if ( lcl_Equals(rCache.Options, rPara) )
+ return rCache.xTextSearch;
try
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- maCache.xTextSearch.set( xMSF->createInstance(
+ rCache.xTextSearch.set( xMSF->createInstance(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.util.TextSearch" ) ) ), UNO_QUERY_THROW );
- maCache.xTextSearch->setOptions( rPara );
- maCache.Options = rPara;
+ rCache.xTextSearch->setOptions( rPara );
+ rCache.Options = rPara;
}
catch ( Exception& )
{
DBG_ERRORFILE( "TextSearch ctor: Exception caught!" );
}
- return maCache.xTextSearch;
+ return rCache.xTextSearch;
}
TextSearch::TextSearch(const SearchParam & rParam, LanguageType eLang )
More information about the Libreoffice-commits
mailing list