[Libreoffice-commits] .: 20 commits -
Jan Holesovsky
kendy at kemper.freedesktop.org
Thu Jul 28 09:41:28 PDT 2011
0 files changed
New commits:
commit c7e52c8442d80ab5d7fb456ff17fcff81e739e46
Merge: 7547c6c... 10e028a...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 28 18:39:22 2011 +0200
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/libs-gui
commit 7547c6c84455a6b547c440417c9b9e5828b80fe1
Merge: eb61c27... d88e950...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 28 10:14:01 2011 +0200
Merge commit 'libreoffice-3.4.2.3'
commit d88e95038cf0491ff08623129a3d05091e50463e
Author: Petr Mladek <pmladek at suse.cz>
Date: Mon Jul 25 20:28:44 2011 +0200
Version 3.4.2.3, tag libreoffice-3.4.2.3 (3.4.2-rc3)
commit 6ae9b5cbf84856751b63aaeba70a8121e4be8386
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jul 25 18:12:38 2011 +0200
EMF+ records don't need payload all the time
Fix for fdo#39517. Looking through the emf+ records, it looks like the
assumption made that the minimum valid record length is 12 + non-0
length payload isnt' right, looks like that the minimum valid record
length is just 12, i.e. no need for a payload.
Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
Signed-off-by: Petr Mladek <pmladek at suse.cz>
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
index 45c3cee..e321b20 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -275,7 +275,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
sal_uInt32 nRemainder = length >= 4 ? length-4 : length;
const size_t nRequiredHeaderSize = 12;
- while (nRemainder > nRequiredHeaderSize)
+ while (nRemainder >= nRequiredHeaderSize)
{
sal_uInt16 type(0), flags(0);
sal_uInt32 size(0), dataSize(0);
commit 2dd78db8a848dec3830cccd2f8ad9b06b4b7a0fc
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jul 19 17:08:00 2011 +0200
Version 3.4.2.2, tag libreoffice-3.4.2.2 (3.4.2-rc2)
commit c8c3b38b3e59cc97146a7acf2614e71a61bd8b85
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jul 19 12:45:50 2011 +0200
fix typo in the last commit
scriptListCount should get initialized by scriptList variable
Signed-off-by: Jan Holesovsky <kendy at suse.cz>
Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 377e575..95c0877 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -535,7 +535,7 @@ namespace
{UBLOCK_LATIN_EXTENDED_C, UBLOCK_LATIN_EXTENDED_D, ScriptType::LATIN}
};
- #define scriptListCount SAL_N_ELEMENTS(scriptTypes)
+ #define scriptListCount SAL_N_ELEMENTS(scriptList)
//always sets rScriptType
//
commit c0d66a599cf34b9b2410727b9015bd3aac58b024
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 19 09:21:10 2011 +0100
Resolves: fdo#38095 half&full width forms need to remain asian
Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 0f42fe7..7b4df32 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -57,11 +57,13 @@ public:
void testLineBreaking();
void testGraphemeIteration();
void testWeak();
+ void testAsian();
CPPUNIT_TEST_SUITE(TestBreakIterator);
CPPUNIT_TEST(testLineBreaking);
CPPUNIT_TEST(testGraphemeIteration);
CPPUNIT_TEST(testWeak);
+ CPPUNIT_TEST(testAsian);
CPPUNIT_TEST_SUITE_END();
private:
@@ -104,7 +106,7 @@ void TestBreakIterator::testGraphemeIteration()
aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IN"));
{
- sal_Unicode BA_HALANT_LA[] = { 0x09AC, 0x09CD, 0x09AF };
+ const sal_Unicode BA_HALANT_LA[] = { 0x09AC, 0x09CD, 0x09AF };
::rtl::OUString aTest1(BA_HALANT_LA, SAL_N_ELEMENTS(BA_HALANT_LA));
sal_Int32 nDone=0;
@@ -118,7 +120,7 @@ void TestBreakIterator::testGraphemeIteration()
}
{
- sal_Unicode HA_HALANT_NA_VOWELSIGNI[] = { 0x09B9, 0x09CD, 0x09A3, 0x09BF };
+ const sal_Unicode HA_HALANT_NA_VOWELSIGNI[] = { 0x09B9, 0x09CD, 0x09A3, 0x09BF };
::rtl::OUString aTest1(HA_HALANT_NA_VOWELSIGNI, SAL_N_ELEMENTS(HA_HALANT_NA_VOWELSIGNI));
sal_Int32 nDone=0;
@@ -132,7 +134,7 @@ void TestBreakIterator::testGraphemeIteration()
}
{
- sal_Unicode TA_HALANT_MA_HALANT_YA [] = { 0x09A4, 0x09CD, 0x09AE, 0x09CD, 0x09AF };
+ const sal_Unicode TA_HALANT_MA_HALANT_YA [] = { 0x09A4, 0x09CD, 0x09AE, 0x09CD, 0x09AF };
::rtl::OUString aTest1(TA_HALANT_MA_HALANT_YA, SAL_N_ELEMENTS(TA_HALANT_MA_HALANT_YA));
sal_Int32 nDone=0;
@@ -156,10 +158,12 @@ void TestBreakIterator::testWeak()
aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"));
{
- sal_Unicode WEAKS[] =
+ const sal_Unicode WEAKS[] =
{
0x0001, 0x0002,
0x0020, 0x00A0,
+ 0x2150, 0x215F, //Number Forms, fractions
+ 0x2160, 0x2180, //Number Forms, roman numerals
0x2200, 0x22FF, //Mathematical Operators
0x27C0, 0x27EF, //Miscellaneous Mathematical Symbols-A
0x2980, 0x29FF, //Miscellaneous Mathematical Symbols-B
@@ -184,6 +188,45 @@ void TestBreakIterator::testWeak()
}
}
+//A test to ensure that certain ranges and codepoints that are categorized as
+//asian remain as asian, so that existing docs that depend on this don't silently
+//change font for those asian chars.
+//See https://bugs.freedesktop.org/show_bug.cgi?id=38095
+void TestBreakIterator::testAsian()
+{
+ lang::Locale aLocale;
+ aLocale.Language = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"));
+ aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"));
+
+ {
+ const sal_Unicode ASIANS[] =
+ {
+ //some typical CJK chars
+ 0x4E00, 0x62FF,
+ //The full HalfWidth and FullWidth block has historically been
+ //designated as taking the CJK font :-(
+ //HalfWidth and FullWidth forms of ASCII 0-9, categorized under
+ //UAX24 as "Common" i.e. by that logic WEAK
+ 0xFF10, 0xFF19,
+ //HalfWidth and FullWidth forms of ASCII A-z, categorized under
+ //UAX25 as "Latin", i.e. by that logic LATIN
+ 0xFF21, 0xFF5A
+ };
+ ::rtl::OUString aAsians(ASIANS, SAL_N_ELEMENTS(ASIANS));
+
+ for (sal_Int32 i = 0; i < aAsians.getLength(); ++i)
+ {
+ sal_Int16 nScript = m_xBreak->getScriptType(aAsians, i);
+ rtl::OStringBuffer aMsg;
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM("Char 0x"));
+ aMsg.append(static_cast<sal_Int32>(aAsians.getStr()[i]), 16);
+ aMsg.append(RTL_CONSTASCII_STRINGPARAM(" should have been asian"));
+ CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(),
+ nScript == i18n::ScriptType::ASIAN);
+ }
+ }
+}
+
TestBreakIterator::TestBreakIterator()
{
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 601acef..377e575 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -443,67 +443,155 @@ sal_Int16 SAL_CALL BreakIteratorImpl::getWordType( const OUString& /*Text*/,
return 0;
}
-static sal_Int16 scriptTypes[] = {
- ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN,
-// 15
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, ScriptType::COMPLEX,
- ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
-// 30
- ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 45
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 60
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN,
-// 75
- ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 90
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX,
-// 105
- ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN,
-// 120
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
-// 135
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
- ScriptType::COMPLEX,
- ScriptType::WEAK};
-
-#define scriptListCount SAL_N_ELEMENTS(scriptTypes)
+namespace
+{
+ //See unicode/uscript.h
+ static sal_Int16 scriptTypes[] =
+ {
+ ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX,
+ ScriptType::ASIAN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::LATIN,
+ // 15
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN, ScriptType::COMPLEX,
+ ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
+ // 30
+ ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::LATIN, ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ // 45
+ ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN,
+ ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ // 60
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN, ScriptType::ASIAN,
+ // 75
+ ScriptType::COMPLEX, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::LATIN, ScriptType::LATIN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ // 90
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK, ScriptType::COMPLEX,
+ // 105
+ ScriptType::ASIAN, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::ASIAN,
+ // 120
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::WEAK, ScriptType::WEAK,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ // 135
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX, ScriptType::COMPLEX,
+ ScriptType::COMPLEX,
+ ScriptType::WEAK
+ };
+
+# define scriptTypesCount SAL_N_ELEMENTS(scriptTypes)
+
+ sal_Int16 getScriptClassByUAX24Script(sal_uInt32 currentChar)
+ {
+ sal_Int16 nRet;
+ int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
+ if (script < 0)
+ nRet = ScriptType::WEAK;
+ else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes))
+ nRet = ScriptType::COMPLEX; // anything new is going to be pretty wild
+ else
+ nRet = scriptTypes[script];
+ return nRet;
+ }
+
+ struct UBlock2Script
+ {
+ UBlockCode from;
+ UBlockCode to;
+ sal_Int16 script;
+ };
+
+ static UBlock2Script scriptList[] =
+ {
+ {UBLOCK_NO_BLOCK, UBLOCK_NO_BLOCK, ScriptType::WEAK},
+ {UBLOCK_BASIC_LATIN, UBLOCK_ARMENIAN, ScriptType::LATIN},
+ {UBLOCK_HEBREW, UBLOCK_MYANMAR, ScriptType::COMPLEX},
+ {UBLOCK_GEORGIAN, UBLOCK_GEORGIAN, ScriptType::LATIN},
+ {UBLOCK_HANGUL_JAMO, UBLOCK_HANGUL_JAMO, ScriptType::ASIAN},
+ {UBLOCK_ETHIOPIC, UBLOCK_ETHIOPIC, ScriptType::COMPLEX},
+ {UBLOCK_CHEROKEE, UBLOCK_RUNIC, ScriptType::LATIN},
+ {UBLOCK_KHMER, UBLOCK_MONGOLIAN, ScriptType::COMPLEX},
+ {UBLOCK_LATIN_EXTENDED_ADDITIONAL, UBLOCK_GREEK_EXTENDED, ScriptType::LATIN},
+ {UBLOCK_NUMBER_FORMS, UBLOCK_NUMBER_FORMS, ScriptType::WEAK},
+ {UBLOCK_CJK_RADICALS_SUPPLEMENT, UBLOCK_HANGUL_SYLLABLES, ScriptType::ASIAN},
+ {UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS, ScriptType::ASIAN},
+ {UBLOCK_ARABIC_PRESENTATION_FORMS_A, UBLOCK_ARABIC_PRESENTATION_FORMS_A, ScriptType::COMPLEX},
+ {UBLOCK_CJK_COMPATIBILITY_FORMS, UBLOCK_CJK_COMPATIBILITY_FORMS, ScriptType::ASIAN},
+ {UBLOCK_ARABIC_PRESENTATION_FORMS_B, UBLOCK_ARABIC_PRESENTATION_FORMS_B, ScriptType::COMPLEX},
+ {UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS, ScriptType::ASIAN},
+ {UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, ScriptType::ASIAN},
+ {UBLOCK_CJK_STROKES, UBLOCK_CJK_STROKES, ScriptType::ASIAN},
+ {UBLOCK_LATIN_EXTENDED_C, UBLOCK_LATIN_EXTENDED_D, ScriptType::LATIN}
+ };
+
+ #define scriptListCount SAL_N_ELEMENTS(scriptTypes)
+
+ //always sets rScriptType
+ //
+ //returns true for characters historically explicitly assigned to
+ //latin/weak/asian
+ //
+ //returns false for characters that historically implicitly assigned to
+ //weak as unknown
+ bool getCompatibilityScriptClassByBlock(sal_uInt32 currentChar, sal_Int16 &rScriptType)
+ {
+ bool bKnown = true;
+ //handle specific characters always as weak:
+ // 0x01 - this breaks a word
+ // 0x02 - this can be inside a word
+ // 0x20 & 0xA0 - Bug 102975, declare western space and non-break space as WEAK char.
+ if( 0x01 == currentChar || 0x02 == currentChar || 0x20 == currentChar || 0xA0 == currentChar)
+ rScriptType = ScriptType::WEAK;
+ // workaround for Coptic
+ else if ( 0x2C80 <= currentChar && 0x2CE3 >= currentChar)
+ rScriptType = ScriptType::LATIN;
+ else
+ {
+ UBlockCode block=ublock_getCode(currentChar);
+ size_t i = 0;
+ while (i < scriptListCount)
+ {
+ if (block <= scriptList[i].to)
+ break;
+ ++i;
+ }
+ if (i < scriptListCount && block >= scriptList[i].from)
+ rScriptType = scriptList[i].script;
+ else
+ {
+ rScriptType = ScriptType::WEAK;
+ bKnown = false;
+ }
+ }
+ return bKnown;
+ }
+}
sal_Int16 BreakIteratorImpl::getScriptClass(sal_uInt32 currentChar)
{
- static sal_uInt32 lastChar = 0;
- static sal_Int16 nRet = 0;
+ static sal_uInt32 lastChar = 0;
+ static sal_Int16 nRet = 0;
- if (currentChar != lastChar) {
- lastChar = currentChar;
+ if (currentChar != lastChar)
+ {
+ lastChar = currentChar;
- int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT);
- if (script < 0)
- nRet = ScriptType::WEAK;
- else if (static_cast<size_t>(script) >= SAL_N_ELEMENTS(scriptTypes))
- nRet = ScriptType::COMPLEX; // anything new is going to be pretty wild
- else
- nRet = scriptTypes[script];
- }
- return nRet;
+ if (!getCompatibilityScriptClassByBlock(currentChar, nRet))
+ nRet = getScriptClassByUAX24Script(currentChar);
+ }
+
+ return nRet;
}
static inline sal_Bool operator == (const Locale& l1, const Locale& l2) {
commit 40bba479901857d4f4b959058dddaf1d558cdc25
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jul 12 16:41:11 2011 +0200
Branch libreoffice-3-4-2
This is 'libreoffice-3-4-2' - the stable branch for the 3.4.2 release.
Only very safe changes, reviewed by three people are allowed.
If you want to commit more complicated fix for the next 3.4.x release,
please use the 'libreoffice-3-4' branch.
If you want to build something cool, unstable, and risky, use master.
commit dbcedbc7b7747f852af163428a1de39d0fbf077d
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Jul 12 15:49:41 2011 +0200
Version 3.4.2.1, tag libreoffice-3.4.2.1 (3.4.2-rc1)
commit f143e7cf1ceaf7526fc95ca70ad95b4458d52225
Author: Radek Doulik <rodo at novell.com>
Date: Tue Jul 12 13:35:43 2011 +0200
fix set color regression in cairo canvas
- the cairo_set_source_rgba should be called with non-alpha-pre-multiplied
color values
- fixes fdo#33591 and fdo#35681
Signed-off-by: Petr Mladek <pmladek at suse.cz>
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 18e23f3..ccf7dd9 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -128,13 +128,11 @@ namespace cairocanvas
{
if( rColor.getLength() > 3 )
{
- const double alpha = rColor[3];
-
cairo_set_source_rgba( pCairo,
- alpha*rColor[0],
- alpha*rColor[1],
- alpha*rColor[2],
- alpha );
+ rColor[0],
+ rColor[1],
+ rColor[2],
+ rColor[3] );
}
else if( rColor.getLength() == 3 )
cairo_set_source_rgb( pCairo,
commit 24016c09cb9ccab425a3cebd1cbdf0023a502ffa
Author: Radek Doulik <rodo at novell.com>
Date: Mon Jul 11 20:36:47 2011 +0200
fix regression in SvGlobalName::operator <
- it was comparing wrong parts and ommiting part of ID's, resulting
in wrong results and thus ::std::map didn't work well with default
less compare function of it's keys
- fixes fdo#32709
(cherry picked from commit 345dc7961bc142f167a1b8e5f43f4439e8234f06)
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx
index 1163ced..7da4ffb 100644
--- a/tools/source/ref/globname.cxx
+++ b/tools/source/ref/globname.cxx
@@ -208,10 +208,10 @@ sal_Bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const
else if( Data2_a == Data2_b )
{
sal_uInt32 Data1_a;
- memcpy(&Data1_a, pImp->szData+4, sizeof(sal_uInt32));
+ memcpy(&Data1_a, pImp->szData, sizeof(sal_uInt32));
sal_uInt32 Data1_b;
- memcpy(&Data1_b, rObj.pImp->szData+4, sizeof(sal_uInt32));
+ memcpy(&Data1_b, rObj.pImp->szData, sizeof(sal_uInt32));
return Data1_a < Data1_b;
}
commit 74b48022853b3141b8c2d421eec5b59fbc35d93f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 6 13:41:52 2011 +0100
handle busted emf lengths
(cherry picked from commit 2b15986b1452f47f93ffc25d2ffcc52d347d5581)
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
index ef141ff..45c3cee 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -261,22 +261,27 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
}
bEMFPlus = true;
+ sal_Size pos = pWMF->Tell();
void *buffer = malloc( length );
-
- int pos = pWMF->Tell();
pOut->PassEMFPlus( buffer, pWMF->Read( buffer, length ) );
+ free( buffer );
pWMF->Seek( pos );
bHaveDC = false;
- length -= 4;
+ OSL_ASSERT(length >= 4);
+ //reduce by 32bit length itself, skip in SeekRel if
+ //impossibly unavailble
+ sal_uInt32 nRemainder = length >= 4 ? length-4 : length;
- while (length > 0) {
- sal_uInt16 type, flags;
- sal_uInt32 size, dataSize;
- sal_uInt32 next;
+ const size_t nRequiredHeaderSize = 12;
+ while (nRemainder > nRequiredHeaderSize)
+ {
+ sal_uInt16 type(0), flags(0);
+ sal_uInt32 size(0), dataSize(0);
*pWMF >> type >> flags >> size >> dataSize;
+ nRemainder -= nRequiredHeaderSize;
EMFP_DEBUG(printf ("\t\tEMF+ record type: %d\n", type));
@@ -286,14 +291,16 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
EMFP_DEBUG(printf ("\t\tEMF+ lock DC (device context)\n", type));
}
- next = pWMF->Tell() + ( size - 12 );
-
- length -= size;
-
- pWMF->Seek( next );
+ //Get the length of the remaining data of this record based
+ //on the alleged size
+ sal_uInt32 nRemainingRecordData = size >= nRequiredHeaderSize ?
+ size-nRequiredHeaderSize : 0;
+ //clip to available size
+ nRemainingRecordData = std::min(nRemainingRecordData, nRemainder);
+ pWMF->SeekRel(nRemainingRecordData);
+ nRemainder -= nRemainingRecordData;
}
-
- free( buffer );
+ pWMF->SeekRel(nRemainder);
}
void EnhWMFReader::ReadGDIComment()
commit b74f2e0c4ff7a0f8a0b5c031825aef7a7d211daf
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jul 7 12:05:01 2011 +0200
fdo#38963: crash in number format dialog
Signed-off-by: Katarina Machalkova <kmachalkova at novell.com>
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index ae7cfae..2a62b2b 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2749,7 +2749,6 @@ void SvNumberFormatter::GenerateFormat(String& sString,
const String& rThSep = GetNumThousandSep();
SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex);
- sal_Bool insertBrackets = pFormat->IsNegativeInBracket();
if (nAnzLeading == 0)
{
@@ -2843,36 +2842,42 @@ void SvNumberFormatter::GenerateFormat(String& sString,
sString += ';';
sString += sNegStr;
}
- if ( (IsRed || insertBrackets ) && eType != NUMBERFORMAT_CURRENCY)
+ if (eType != NUMBERFORMAT_CURRENCY)
{
- String sTmpStr = sString;
-
- if ( pFormat->HasPositiveBracketPlaceholder() )
+ bool insertBrackets = false;
+ if ( eType != NUMBERFORMAT_UNDEFINED)
+ insertBrackets = pFormat->IsNegativeInBracket();
+ if (IsRed || insertBrackets)
{
- sTmpStr += '_';
- sTmpStr += ')';
- }
- sTmpStr += ';';
+ String sTmpStr = sString;
- if (IsRed)
- {
- sTmpStr += '[';
- sTmpStr += pFormatScanner->GetRedString();
- sTmpStr += ']';
- }
+ if ( pFormat->HasPositiveBracketPlaceholder() )
+ {
+ sTmpStr += '_';
+ sTmpStr += ')';
+ }
+ sTmpStr += ';';
- if (insertBrackets)
- {
- sTmpStr += '(';
- sTmpStr += sString;
- sTmpStr += ')';
- }
- else
- {
- sTmpStr += '-';
- sTmpStr +=sString;
- }
- sString = sTmpStr;
+ if (IsRed)
+ {
+ sTmpStr += '[';
+ sTmpStr += pFormatScanner->GetRedString();
+ sTmpStr += ']';
+ }
+
+ if (insertBrackets)
+ {
+ sTmpStr += '(';
+ sTmpStr += sString;
+ sTmpStr += ')';
+ }
+ else
+ {
+ sTmpStr += '-';
+ sTmpStr +=sString;
+ }
+ sString = sTmpStr;
+ }
}
}
commit 1d66d2233cc4b458d3ad3bdad8682828f5fb321a
Author: Katarina Machalkova <kmachalkova at novell.com>
Date: Thu Jul 7 16:14:30 2011 +0300
Duplicate entries in Directory definition are no longer treated as errors
Fixes a problem where cetain XLS documents open as blank in
LibreOffice.
Described in the non-public bnc#682484.
Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index fcaa3d3..eb9fd8c 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -853,7 +853,10 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
}
else
{
- rIo.SetError( SVSTREAM_CANNOT_MAKE );
+ // bnc#682484: There are some really broken docs out there
+ // that contain duplicate entries in 'Directory' section
+ // so don't set the error flag here and just skip those
+ // (was: rIo.SetError( SVSTREAM_CANNOT_MAKE );)
delete pCur; pCur = NULL;
return;
}
commit 3e89e510bf9974f75a81baf13dc59f6e137ec9a9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jul 3 12:30:00 2011 +0100
Related: #i46388# busted ole2 wrapper
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 495748a..79590bf 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -798,7 +798,7 @@ void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty )
if( Pos2Page( Pos ) )
{
StgPage* pPg = rIo.Get( nPage, bForce );
- if( pPg )
+ if (pPg && nOffset < pPg->GetSize())
{
pPg->SetOwner( pEntry );
if( bDirty )
commit 30d4566c9685c091d08867adeb147a1cb2070c9e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 29 10:24:43 2011 +0100
Related: fdo#38704 make simpleMapNativeRoleFrom::accessibleContext safer
(cherry picked from commit 5efca1417e430a0f1ba169638955d3b5cf921dde)
diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm
index b8ebdb0..55161bd 100644
--- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm
+++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm
@@ -40,6 +40,10 @@ using namespace ::com::sun::star::uno;
+(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext {
id nativeRole = nil;
+
+ if (accessibleContext == NULL)
+ return nativeRole;
+
switch( accessibleContext -> getAccessibleRole() ) {
#define MAP(a,b) \
case a: nativeRole = b; break
commit c9eaa03dac70bde19f17381dc1d993379b8c34cc
Author: Radek Doulik <rodo at novell.com>
Date: Mon Jun 27 17:34:15 2011 +0200
do not set minimal size for fullscreen windows
- otherwise they cannot shrink when downsizing resolution of the screen
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 9f7d347..5987a81 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1405,7 +1405,7 @@ void GtkSalFrame::setMinMaxSize()
int aHints = 0;
if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE )
{
- if( m_aMinSize.Width() && m_aMinSize.Height() )
+ if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen )
{
aGeo.min_width = m_aMinSize.Width()+CONTAINER_ADJUSTMENT;
aGeo.min_height = m_aMinSize.Height()+CONTAINER_ADJUSTMENT;
@@ -1420,11 +1420,12 @@ void GtkSalFrame::setMinMaxSize()
}
else
{
- aGeo.min_width = maGeometry.nWidth;
- aGeo.min_height = maGeometry.nHeight;
- aHints |= GDK_HINT_MIN_SIZE;
if( ! m_bFullscreen )
{
+ aGeo.min_width = maGeometry.nWidth;
+ aGeo.min_height = maGeometry.nHeight;
+ aHints |= GDK_HINT_MIN_SIZE;
+
aGeo.max_width = maGeometry.nWidth;
aGeo.max_height = maGeometry.nHeight;
aHints |= GDK_HINT_MAX_SIZE;
commit 7cd035c10c000565361594119318eab1e5d9f6c1
Author: Radek Doulik <rodo at novell.com>
Date: Thu Jun 23 13:35:01 2011 +0200
make sure we send resize event to fullscreen windows
- this fixes regression of i#86302 fix. it happens when screen is resized
(by xrandr for example) and the fullscreen windows are not notified
about their size change, because they don't have sizeable style set
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index f8f5d61..9f7d347 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3001,7 +3001,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
* - which is not good since the window manager will now size the window back to this
* wrong size at some point.
*/
- if( (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE )
+ if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE )
{
if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight )
{
commit 8837e1b9668410f9de3ad55e8bc5cf369ea9d94c
Author: Radek Doulik <rodo at novell.com>
Date: Wed Jun 22 15:42:50 2011 +0200
fix condition for compositing surface refresh
- fixes problems on slideshow window shrinking
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index ff0118f..730f7a1 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -524,8 +524,8 @@ namespace cairocanvas
::cairo::SurfaceSharedPtr SpriteCanvasHelper::getCompositingSurface( const ::basegfx::B2ISize& rNeededSize )
{
- if( rNeededSize.getX() < maCompositingSurfaceSize.getX() ||
- rNeededSize.getY() < maCompositingSurfaceSize.getY() )
+ if( rNeededSize.getX() > maCompositingSurfaceSize.getX() ||
+ rNeededSize.getY() > maCompositingSurfaceSize.getY() )
{
// need to give buffer more size
mpCompositingSurface.reset();
commit 5263052d3261c4fff45120d568c947e30987d6df
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 23 09:02:47 2011 +0100
Resolves: fdo#33509 Context menu in spellcheck in RTL UI closes too early
(cherry picked from commit 485b6dc95fe783ef3bb9bbe1ae2f65fe04edc926)
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 46944f1..3c92b11 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -696,13 +696,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
// so they can be compared across different frames
// !!! rRect is expected to be in screen coordinates of the parent frame window !!!
maFloatRect = rRect;
- if( GetParent()->ImplHasMirroredGraphics() )
+
+ Window *pReference = GetParent();
+
+ // compare coordinates in absolute screen coordinates
+ // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509
+ if( pReference->ImplHasMirroredGraphics() )
{
- maFloatRect.SetPos( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) );
- maFloatRect = GetParent()->ImplOutputToUnmirroredAbsoluteScreenPixel( maFloatRect );
+ if(!pReference->IsRTLEnabled() )
+ // --- RTL --- re-mirror back to get device coordiantes
+ pReference->ImplReMirror(maFloatRect);
+
+ maFloatRect.SetPos(pReference->ScreenToOutputPixel(maFloatRect.TopLeft()));
+ maFloatRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel(maFloatRect);
}
else
- maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) );
+ maFloatRect.SetPos(pReference->OutputToAbsoluteScreenPixel(pReference->ScreenToOutputPixel(rRect.TopLeft())));
maFloatRect.Left() -= 2;
maFloatRect.Top() -= 2;
More information about the Libreoffice-commits
mailing list