[Libreoffice-commits] .: 22 commits - unotools/source vcl/source vcl/unx
Jan Holesovsky
kendy at kemper.freedesktop.org
Mon Dec 20 04:21:18 PST 2010
unotools/source/config/configmgr.cxx | 2 ++
unotools/source/config/makefile.mk | 3 +++
vcl/source/control/tabctrl.cxx | 19 ++++++++++++-------
vcl/source/gdi/metaact.cxx | 6 ++++++
vcl/source/gdi/pdfwriter_impl.cxx | 8 +++++++-
vcl/unx/kde4/KDEXLib.cxx | 3 +++
6 files changed, 33 insertions(+), 8 deletions(-)
New commits:
commit 31da335f4950a875fb9ca5025c5cfd3c0e8449bd
Merge: 3b7d749... 3889e55...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Mon Dec 20 13:15:07 2010 +0100
Merge branch 'master' of ssh://git.freedesktop.org/git/libreoffice/libs-gui
commit 3b7d7496a524aeaf9e55545af5bb06de45f2ab5c
Merge: b9a3972... 5e8df51...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Mon Dec 20 01:40:33 2010 +0100
Merge commit 'libreoffice-3.3.0.2'
Conflicts:
unotools/source/config/configmgr.cxx
vcl/source/gdi/pdfwriter_impl.cxx
diff --cc unotools/source/config/configmgr.cxx
index aee6b0e,7b57234..bd77f58
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@@ -373,10 -402,12 +373,12 @@@ Any ConfigManager::GetDirectConfigPrope
Any aRet;
::rtl::OUString sBrandName;
+ #ifdef ENABLE_BROFFICE
LanguageType nType = MsLangId::getSystemUILanguage();
if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN )
- sBrandName = OUString::createFromAscii("BrOffice");
+ sBrandName = OUString(RTL_CONSTASCII_USTRINGPARAM("BrOffice"));
else
+ #endif
sBrandName = BrandName::get();
if ( eProp == PRODUCTNAME && sBrandName.getLength() )
diff --cc vcl/source/gdi/pdfwriter_impl.cxx
index 27b8b38,2285fed..b3cfd7a
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@@ -4622,15 -4608,14 +4622,16 @@@ we check in the following sequence
}
else
{
- sal_Int32 nSetRelative = 0;
+ bool bSetRelative = false;
+ bool bFileSpec = false;
//check if relative file link is requested and if the protocol is 'file://'
if( m_aContext.RelFsys && eBaseProtocol == eTargetProtocol && eTargetProtocol == INET_PROT_FILE )
- nSetRelative++;
+ bSetRelative = true;
rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is,
+ bool bIsURI=false; //URI: 12.6.4.7, URI Actions, URI must be encoded in 7-bit-ASCII
if( nSetGoToRMode == 0 )
+ {
switch( m_aContext.DefaultLinkAction )
{
default:
@@@ -4648,26 -4634,25 +4650,30 @@@
// and will force the use of URI when the protocol is not file://
if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) ||
eTargetProtocol != INET_PROT_FILE )
+ {
aLine.append( "/URI/URI" );
+ bIsURI=true;
+ }
else
+ {
aLine.append( "/Launch/F" );
+ bFileSpec = true;
+ }
break;
}
+ }
//fragment are encoded in the same way as in the named destination processing
- rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
if( nSetGoToRMode )
- {//add the fragment
+ {
+ //add the fragment
+ rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
aLine.append("/GoToR");
aLine.append("/F");
- appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
+ bFileSpec = true;
+ appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_WITH_CHARSET ) :
- aURLNoMark, rLink.m_nObject, aLine );
+ aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
if( aFragment.getLength() > 0 )
{
aLine.append("/D/");
commit 5e8df51cdd2f6a90b4312d2e5249585a4f9c0da3
Author: Petr Mladek <pmladek at suse.cz>
Date: Sat Dec 18 20:35:16 2010 +0100
Version 3.3.0.2, tag libreoffice-3.3.0.2 (3.3-rc2)
commit 57944ebb711e7ee932891130254247a92c83b254
Merge: 5576727... f7a8cd0...
Author: Noel Power <noel.power at novell.com>
Date: Wed Dec 15 11:04:17 2010 +0000
Merge commit 'ooo/OOO330_m18' into libreoffice-3-3
commit 55767270024c3d9392d72efa847e362f09dd51ce
Author: Rene Engelhard <rene at debian.org>
Date: Tue Dec 14 23:06:57 2010 +0100
remove redundant CFLAGS setting
diff --git a/vcl/unx/source/fontmanager/makefile.mk b/vcl/unx/source/fontmanager/makefile.mk
index df24546..5aa36a9 100644
--- a/vcl/unx/source/fontmanager/makefile.mk
+++ b/vcl/unx/source/fontmanager/makefile.mk
@@ -44,7 +44,6 @@ CDEFS += -DENABLE_FONTCONFIG
CFLAGS+= $(FREETYPE_CFLAGS)
CFLAGS+= $(FONTCONFIG_CFLAGS)
-CFLAGS+=-I$(INCCOM)
# --- Files --------------------------------------------------------
commit d1c608f546c49199a7df1e9dbe4fde0feacb3fdb
Author: Rene Engelhard <rene at debian.org>
Date: Tue Dec 14 22:48:34 2010 +0100
generate afm_hash.cpp in $(INCCOM)
diff --git a/vcl/unx/source/fontmanager/makefile.mk b/vcl/unx/source/fontmanager/makefile.mk
index ff3a8dc..df24546 100644
--- a/vcl/unx/source/fontmanager/makefile.mk
+++ b/vcl/unx/source/fontmanager/makefile.mk
@@ -44,7 +44,7 @@ CDEFS += -DENABLE_FONTCONFIG
CFLAGS+= $(FREETYPE_CFLAGS)
CFLAGS+= $(FONTCONFIG_CFLAGS)
-CFLAGS+=-I$(SOLARVER)$/$(INPATH)$/inc
+CFLAGS+=-I$(INCCOM)
# --- Files --------------------------------------------------------
@@ -72,7 +72,7 @@ NOOPTFILES=$(SLO)$/fontmanager.obj
.INCLUDE : target.mk
-$(SLO)$/parseAFM.obj: $(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp
+$(SLO)$/parseAFM.obj: $(INCCOM)$/afm_hash.cpp
-$(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp: afm_keyword_list
+$(INCCOM)$/afm_hash.cpp: afm_keyword_list
$(GPERF) -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$$' afm_keyword_list | $(SED) -e "s/(char\*)0/(char\*)0, NOPE/g" | $(GREP) -v "^#line" > $@
commit 4b7f081ab7079115050d5329b70c7b965db6ba85
Author: Philipp Lohmann <pl at openoffice.org>
Date: Tue Dec 14 18:11:40 2010 +0100
TabControl::ImplGetTabRect negative height gives BadAlloc
Fix from i#116120
Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index d51dc5e..a8ad1ea 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -443,15 +443,18 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight )
{
Size aWinSize = Control::GetOutputSizePixel();
- if ( nWidth == -1 )
+ if ( nWidth < 0 )
nWidth = aWinSize.Width();
- if ( nHeight == -1 )
+ if ( nHeight < 0 )
nHeight = aWinSize.Height();
if ( mpTabCtrlData->maItemList.empty() )
{
- return Rectangle( Point( TAB_OFFSET, TAB_OFFSET ),
- Size( nWidth-TAB_OFFSET*2, nHeight-TAB_OFFSET*2 ) );
+ long nW = nWidth-TAB_OFFSET*2;
+ long nH = nHeight-TAB_OFFSET*2;
+ return (nW > 0 && nH > 0)
+ ? Rectangle( Point( TAB_OFFSET, TAB_OFFSET ), Size( nW, nH ) )
+ : Rectangle();
}
if ( nItemPos == TAB_PAGERECT )
@@ -463,9 +466,11 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight
nLastPos = 0;
Rectangle aRect = ImplGetTabRect( nLastPos, nWidth, nHeight );
- aRect = Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ),
- Size( nWidth-TAB_OFFSET*2,
- nHeight-aRect.Bottom()-TAB_OFFSET*2 ) );
+ long nW = nWidth-TAB_OFFSET*2;
+ long nH = nHeight-aRect.Bottom()-TAB_OFFSET*2;
+ aRect = (nW > 0 && nH > 0)
+ ? Rectangle( Point( TAB_OFFSET, aRect.Bottom()+TAB_OFFSET ), Size( nW, nH ) )
+ : Rectangle();
return aRect;
}
commit ffe9f282b0374f04ca65e2fc208ffb6d3162f6ed
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Tue Dec 14 16:50:02 2010 +0100
force Qt paint system to native (fdo#30991)
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 12cb886..1084ba2 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -168,6 +168,9 @@ void KDEXLib::Init()
KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
+#if QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 )
+ QApplication::setGraphicsSystem( "native" ); // fdo#30991
+#endif
m_pApplication = new VCLKDEApplication();
kapp->disableSessionManagement();
KApplication::setQuitOnLastWindowClosed(false);
commit 4c1dc14bbbc283846bc3364f584ca34f20fd69cd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 14 09:13:48 2010 +0000
get this to build without errors
diff --git a/vcl/unx/source/fontmanager/afm_keyword_list b/vcl/unx/source/fontmanager/afm_keyword_list
index 263d76b..c9bb134 100755
--- a/vcl/unx/source/fontmanager/afm_keyword_list
+++ b/vcl/unx/source/fontmanager/afm_keyword_list
@@ -1,4 +1,8 @@
-struct hash_entry { char* name; enum parseKey eKey; };
+%language=C++
+%global-table
+%null-strings
+%struct-type
+struct hash_entry { const char* name; enum parseKey eKey; };
%%
Ascender,ASCENDER
Ascent,ASCENT
diff --git a/vcl/unx/source/fontmanager/makefile.mk b/vcl/unx/source/fontmanager/makefile.mk
index 1f01c6e..ff3a8dc 100644
--- a/vcl/unx/source/fontmanager/makefile.mk
+++ b/vcl/unx/source/fontmanager/makefile.mk
@@ -75,4 +75,4 @@ NOOPTFILES=$(SLO)$/fontmanager.obj
$(SLO)$/parseAFM.obj: $(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp
$(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp: afm_keyword_list
- $(GPERF) -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$$' afm_keyword_list > $@
+ $(GPERF) -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$$' afm_keyword_list | $(SED) -e "s/(char\*)0/(char\*)0, NOPE/g" | $(GREP) -v "^#line" > $@
commit b1ba1e1fc665c199a8f5a6ab79c1f51ef3744f4d
Author: Rene Engelhard <rene at debian.org>
Date: Mon Dec 13 20:47:01 2010 +0100
generate afm_hash.cpp in solver, not in the source tree
diff --git a/vcl/unx/source/fontmanager/afm_hash.cpp b/vcl/unx/source/fontmanager/afm_hash.cpp
deleted file mode 100644
index a59f79c..0000000
--- a/vcl/unx/source/fontmanager/afm_hash.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* C++ code produced by gperf version 3.0.1 */
-/* Command-line: gperf -C -t -l -L C++ -m 20 -Z AfmKeywordHash afm_keyword_list */
-/* Computed positions: -k'1,4,6,$' */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
- && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
- && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
- && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
- && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
- && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
- && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
- && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
- && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
- && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
- && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
- && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
- && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
- && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
- && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
- && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
- && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
- && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
- && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
- && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
- && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
- && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
- && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646. */
-#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf at gnu.org>."
-#endif
-
-#line 1 "afm_keyword_list"
-struct hash_entry { const char* name; enum parseKey eKey; };
-
-#define TOTAL_KEYWORDS 56
-#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 18
-#define MIN_HASH_VALUE 1
-#define MAX_HASH_VALUE 57
-/* maximum key range = 57, duplicates = 0 */
-
-class AfmKeywordHash
-{
-private:
- static inline unsigned int hash (const char *str, unsigned int len);
-public:
- static const struct hash_entry *in_word_set (const char *str, unsigned int len);
-};
-
-inline unsigned int
-AfmKeywordHash::hash (register const char *str, register unsigned int len)
-{
- static const unsigned char asso_values[] =
- {
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 28, 1, 0, 9, 0,
- 19, 58, 2, 10, 58, 0, 28, 0, 20, 58,
- 44, 58, 58, 0, 16, 10, 24, 2, 3, 58,
- 58, 58, 58, 58, 58, 58, 58, 6, 58, 0,
- 19, 0, 58, 25, 14, 6, 58, 58, 17, 11,
- 0, 17, 39, 58, 0, 0, 10, 58, 58, 58,
- 13, 4, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58
- };
- register int hval = len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[5]];
- /*FALLTHROUGH*/
- case 5:
- case 4:
- hval += asso_values[(unsigned char)str[3]];
- /*FALLTHROUGH*/
- case 3:
- case 2:
- case 1:
- hval += asso_values[(unsigned char)str[0]];
- break;
- }
- return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-const struct hash_entry *
-AfmKeywordHash::in_word_set (register const char *str, register unsigned int len)
-{
- static const unsigned char lengthtable[] =
- {
- 0, 1, 2, 1, 2, 1, 3, 2, 3, 5, 10, 11, 12, 2,
- 14, 15, 16, 11, 9, 13, 14, 12, 12, 14, 13, 9, 7, 9,
- 7, 9, 14, 5, 6, 14, 12, 16, 10, 14, 11, 10, 7, 1,
- 12, 8, 17, 18, 2, 3, 7, 1, 8, 8, 13, 6, 6, 8,
- 0, 1
- };
- static const struct hash_entry wordlist[] =
- {
- {"",NOPE},
-#line 6 "afm_keyword_list"
- {"C",CODE},
-#line 7 "afm_keyword_list"
- {"CC",COMPCHAR},
-#line 5 "afm_keyword_list"
- {"B",CHARBBOX},
-#line 8 "afm_keyword_list"
- {"CH",CODEHEX},
-#line 54 "afm_keyword_list"
- {"W",XYWIDTH},
-#line 33 "afm_keyword_list"
- {"KPX",KERNPAIRXAMT},
-#line 56 "afm_keyword_list"
- {"WX",XWIDTH},
-#line 55 "afm_keyword_list"
- {"W0X",X0WIDTH},
-#line 47 "afm_keyword_list"
- {"StdHW",STDHW},
-#line 12 "afm_keyword_list"
- {"Characters",CHARACTERS},
-#line 36 "afm_keyword_list"
- {"MetricsSets",METRICSSETS},
-#line 23 "afm_keyword_list"
- {"EndKernPairs",ENDKERNPAIRS},
-#line 16 "afm_keyword_list"
- {"Em",EM},
-#line 45 "afm_keyword_list"
- {"StartKernPairs",STARTKERNPAIRS},
-#line 41 "afm_keyword_list"
- {"StartComposites",STARTCOMPOSITES},
-#line 40 "afm_keyword_list"
- {"StartCharMetrics",STARTCHARMETRICS},
-#line 22 "afm_keyword_list"
- {"EndKernData",ENDKERNDATA},
-#line 14 "afm_keyword_list"
- {"Descender",DESCENDER},
-#line 44 "afm_keyword_list"
- {"StartKernData",STARTKERNDATA},
-#line 18 "afm_keyword_list"
- {"EndCharMetrics",ENDCHARMETRICS},
-#line 20 "afm_keyword_list"
- {"EndDirection",ENDDIRECTION},
-#line 11 "afm_keyword_list"
- {"CharacterSet",CHARACTERSET},
-#line 42 "afm_keyword_list"
- {"StartDirection",STARTDIRECTION},
-#line 19 "afm_keyword_list"
- {"EndComposites",ENDCOMPOSITES},
-#line 49 "afm_keyword_list"
- {"TrackKern",TRACKKERN},
-#line 15 "afm_keyword_list"
- {"Descent",DESCENT},
-#line 9 "afm_keyword_list"
- {"CapHeight",CAPHEIGHT},
-#line 13 "afm_keyword_list"
- {"Comment",COMMENT},
-#line 10 "afm_keyword_list"
- {"CharWidth",CHARWIDTH},
-#line 46 "afm_keyword_list"
- {"StartTrackKern",STARTTRACKKERN},
-#line 48 "afm_keyword_list"
- {"StdVW",STDVW},
-#line 38 "afm_keyword_list"
- {"Notice",NOTICE},
-#line 21 "afm_keyword_list"
- {"EndFontMetrics",ENDFONTMETRICS},
-#line 24 "afm_keyword_list"
- {"EndTrackKern",ENDTRACKKERN},
-#line 43 "afm_keyword_list"
- {"StartFontMetrics",STARTFONTMETRICS},
-#line 29 "afm_keyword_list"
- {"IsBaseFont",ISBASEFONT},
-#line 17 "afm_keyword_list"
- {"EncodingScheme",ENCODINGSCHEME},
-#line 31 "afm_keyword_list"
- {"ItalicAngle",ITALICANGLE},
-#line 25 "afm_keyword_list"
- {"FamilyName",FAMILYNAME},
-#line 58 "afm_keyword_list"
- {"XHeight",XHEIGHT},
-#line 37 "afm_keyword_list"
- {"N",CHARNAME},
-#line 30 "afm_keyword_list"
- {"IsFixedPitch",ISFIXEDPITCH},
-#line 27 "afm_keyword_list"
- {"FontName",FONTNAME},
-#line 50 "afm_keyword_list"
- {"UnderlinePosition",UNDERLINEPOSITION},
-#line 51 "afm_keyword_list"
- {"UnderlineThickness",UNDERLINETHICKNESS},
-#line 32 "afm_keyword_list"
- {"KP",KERNPAIR},
-#line 39 "afm_keyword_list"
- {"PCC",COMPCHARPIECE},
-#line 53 "afm_keyword_list"
- {"Version",VERSION},
-#line 52 "afm_keyword_list"
- {"V",VVECTOR},
-#line 28 "afm_keyword_list"
- {"FullName",FULLNAME},
-#line 26 "afm_keyword_list"
- {"FontBBox",FONTBBOX},
-#line 35 "afm_keyword_list"
- {"MappingScheme",MAPPINGSCHEME},
-#line 57 "afm_keyword_list"
- {"Weight",WEIGHT},
-#line 4 "afm_keyword_list"
- {"Ascent",ASCENT},
-#line 3 "afm_keyword_list"
- {"Ascender",ASCENDER},
- {"",NOPE},
-#line 34 "afm_keyword_list"
- {"L",LIGATURE}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- if (len == lengthtable[key])
- {
- register const char *s = wordlist[key].name;
-
- if (*str == *s && !memcmp (str + 1, s + 1, len - 1))
- return &wordlist[key];
- }
- }
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/source/fontmanager/makefile.mk b/vcl/unx/source/fontmanager/makefile.mk
index c6a23b8..1f01c6e 100644
--- a/vcl/unx/source/fontmanager/makefile.mk
+++ b/vcl/unx/source/fontmanager/makefile.mk
@@ -42,8 +42,9 @@ INCDEPN+= -I..$/fontsubset
CDEFS += -DENABLE_FONTCONFIG
.ENDIF
-CFLAGS+=$(FREETYPE_CFLAGS)
-
+CFLAGS+= $(FREETYPE_CFLAGS)
+CFLAGS+= $(FONTCONFIG_CFLAGS)
+CFLAGS+=-I$(SOLARVER)$/$(INPATH)$/inc
# --- Files --------------------------------------------------------
@@ -70,3 +71,8 @@ NOOPTFILES=$(SLO)$/fontmanager.obj
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+$(SLO)$/parseAFM.obj: $(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp
+
+$(SOLARVER)$/$(INPATH)$/inc$/afm_hash.cpp: afm_keyword_list
+ $(GPERF) -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$$' afm_keyword_list > $@
commit 5f2659d8f013078de247c68cca6ee0eb448c12d5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Dec 12 14:08:56 2010 +0000
Resolves: fdo#32236# #i115825# Regression in wmf text rendering
Regression in rendering chunks out of multipart text lines
(cherry picked from commit c512e7f3bc299f57dc2500c21e0f81f5a2072e80)
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 0968bde..fd95f70 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1442,7 +1442,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
rIStm >> mnLen;
rIStm >> nAryLen;
- if ( mnIndex > mnLen )
+ if ( mnIndex + mnLen > maStr.Len() )
{
mnIndex = 0;
mpDXAry = 0;
commit f7a8cd0c613ff85a3436ccfec18755c38eeeb196
Merge: 6b4f105... dc6983f...
Author: obo <obo at openoffice.org>
Date: Thu Dec 9 10:48:50 2010 +0100
CWS-TOOLING: integrate CWS impress205
commit a59b2654ea02b058a6ab60e30be517713d8758e1
Author: Petr Mladek <pmladek at suse.cz>
Date: Fri Dec 3 16:10:23 2010 +0100
use BrOffice name only with --enable-broffice (fdo#31770)
reviewed by Michael Meeks <mmeeks at novell.com>
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 763871c..7b57234 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -402,10 +402,12 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
Any aRet;
::rtl::OUString sBrandName;
+#ifdef ENABLE_BROFFICE
LanguageType nType = MsLangId::getSystemUILanguage();
if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN )
sBrandName = OUString::createFromAscii("BrOffice");
else
+#endif
sBrandName = BrandName::get();
if ( eProp == PRODUCTNAME && sBrandName.getLength() )
diff --git a/unotools/source/config/makefile.mk b/unotools/source/config/makefile.mk
index 27e8f67..9a8e8d2 100644
--- a/unotools/source/config/makefile.mk
+++ b/unotools/source/config/makefile.mk
@@ -37,6 +37,9 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
+.IF "$(ENABLE_BROFFICE)"=="TRUE"
+CDEFS+=-DENABLE_BROFFICE
+.ENDIF
# --- Files -------------------------------------
commit f3dd48059efe1321c58718b4d7a220b94fbc4a2e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 3 11:06:13 2010 +0000
Related: fdo#31243 remove shadowed variable names
(cherry picked from commit 4a95223e49e5967472ff6ee68659c4ff87298e4d)
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 934bb91..d8de6c5 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -417,14 +417,14 @@ namespace cairocanvas
typedef std::pair<SystemFontData,int> FontLevel;
typedef std::vector<FontLevel> FontLevelVector;
FontLevelVector aFontData;
- SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
- const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
- for( ; aIter != aEnd; ++aIter )
+ SystemGlyphDataVector::const_iterator aGlyphIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aGlyphEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter )
{
- if( aFontData.empty() || aIter->fallbacklevel != aFontData.back().second )
+ if( aFontData.empty() || aGlyphIter->fallbacklevel != aFontData.back().second )
{
- aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aIter->fallbacklevel),
- aIter->fallbacklevel));
+ aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aGlyphIter->fallbacklevel),
+ aGlyphIter->fallbacklevel));
if( !isCairoRenderable(aFontData.back().first) )
{
bCairoRenderable = false;
@@ -477,11 +477,10 @@ namespace cairocanvas
std::vector<cairo_glyph_t> cairo_glyphs;
cairo_glyphs.reserve( 256 );
- SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
- const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
- for( ; aIter != aEnd; ++aIter )
+ aGlyphIter=aSysLayoutData.rGlyphData.begin();
+ for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter )
{
- SystemGlyphData systemGlyph = *aIter;
+ SystemGlyphData systemGlyph = *aGlyphIter;
if( systemGlyph.fallbacklevel != aFontDataIter->second )
continue;
commit 1fada0bf264d7c5e37087c31bbfe11955ed5b782
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 3 11:00:01 2010 +0000
Resolves: fdo#31243 glyph fallback for cairo-canvas
(cherry picked from commit cbd99e3bdd8a2bb887fb3eeb1e8d0a90f7576234)
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index d8b8126..934bb91 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -106,6 +106,11 @@ namespace cairocanvas
// as required at the API spec
rOutDev.SetLayoutMode( nLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
}
+
+ bool compareFallbacks(const SystemGlyphData&rA, const SystemGlyphData &rB)
+ {
+ return rA.fallbacklevel < rB.fallbacklevel;
+ }
}
TextLayout::TextLayout( const rendering::StringContext& aText,
@@ -364,7 +369,6 @@ namespace cairocanvas
return true;
}
-
/**
* TextLayout::draw
*
@@ -405,18 +409,41 @@ namespace cairocanvas
::canvas::tools::numeric_cast<USHORT>(maText.Length),
maLogicalAdvancements.getLength() ? aOffsets.get() : NULL);
+ // Sort them so that all glyphs on the same glyph fallback level are consecutive
+ std::sort(aSysLayoutData.rGlyphData.begin(), aSysLayoutData.rGlyphData.end(), compareFallbacks);
+ bool bCairoRenderable = true;
+
+ //Pull all the fonts we need to render the text
+ typedef std::pair<SystemFontData,int> FontLevel;
+ typedef std::vector<FontLevel> FontLevelVector;
+ FontLevelVector aFontData;
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
+ {
+ if( aFontData.empty() || aIter->fallbacklevel != aFontData.back().second )
+ {
+ aFontData.push_back(FontLevel(rOutDev.GetSysFontData(aIter->fallbacklevel),
+ aIter->fallbacklevel));
+ if( !isCairoRenderable(aFontData.back().first) )
+ {
+ bCairoRenderable = false;
+ OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK %s%s%s%s - %s",
+ maLogicalAdvancements.getLength() ? "ADV " : "",
+ aFontData.back().first.bAntialias ? "AA " : "",
+ aFontData.back().first.bFakeBold ? "FB " : "",
+ aFontData.back().first.bFakeItalic ? "FI " : "",
+ ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
+ RTL_TEXTENCODING_UTF8 ).getStr());
+ break;
+ }
+ }
+ }
+
// The ::GetSysTextLayoutData(), i.e. layouting of text to glyphs can change the font being used.
// The fallback checks need to be done after final font is known.
- if (!isCairoRenderable(aSysLayoutData.aSysFontData)) // VCL FALLBACKS
+ if (!bCairoRenderable) // VCL FALLBACKS
{
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK %s%s%s%s - %s",
- maLogicalAdvancements.getLength() ? "ADV " : "",
- aSysLayoutData.aSysFontData.bAntialias ? "AA " : "",
- aSysLayoutData.aSysFontData.bFakeBold ? "FB " : "",
- aSysLayoutData.aSysFontData.bFakeItalic ? "FI " : "",
- ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
- RTL_TEXTENCODING_UTF8 ).getStr());
-
if (maLogicalAdvancements.getLength()) // VCL FALLBACK - with glyph advances
{
rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets.get(),
@@ -438,145 +465,159 @@ namespace cairocanvas
/**
* Setup platform independent glyph vector into cairo-based glyphs vector.
**/
-
- // setup glyphs
- std::vector<cairo_glyph_t> cairo_glyphs;
- cairo_glyphs.reserve( 256 );
-
- for( int nStart = 0; nStart < (int) aSysLayoutData.rGlyphData.size(); nStart++ )
+
+ // Loop through the fonts used and render the matching glyphs for each
+ FontLevelVector::const_iterator aFontDataIter = aFontData.begin();
+ const FontLevelVector::const_iterator aFontDataEnd = aFontData.end();
+ for( ; aFontDataIter != aFontDataEnd; ++aFontDataIter )
{
- cairo_glyph_t aGlyph;
- SystemGlyphData systemGlyph = aSysLayoutData.rGlyphData.at(nStart);
- aGlyph.index = systemGlyph.index;
-#ifdef CAIRO_HAS_WIN32_SURFACE
- // Cairo requires standard glyph indexes (ETO_GLYPH_INDEX), while vcl/win/* uses ucs4 chars.
- // Convert to standard indexes
- aGlyph.index = cairo::ucs4toindex((unsigned int) aGlyph.index, aSysLayoutData.aSysFontData.hFont);
-#endif
- aGlyph.x = systemGlyph.x;
- aGlyph.y = systemGlyph.y;
- cairo_glyphs.push_back(aGlyph);
- }
+ const SystemFontData &rSysFontData = aFontDataIter->first;
- if (cairo_glyphs.empty()) return true; //true or false??
-
- /**
- * Setup font
- **/
- cairo_font_face_t* font_face = NULL;
+ // setup glyphs
+ std::vector<cairo_glyph_t> cairo_glyphs;
+ cairo_glyphs.reserve( 256 );
-#ifdef CAIRO_HAS_QUARTZ_SURFACE
- // TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont)
- // when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend.
- font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) aSysLayoutData.aSysFontData.aATSUFontID);
-
-#elif defined CAIRO_HAS_WIN32_SURFACE
- #if (OSL_DEBUG_LEVEL > 1)
- GetObjectW( aSysLayoutData.aSysFontData.hFont, sizeof(logfont), &logfont );
- #endif
- // Note: cairo library uses logfont fallbacks when lfEscapement, lfOrientation and lfWidth are not zero.
- // VCL always has non-zero value for lfWidth
- font_face = cairo_win32_font_face_create_for_hfont(aSysLayoutData.aSysFontData.hFont);
-
-#elif defined CAIRO_HAS_XLIB_SURFACE
- font_face = cairo_ft_font_face_create_for_ft_face((FT_Face)aSysLayoutData.aSysFontData.nFontId,
- aSysLayoutData.aSysFontData.nFontFlags);
-#else
-# error Native API needed.
-#endif
+ SystemGlyphDataVector::const_iterator aIter=aSysLayoutData.rGlyphData.begin();
+ const SystemGlyphDataVector::const_iterator aEnd=aSysLayoutData.rGlyphData.end();
+ for( ; aIter != aEnd; ++aIter )
+ {
+ SystemGlyphData systemGlyph = *aIter;
+ if( systemGlyph.fallbacklevel != aFontDataIter->second )
+ continue;
+
+ cairo_glyph_t aGlyph;
+ aGlyph.index = systemGlyph.index;
+ #ifdef CAIRO_HAS_WIN32_SURFACE
+ // Cairo requires standard glyph indexes (ETO_GLYPH_INDEX), while vcl/win/* uses ucs4 chars.
+ // Convert to standard indexes
+ aGlyph.index = cairo::ucs4toindex((unsigned int) aGlyph.index, rSysFontData.hFont);
+ #endif
+ aGlyph.x = systemGlyph.x;
+ aGlyph.y = systemGlyph.y;
+ cairo_glyphs.push_back(aGlyph);
+ }
- CairoSharedPtr pSCairo = pSurface->getCairo();
-
- cairo_set_font_face( pSCairo.get(), font_face);
-
- // create default font options. cairo_get_font_options() does not retrieve the surface defaults,
- // only what has been set before with cairo_set_font_options()
- cairo_font_options_t* options = cairo_font_options_create();
- if (aSysLayoutData.aSysFontData.bAntialias) {
- // CAIRO_ANTIALIAS_GRAY provides more similar result to VCL Canvas,
- // so we're not using CAIRO_ANTIALIAS_SUBPIXEL
- cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
- }
- cairo_set_font_options( pSCairo.get(), options);
-
- // Font color
- Color mTextColor = rOutDev.GetTextColor();
- cairo_set_source_rgb(pSCairo.get(),
- mTextColor.GetRed()/255.0,
- mTextColor.GetGreen()/255.0,
- mTextColor.GetBlue()/255.0);
-
- // Font rotation and scaling
- cairo_matrix_t m;
- Font aFont = rOutDev.GetFont();
- FontMetric aMetric( rOutDev.GetFontMetric(aFont) );
- long nWidth = 0;
-
- // width calculation is deep magic and platform/font dependant.
- // width == 0 means no scaling, and usually width == height means the same.
- // Other values mean horizontal scaling (narrow or stretching)
- // see issue #101566
-
- //proper scale calculation across platforms
- if (aFont.GetWidth() == 0) {
- nWidth = aFont.GetHeight();
- } else {
- // any scaling needs to be relative to the platform-dependent definition
- // of height of the font
- nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
- }
-
- cairo_matrix_init_identity(&m);
-
- if (aSysLayoutData.orientation) cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
-
- cairo_matrix_scale(&m, nWidth, aFont.GetHeight());
+ if (cairo_glyphs.empty())
+ continue;
+
+ /**
+ * Setup font
+ **/
+ cairo_font_face_t* font_face = NULL;
+
+ #ifdef CAIRO_HAS_QUARTZ_SURFACE
+ // TODO: use cairo_quartz_font_face_create_for_cgfont(cgFont)
+ // when CGFont (Mac OS X 10.5 API) is provided by the AQUA VCL backend.
+ font_face = cairo_quartz_font_face_create_for_atsu_font_id((ATSUFontID) rSysFontData.aATSUFontID);
+
+ #elif defined CAIRO_HAS_WIN32_SURFACE
+ #if (OSL_DEBUG_LEVEL > 1)
+ GetObjectW( rSysFontData.hFont, sizeof(logfont), &logfont );
+ #endif
+ // Note: cairo library uses logfont fallbacks when lfEscapement, lfOrientation and lfWidth are not zero.
+ // VCL always has non-zero value for lfWidth
+ font_face = cairo_win32_font_face_create_for_hfont(rSysFontData.hFont);
+
+ #elif defined CAIRO_HAS_XLIB_SURFACE
+ font_face = cairo_ft_font_face_create_for_ft_face((FT_Face)rSysFontData.nFontId,
+ rSysFontData.nFontFlags);
+ #else
+ # error Native API needed.
+ #endif
+
+ CairoSharedPtr pSCairo = pSurface->getCairo();
+
+ cairo_set_font_face( pSCairo.get(), font_face);
+
+ // create default font options. cairo_get_font_options() does not retrieve the surface defaults,
+ // only what has been set before with cairo_set_font_options()
+ cairo_font_options_t* options = cairo_font_options_create();
+ if (rSysFontData.bAntialias) {
+ // CAIRO_ANTIALIAS_GRAY provides more similar result to VCL Canvas,
+ // so we're not using CAIRO_ANTIALIAS_SUBPIXEL
+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY);
+ }
+ cairo_set_font_options( pSCairo.get(), options);
+
+ // Font color
+ Color mTextColor = rOutDev.GetTextColor();
+ cairo_set_source_rgb(pSCairo.get(),
+ mTextColor.GetRed()/255.0,
+ mTextColor.GetGreen()/255.0,
+ mTextColor.GetBlue()/255.0);
+
+ // Font rotation and scaling
+ cairo_matrix_t m;
+ Font aFont = rOutDev.GetFont();
+ FontMetric aMetric( rOutDev.GetFontMetric(aFont) );
+ long nWidth = 0;
+
+ // width calculation is deep magic and platform/font dependant.
+ // width == 0 means no scaling, and usually width == height means the same.
+ // Other values mean horizontal scaling (narrow or stretching)
+ // see issue #101566
+
+ //proper scale calculation across platforms
+ if (aFont.GetWidth() == 0) {
+ nWidth = aFont.GetHeight();
+ } else {
+ // any scaling needs to be relative to the platform-dependent definition
+ // of height of the font
+ nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
+ }
- //faux italics
- if (aSysLayoutData.aSysFontData.bFakeItalic) m.xy = -m.xx * 0x6000L / 0x10000L;
-
- cairo_set_font_matrix(pSCairo.get(), &m);
-
- OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), W:%d->%d, Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
- aFont.GetWidth(),
- aFont.GetHeight(),
- aMetric.GetWidth(),
- nWidth,
- (int) rOutpos.X(),
- (int) rOutpos.Y(),
- cairo_glyphs[0].index, cairo_glyphs[1].index, cairo_glyphs[2].index,
- maLogicalAdvancements.getLength() ? "ADV " : "",
- aSysLayoutData.aSysFontData.bAntialias ? "AA " : "",
- aSysLayoutData.aSysFontData.bFakeBold ? "FB " : "",
- aSysLayoutData.aSysFontData.bFakeItalic ? "FI " : "",
-#if (defined CAIRO_HAS_WIN32_SURFACE) && (OSL_DEBUG_LEVEL > 1)
- ::rtl::OUStringToOString( reinterpret_cast<const sal_Unicode*> (logfont.lfFaceName), RTL_TEXTENCODING_UTF8 ).getStr(),
-#else
- ::rtl::OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
-#endif
- ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
- RTL_TEXTENCODING_UTF8 ).getStr()
- );
-
- cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
-
- //faux bold
- if (aSysLayoutData.aSysFontData.bFakeBold) {
- double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
- int total_steps = 2 * ((int) (bold_dx + 0.5));
+ cairo_matrix_init_identity(&m);
+
+ if (aSysLayoutData.orientation) cairo_matrix_rotate(&m, (3600 - aSysLayoutData.orientation) * M_PI / 1800.0);
+
+ cairo_matrix_scale(&m, nWidth, aFont.GetHeight());
+
+ //faux italics
+ if (rSysFontData.bFakeItalic) m.xy = -m.xx * 0x6000L / 0x10000L;
+
+ cairo_set_font_matrix(pSCairo.get(), &m);
+
+ OSL_TRACE("\r\n:cairocanvas::TextLayout::draw(S,O,p,v,r): Size:(%d,%d), W:%d->%d, Pos (%d,%d), G(%d,%d,%d) %s%s%s%s || Name:%s - %s",
+ aFont.GetWidth(),
+ aFont.GetHeight(),
+ aMetric.GetWidth(),
+ nWidth,
+ (int) rOutpos.X(),
+ (int) rOutpos.Y(),
+ cairo_glyphs[0].index, cairo_glyphs[1].index, cairo_glyphs[2].index,
+ maLogicalAdvancements.getLength() ? "ADV " : "",
+ rSysFontData.bAntialias ? "AA " : "",
+ rSysFontData.bFakeBold ? "FB " : "",
+ rSysFontData.bFakeItalic ? "FI " : "",
+ #if (defined CAIRO_HAS_WIN32_SURFACE) && (OSL_DEBUG_LEVEL > 1)
+ ::rtl::OUStringToOString( reinterpret_cast<const sal_Unicode*> (logfont.lfFaceName), RTL_TEXTENCODING_UTF8 ).getStr(),
+ #else
+ ::rtl::OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
+ #endif
+ ::rtl::OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
+ RTL_TEXTENCODING_UTF8 ).getStr()
+ );
+
+ cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
- // loop to draw the text for every half pixel of displacement
- for (int nSteps = 0; nSteps < total_steps; nSteps++) {
- for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++) {
- cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+ //faux bold
+ if (rSysFontData.bFakeBold) {
+ double bold_dx = 0.5 * sqrt( 0.7 * aFont.GetHeight() );
+ int total_steps = 2 * ((int) (bold_dx + 0.5));
+
+ // loop to draw the text for every half pixel of displacement
+ for (int nSteps = 0; nSteps < total_steps; nSteps++) {
+ for(int nGlyphIdx = 0; nGlyphIdx < (int) cairo_glyphs.size(); nGlyphIdx++) {
+ cairo_glyphs[nGlyphIdx].x += bold_dx * nSteps / total_steps;
+ }
+ cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
}
- cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
+ OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
}
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
+
+ cairo_restore( pSCairo.get() );
+ cairo_font_face_destroy(font_face);
}
-
- cairo_restore( pSCairo.get() );
- cairo_font_face_destroy(font_face);
return true;
}
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index 018872b..1a8f56d 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -151,6 +151,7 @@ struct SystemGlyphData
unsigned long index;
double x;
double y;
+ int fallbacklevel;
};
@@ -179,12 +180,12 @@ struct SystemFontData
// - SystemTextLayoutData -
// --------------------
+typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
struct SystemTextLayoutData
{
- unsigned long nSize; // size in bytes of this structure
- std::vector<SystemGlyphData> rGlyphData; // glyph data
- int orientation; // Text orientation
- SystemFontData aSysFontData; // Font data for the text layout
+ unsigned long nSize; // size in bytes of this structure
+ SystemGlyphDataVector rGlyphData; // glyph data
+ int orientation; // Text orientation
};
#endif // _SV_SYSDATA_HXX
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index b898258..96bfab5 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7339,7 +7339,6 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
// setup glyphs
Point aPos;
sal_GlyphId aGlyphId;
- int nFallbacklevel = 0;
for( int nStart = 0; rLayout->GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
{
// NOTE: Windows backend is producing unicode chars (ucs4), so on windows,
@@ -7349,15 +7348,12 @@ SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, c
aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK);
aGlyph.x = aPos.X();
aGlyph.y = aPos.Y();
- aSysLayoutData.rGlyphData.push_back(aGlyph);
-
int nLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
- if (nLevel > nFallbacklevel && nLevel < MAX_FALLBACK)
- nFallbacklevel = nLevel;
+ aGlyph.fallbacklevel = nLevel < MAX_FALLBACK ? nLevel : 0;
+ aSysLayoutData.rGlyphData.push_back(aGlyph);
}
// Get font data
- aSysLayoutData.aSysFontData = GetSysFontData(nFallbacklevel);
aSysLayoutData.orientation = rLayout->GetOrientation();
rLayout->Release();
commit 9f79f618431af939efbb2cc223d38227dbce692f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 2 11:18:12 2010 +0000
Resolves: #i115788# URIs must be exported as 7bit ASCII
(cherry picked from commit 8b074d17a7e81f075dfe30236dfcd1b0e9f36ad2)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index c4816bc..2285fed 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -4614,6 +4614,7 @@ we check in the following sequence:
nSetRelative++;
rtl::OUString aFragment = aTargetURL.GetMark( INetURLObject::NO_DECODE /*DECODE_WITH_CHARSET*/ ); //fragment as is,
+ bool bIsURI=false; //URI: 12.6.4.7, URI Actions, URI must be encoded in 7-bit-ASCII
if( nSetGoToRMode == 0 )
switch( m_aContext.DefaultLinkAction )
{
@@ -4621,6 +4622,7 @@ we check in the following sequence:
case PDFWriter::URIAction :
case PDFWriter::URIActionDestination :
aLine.append( "/URI/URI" );
+ bIsURI=true;
break;
case PDFWriter::LaunchAction:
// now:
@@ -4632,7 +4634,10 @@ we check in the following sequence:
// and will force the use of URI when the protocol is not file://
if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) ||
eTargetProtocol != INET_PROT_FILE )
+ {
aLine.append( "/URI/URI" );
+ bIsURI=true;
+ }
else
aLine.append( "/Launch/F" );
break;
@@ -4640,7 +4645,8 @@ we check in the following sequence:
//fragment are encoded in the same way as in the named destination processing
rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
if( nSetGoToRMode )
- {//add the fragment
+ {
+ //add the fragment
aLine.append("/GoToR");
aLine.append("/F");
appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURLNoMark,
@@ -4665,13 +4671,23 @@ we check in the following sequence:
//substitute the fragment
aTargetURL.SetMark( aLineLoc.getStr() );
}
- rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
-// check if we have a URL available, if the string is empty, set it as the original one
-// if( aURL.getLength() == 0 )
-// appendLiteralStringEncrypt( rLink.m_aURL , rLink.m_nObject, aLine );
-// else
+ if (bIsURI)
+ {
+ //If we're writing to URI/URI we must e in 7-bit ASCII, so encode anything else as %XX
+ rtl::OUString aURL = aTargetURL.GetMainURL(INetURLObject::NO_DECODE);
+ appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL(m_aContext.BaseURL, aURL) :
+ aURL , rLink.m_nObject, aLine );
+ }
+ else
+ {
+ //TO-DO: Depending on the interpretation of 12.6.4.5 we
+ //may be able to use appendUnicodeTextStringEncrypt
+ //here for the INetURLObject::DECODE_WITH_CHARSET case
+ //to ensure that the string doesn't get mangled
+ rtl::OUString aURL = aTargetURL.GetMainURL( (nSetRelative || eTargetProtocol == INET_PROT_FILE) ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
appendLiteralStringEncrypt( nSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL ) :
aURL , rLink.m_nObject, aLine );
+ }
}
//<--- i56629
}
commit 51c1386285632f188a2f875f71606f2730990b84
Author: Radek Doulik <rodo at novell.com>
Date: Thu Dec 2 22:20:24 2010 +0100
fix invalid read in doubleSequenceToColor, fixes crash in n#654065
Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index 9f701c5..d57c9f4 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -820,13 +820,13 @@ namespace vcl
const uno::Sequence< double > rColor,
const uno::Reference< rendering::XColorSpace >& xColorSpace )
{
- const rendering::ARGBColor& rARGBColor(
+ const rendering::ARGBColor aARGBColor(
xColorSpace->convertToARGB(rColor)[0]);
- return Color( 255-toByteColor(rARGBColor.Alpha),
- toByteColor(rARGBColor.Red),
- toByteColor(rARGBColor.Green),
- toByteColor(rARGBColor.Blue) );
+ return Color( 255-toByteColor(aARGBColor.Alpha),
+ toByteColor(aARGBColor.Red),
+ toByteColor(aARGBColor.Green),
+ toByteColor(aARGBColor.Blue) );
}
//---------------------------------------------------------------------------------------
commit dc6983fdeb44160d3ae826bc00d0b00288926cd1
Author: sj <sj at openoffice.org>
Date: Thu Dec 2 14:31:22 2010 +0100
impress205: #i115825# fixed metatextarray issues
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index a30f545..f7df564 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1481,6 +1481,12 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
while ( nLen-- )
rIStm >> *pBuffer++;
+
+ if ( mnIndex + mnLen > maStr.Len() )
+ {
+ mnIndex = 0;
+ delete[] mpDXAry, mpDXAry = NULL;
+ }
}
}
commit efc1e1ba1adbbe583cdbe639652184900eea3a12
Author: Petr Mladek <pmladek at suse.cz>
Date: Wed Dec 1 15:55:53 2010 +0100
Version 3.3.0.1, tag LIBREOFFICE_3_3_0_1 (3.3-rc1)
commit d8300d4a7d8985fea9fa7987d06d2bf5e86731f7
Author: Petr Mladek <pmladek at suse.cz>
Date: Tue Nov 30 21:37:52 2010 +0100
use BrOffice in pt_BR locale (fdo#31770)
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 4fc4846..763871c 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <osl/diagnose.h>
+#include <i18npool/mslangid.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/instance.hxx>
#if OSL_DEBUG_LEVEL > 0
@@ -399,10 +400,17 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
Any aRet;
- ::rtl::OUString &rBrandName = BrandName::get();
- if ( eProp == PRODUCTNAME && rBrandName.getLength() )
+
+ ::rtl::OUString sBrandName;
+ LanguageType nType = MsLangId::getSystemUILanguage();
+ if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN )
+ sBrandName = OUString::createFromAscii("BrOffice");
+ else
+ sBrandName = BrandName::get();
+
+ if ( eProp == PRODUCTNAME && sBrandName.getLength() )
{
- aRet <<= rBrandName;
+ aRet <<= sBrandName;
return aRet;
}
@@ -551,7 +559,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
if ( eProp == PRODUCTNAME )
- aRet >>= rBrandName;
+ aRet >>= sBrandName;
if ( eProp == PRODUCTXMLFILEFORMATNAME )
aRet >>= rXMLFileFormatName;
commit c4d55cce165b9e375c1fa0e1638bfd2cf7c19c04
Author: sj <sj at openoffice.org>
Date: Tue Nov 30 13:41:46 2010 +0100
impress205: #i115825# fixed copy&paste problem of metafiles
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 5c8ff4d..a30f545 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1441,7 +1441,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
rIStm >> mnLen;
rIStm >> nAryLen;
- if ( mnIndex > mnLen )
+ if ( mnIndex + mnLen > maStr.Len() )
{
mnIndex = 0;
mpDXAry = 0;
commit 0a1ab9d035f947b5e5e687de9d32c050cc39d71f
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Sun Nov 14 02:16:27 2010 +0100
RTF: port last changes from CWS
diff --git a/svtools/inc/rtfkeywd.hxx b/svtools/inc/rtfkeywd.hxx
index e646e71..b701c3a 100644
--- a/svtools/inc/rtfkeywd.hxx
+++ b/svtools/inc/rtfkeywd.hxx
@@ -1124,6 +1124,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHP "\\shp"
#define OOO_STRING_SVTOOLS_RTF_SN "\\sn"
#define OOO_STRING_SVTOOLS_RTF_SV "\\sv"
+#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
// Support for overline attributes
#define OOO_STRING_SVTOOLS_RTF_OL "\\ol"
diff --git a/svtools/inc/rtftoken.h b/svtools/inc/rtftoken.h
index 0d8dac0..56db78b 100644
--- a/svtools/inc/rtftoken.h
+++ b/svtools/inc/rtftoken.h
@@ -1257,7 +1257,7 @@ enum RTF_TOKEN_IDS {
RTF_SOUTLVL,
// shapes
- RTF_SHP, RTF_SN, RTF_SV
+ RTF_SHP, RTF_SN, RTF_SV, RTF_SP
/*
RTF_SHPLEFT,
RTF_SHPTOP,
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
index 0151660..f294865 100644
--- a/svtools/source/svrtf/rtfkey2.cxx
+++ b/svtools/source/svrtf/rtfkey2.cxx
@@ -1127,6 +1127,7 @@ sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHP, "\\shp" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SN, "\\sn" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SV, "\\sv" );
+sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SP, "\\sp" );
/*
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
sal_Char const SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
index 5d2b9c0..9f78fb9 100644
--- a/svtools/source/svrtf/rtfkeywd.cxx
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -1159,6 +1159,7 @@ static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = {
*/
{{OOO_STRING_SVTOOLS_RTF_SN}, RTF_SN},
{{OOO_STRING_SVTOOLS_RTF_SV}, RTF_SV},
+ {{OOO_STRING_SVTOOLS_RTF_SP}, RTF_SP},
// Support for overline attributes
{{OOO_STRING_SVTOOLS_RTF_OL}, RTF_OL},
More information about the Libreoffice-commits
mailing list