diff options
author | hg <hg@oosvn01.> | 2009-10-08 15:32:44 +0000 |
---|---|---|
committer | hg <hg@oosvn01.> | 2009-10-08 15:32:44 +0000 |
commit | 3e523c1a7633731154ef8b19b0e206bec5a348cf (patch) | |
tree | 7ed8d641626d24f481e1d5343dc2568cb15034aa | |
parent | c5046bc3c7966022c3688e930f0a8937e9cc563b (diff) | |
parent | fd7216ce2faff3891f45afc1d3ab4a4418851c70 (diff) |
merge with m44
260 files changed, 5392 insertions, 5636 deletions
diff --git a/basebmp/test/makefile.mk b/basebmp/test/makefile.mk index 1412a7602161..43165b831a64 100644 --- a/basebmp/test/makefile.mk +++ b/basebmp/test/makefile.mk @@ -132,6 +132,6 @@ unittest : $(SHL1TARGETN) @echo ---------------------------------------------------------- @echo - start unit test on library $(SHL1TARGETN) @echo ---------------------------------------------------------- - testshl2 -sf $(mktmp ) $(SHL1TARGETN) + $(AUGMENT_LIBRARY_PATH) testshl2 -sf $(mktmp ) $(SHL1TARGETN) ALLTAR : unittest diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx index 45423ace62c6..5eff6b0b9cc1 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx @@ -574,6 +574,20 @@ namespace basegfx bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB, const double& rfSmallValue); bool equal(const B2DPolygon& rCandidateA, const B2DPolygon& rCandidateB); + /** snap some polygon coordinates to discrete coordinates + + This method allows to snap some polygon points to discrete (integer) values + which equals e.g. a snap to discrete coordinates. It will snap points of + horizontal and vertical edges + + @param rCandidate + The source polygon + + @return + The modified version of the source polygon + */ + B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate); + } // end of namespace tools } // end of namespace basegfx diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index f4d1f992ad6b..c1e5dc80d8c4 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -3553,6 +3553,66 @@ namespace basegfx return equal(rCandidateA, rCandidateB, fSmallValue); } + // snap points of horizontal or vertical edges to discrete values + B2DPolygon snapPointsOfHorizontalOrVerticalEdges(const B2DPolygon& rCandidate) + { + const sal_uInt32 nPointCount(rCandidate.count()); + + if(nPointCount > 1) + { + // Start by copying the source polygon to get a writeable copy. The closed state is + // copied by aRetval's initialisation, too, so no need to copy it in this method + B2DPolygon aRetval(rCandidate); + + // prepare geometry data. Get rounded from original + B2ITuple aPrevTuple(basegfx::fround(rCandidate.getB2DPoint(nPointCount - 1))); + B2DPoint aCurrPoint(rCandidate.getB2DPoint(0)); + B2ITuple aCurrTuple(basegfx::fround(aCurrPoint)); + + // loop over all points. This will also snap the implicit closing edge + // even when not closed, but that's no problem here + for(sal_uInt32 a(0); a < nPointCount; a++) + { + // get next point. Get rounded from original + const bool bLastRun(a + 1 == nPointCount); + const sal_uInt32 nNextIndex(bLastRun ? 0 : a + 1); + const B2DPoint aNextPoint(rCandidate.getB2DPoint(nNextIndex)); + const B2ITuple aNextTuple(basegfx::fround(aNextPoint)); + + // get the states + const bool bPrevVertical(aPrevTuple.getX() == aCurrTuple.getX()); + const bool bNextVertical(aNextTuple.getX() == aCurrTuple.getX()); + const bool bPrevHorizontal(aPrevTuple.getY() == aCurrTuple.getY()); + const bool bNextHorizontal(aNextTuple.getY() == aCurrTuple.getY()); + const bool bSnapX(bPrevVertical || bNextVertical); + const bool bSnapY(bPrevHorizontal || bNextHorizontal); + + if(bSnapX || bSnapY) + { + const B2DPoint aSnappedPoint( + bSnapX ? aCurrTuple.getX() : aCurrPoint.getX(), + bSnapY ? aCurrTuple.getY() : aCurrPoint.getY()); + + aRetval.setB2DPoint(a, aSnappedPoint); + } + + // prepare next point + if(!bLastRun) + { + aPrevTuple = aCurrTuple; + aCurrPoint = aNextPoint; + aCurrTuple = aNextTuple; + } + } + + return aRetval; + } + else + { + return rCandidate; + } + } + } // end of namespace tools } // end of namespace basegfx diff --git a/basegfx/test/makefile.mk b/basegfx/test/makefile.mk index 5bf0d8aa0b59..d0fbfaf9e7c6 100644 --- a/basegfx/test/makefile.mk +++ b/basegfx/test/makefile.mk @@ -89,7 +89,7 @@ $(MISC)$/unittest_succeeded : $(SHL1TARGETN) @echo ---------------------------------------------------------- @echo - start unit test on library $(SHL1TARGETN) @echo ---------------------------------------------------------- - testshl2 -sf $(mktmp ) -forward $(BIN)$/ $(SHL1TARGETN) + $(AUGMENT_LIBRARY_PATH) testshl2 -sf $(mktmp ) -forward $(BIN)$/ $(SHL1TARGETN) $(TOUCH) $@ ALLTAR : $(MISC)$/unittest_succeeded diff --git a/canvas/source/tools/surface.cxx b/canvas/source/tools/surface.cxx index 1dd902d7c3ad..c3161758ea3e 100644 --- a/canvas/source/tools/surface.cxx +++ b/canvas/source/tools/surface.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: surface.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.16.1 $ * * This file is part of OpenOffice.org. * @@ -262,7 +262,7 @@ namespace canvas ::basegfx::B2IPoint aDestOffset; if( mpFragment ) - mpFragment->getPos(); + aDestOffset = mpFragment->getPos(); // convert size to normalized device coordinates const ::basegfx::B2DRectangle& rUV( diff --git a/comphelper/inc/comphelper/processfactory.hxx b/comphelper/inc/comphelper/processfactory.hxx index 642d16ffee9a..d2ae887ba341 100644 --- a/comphelper/inc/comphelper/processfactory.hxx +++ b/comphelper/inc/comphelper/processfactory.hxx @@ -73,7 +73,7 @@ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XI @see getProcessServiceFactory @see setProcessServiceFactory */ -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > +COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createProcessComponentWithArguments( const ::rtl::OUString& _rServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs diff --git a/comphelper/inc/comphelper/storagehelper.hxx b/comphelper/inc/comphelper/storagehelper.hxx index fb0e955d496c..b99f7e1233ca 100644 --- a/comphelper/inc/comphelper/storagehelper.hxx +++ b/comphelper/inc/comphelper/storagehelper.hxx @@ -162,6 +162,8 @@ public: = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ) throw ( ::com::sun::star::uno::Exception ); + static sal_Bool IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed ); + static sal_Bool IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed ); }; } diff --git a/comphelper/inc/comphelper/uieventslogger.hxx b/comphelper/inc/comphelper/uieventslogger.hxx index b7b1cc4cb9be..97ad6ba4fc62 100644 --- a/comphelper/inc/comphelper/uieventslogger.hxx +++ b/comphelper/inc/comphelper/uieventslogger.hxx @@ -53,6 +53,7 @@ namespace comphelper static void logVcl(const ::rtl::OUString& parent_id, sal_Int32 window_type, const ::rtl::OUString& id, const ::rtl::OUString& method, sal_Int32 param); static void logVcl(const ::rtl::OUString& parent_id, sal_Int32 window_type, const ::rtl::OUString& id, const ::rtl::OUString& method); static void disposing(); + static void reinit(); virtual ~UiEventsLogger() {} }; } diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 667d1bdaa20a..7d63ed7a43f5 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -400,12 +400,17 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream( return xTempStorage; } +// ---------------------------------------------------------------------- +sal_Bool OStorageHelper::IsValidZipEntryFileName( const ::rtl::OUString& aName, sal_Bool bSlashAllowed ) +{ + return IsValidZipEntryFileName( aName.getStr(), aName.getLength(), bSlashAllowed ); +} // ---------------------------------------------------------------------- -sal_Bool IsValidZipEntryFileName( +sal_Bool OStorageHelper::IsValidZipEntryFileName( const sal_Unicode *pChar, sal_Int32 nLength, sal_Bool bSlashAllowed ) { - for ( sal_Int32 i = 0 ; i < nLength ; i++ ) + for ( sal_Int32 i = 0; i < nLength; i++ ) { switch ( pChar[i] ) { @@ -422,9 +427,8 @@ sal_Bool IsValidZipEntryFileName( return sal_False; break; default: - if ( pChar[i] < 32 || pChar[i] > 127 ) + if ( pChar[i] < 32 || pChar[i] >= 0xD800 && pChar[i] <= 0xDFFF ) return sal_False; -// Note: in case this ever supports unicode, watch out for surrogate pairs! } } return sal_True; diff --git a/comphelper/source/misc/uieventslogger.cxx b/comphelper/source/misc/uieventslogger.cxx index a60ecc9058de..3ff875a4e67d 100644 --- a/comphelper/source/misc/uieventslogger.cxx +++ b/comphelper/source/misc/uieventslogger.cxx @@ -97,6 +97,7 @@ namespace abbrs[OUString::createFromAscii("ToolbarsMenuController")] = OUString::createFromAscii("15"); abbrs[OUString::createFromAscii("SfxToolBoxControl")] = OUString::createFromAscii("16"); abbrs[OUString::createFromAscii("SfxAsyncExec")] = OUString::createFromAscii("17"); + abbrs[OUString::createFromAscii("AcceleratorExecute")] = OUString::createFromAscii("18"); }; } @@ -132,7 +133,6 @@ namespace comphelper bool m_Active; TimeValue m_LastLogEventTime; - Mutex m_LogMutex; const OUString m_LogPath; const TimeValue m_IdleTimeout; sal_Int32 m_SessionLogEventCount; @@ -145,6 +145,7 @@ namespace comphelper // static methods and data static ptr getInstance(); + static void prepareMutex(); static bool shouldActivate(); static bool getEnabledFromCoreController(); static bool getEnabledFromCfg(); @@ -218,17 +219,19 @@ namespace comphelper sal_Bool UiEventsLogger::isEnabled() { try { - UiEventsLogger_Impl::ptr inst = UiEventsLogger_Impl::getInstance(); - if(inst==UiEventsLogger_Impl::ptr()) return false; - return inst->m_Active; + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); + return UiEventsLogger_Impl::getInstance()->m_Active; } catch(...) { return false; } // never throws } sal_Int32 UiEventsLogger::getSessionLogEventCount() { - UiEventsLogger_Impl::ptr inst = UiEventsLogger_Impl::getInstance(); - if(inst==UiEventsLogger_Impl::ptr()) return 0; - return inst->m_SessionLogEventCount; + try { + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); + return UiEventsLogger_Impl::getInstance()->m_SessionLogEventCount; + } catch(...) { return 0; } // never throws } void UiEventsLogger::appendDispatchOrigin( @@ -262,8 +265,9 @@ namespace comphelper const Sequence<PropertyValue>& args) { try { - UiEventsLogger_Impl::ptr inst = UiEventsLogger_Impl::getInstance(); - if(inst!=UiEventsLogger_Impl::ptr()) inst->logDispatch(url, args); + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); + UiEventsLogger_Impl::getInstance()->logDispatch(url, args); } catch(...) { } // never throws } @@ -275,8 +279,9 @@ namespace comphelper const OUString& param) { try { - UiEventsLogger_Impl::ptr inst = UiEventsLogger_Impl::getInstance(); - if(inst!=UiEventsLogger_Impl::ptr()) inst->logVcl(parent_id, window_type, id, method, param); + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); + UiEventsLogger_Impl::getInstance()->logVcl(parent_id, window_type, id, method, param); } catch(...) { } // never throws } @@ -303,8 +308,23 @@ namespace comphelper void UiEventsLogger::disposing() { + // we dont want to create an instance just to dispose it + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); if(UiEventsLogger_Impl::instance!=UiEventsLogger_Impl::ptr()) + UiEventsLogger_Impl::getInstance()->disposing(); + } + + void UiEventsLogger::reinit() + { + UiEventsLogger_Impl::prepareMutex(); + Guard<Mutex> singleton_guard(UiEventsLogger_Impl::singleton_mutex); + if(UiEventsLogger_Impl::instance) + { UiEventsLogger_Impl::instance->disposing(); + delete UiEventsLogger_Impl::instance; + UiEventsLogger_Impl::instance = NULL; + } } // private UiEventsLogger_Impl methods @@ -325,7 +345,6 @@ namespace comphelper const URL& url, const Sequence<PropertyValue>& args) { - Guard<Mutex> log_guard(m_LogMutex); if(!m_Active) return; if(!url.Complete.match(URL_UNO) && !url.Complete.match(URL_FILE)) return; checkIdleTimeout(); @@ -377,7 +396,6 @@ namespace comphelper const OUString& method, const OUString& param) { - Guard<Mutex> log_guard(m_LogMutex); if(!m_Active) return; checkIdleTimeout(); @@ -600,19 +618,22 @@ namespace comphelper } UiEventsLogger_Impl::ptr UiEventsLogger_Impl::instance = UiEventsLogger_Impl::ptr(); - Mutex * UiEventsLogger_Impl::singleton_mutex = NULL; UiEventsLogger_Impl::ptr UiEventsLogger_Impl::getInstance() { - if(singleton_mutex==NULL) + if(instance == NULL) + instance = UiEventsLogger_Impl::ptr(new UiEventsLogger_Impl()); + return instance; + } + + Mutex * UiEventsLogger_Impl::singleton_mutex = NULL; + void UiEventsLogger_Impl::prepareMutex() + { + if(singleton_mutex == NULL) { Guard<Mutex> global_guard(Mutex::getGlobalMutex()); - if(singleton_mutex==NULL) + if(singleton_mutex == NULL) singleton_mutex = new Mutex(); } - Guard<Mutex> singleton_guard(singleton_mutex); - if(instance == 0) - instance = UiEventsLogger_Impl::ptr(new UiEventsLogger_Impl()); - return instance; } sal_Int32 UiEventsLogger_Impl::findIdx(const Sequence<PropertyValue>& args, const OUString& key) @@ -625,7 +646,6 @@ namespace comphelper void UiEventsLogger_Impl::disposing() { - Guard<Mutex> log_guard(m_LogMutex); m_Active = false; m_Logger.clear() ; m_LogHandler.clear(); diff --git a/dtrans/source/aqua/makefile.mk b/dtrans/source/aqua/makefile.mk index 0d3f7d2b9b35..e0b4eecf6db4 100644 --- a/dtrans/source/aqua/makefile.mk +++ b/dtrans/source/aqua/makefile.mk @@ -97,7 +97,7 @@ SHL1OBJS= $(SLOFILES) # --- Targets ------------------------------------------------------ ALL : ALLTAR - +cd $(LB) && regcomp -register -r ../bin/$(COMP1TYPELIST).rdb -c $(SHL1TARGET) + +cd $(LB) && $(REGCOMP) -register -r ../bin/$(COMP1TYPELIST).rdb -c $(SHL1TARGET) .INCLUDE : target.mk diff --git a/goodies/source/inv/makefile.mk b/goodies/source/inv/makefile.mk index 7b7d6fabdd1e..359aab167008 100644 --- a/goodies/source/inv/makefile.mk +++ b/goodies/source/inv/makefile.mk @@ -114,7 +114,7 @@ $(BIN)$/applicat.rdb : makefile.mk $(SOLARBINDIR)$/types.rdb rm -f $@ $(GNUCOPY) $(SOLARBINDIR)$/types.rdb $@ cd $(BIN) && \ - regcomp -register -r applicat.rdb \ + $(REGCOMP) -register -r applicat.rdb \ -c i18npool.uno$(DLLPOST) # --- Def-File --- diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index bb08d9e4e6c3..0eb4c20ca250 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -102,7 +102,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, if (bDirection) while (nPos < len && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, 1)) || isZWSP(ch))) nPos=pos; else - while (nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1))) || isZWSP(ch)) nPos=pos; + while (nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch))) nPos=pos; break; } return nPos; diff --git a/i18npool/source/breakiterator/data/line.txt b/i18npool/source/breakiterator/data/line.txt index d7b6350e4904..cbabee6f20af 100644 --- a/i18npool/source/breakiterator/data/line.txt +++ b/i18npool/source/breakiterator/data/line.txt @@ -61,7 +61,7 @@ $BB = [:LineBreak = Break_Before:]; $BK = [:LineBreak = Mandatory_Break:]; $B2 = [:LineBreak = Break_Both:]; $CB = [:LineBreak = Contingent_Break:]; -$CL = [[:LineBreak = Close_Punctuation:] - [\u3001 \u3002]] ; +$CL = [:LineBreak = Close_Punctuation:] ; $CM = [:LineBreak = Combining_Mark:]; $CR = [:LineBreak = Carriage_Return:]; $EX = [:LineBreak = Exclamation:]; diff --git a/i18npool/source/breakiterator/data/makefile.mk b/i18npool/source/breakiterator/data/makefile.mk index 7faf1a068701..ba380babb279 100644 --- a/i18npool/source/breakiterator/data/makefile.mk +++ b/i18npool/source/breakiterator/data/makefile.mk @@ -81,7 +81,7 @@ DEPOBJFILES= \ .INCLUDE : target.mk $(MISC)$/dict_%.cxx : %.dic - $(BIN)$/gendict $< $@ + $(AUGMENT_LIBRARY_PATH) $(BIN)$/gendict $< $@ # ugly - is this dependency really required here? $(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/gendict$(EXECPOST) diff --git a/i18npool/source/breakiterator/makefile.mk b/i18npool/source/breakiterator/makefile.mk index 2db7d3c7d73b..7ba9cd3e753d 100644 --- a/i18npool/source/breakiterator/makefile.mk +++ b/i18npool/source/breakiterator/makefile.mk @@ -64,6 +64,7 @@ SLOFILES= \ OBJFILES = $(OBJ)$/gendict.obj APP1TARGET = gendict +APP1RPATH = NONE DEPOBJFILES = $(OBJ)$/gendict.obj APP1OBJS = $(DEPOBJFILES) @@ -77,9 +78,9 @@ GENCMN:=$(SYSTEM_GENCMN) GENBRK:=$(SYSTEM_GENBRK) GENCCODE:=$(SYSTEM_GENCCODE) .ELSE -GENCMN:=$(SOLARBINDIR)$/gencmn -GENBRK:=$(SOLARBINDIR)$/genbrk -GENCCODE:=$(SOLARBINDIR)$/genccode +GENCMN:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/gencmn +GENBRK:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genbrk +GENCCODE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)$/genccode .ENDIF $(MISC)$/%.brk : data/%.txt diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx index eeafc899a39f..fb832f0b6468 100644 --- a/i18npool/source/breakiterator/xdictionary.cxx +++ b/i18npool/source/breakiterator/xdictionary.cxx @@ -193,7 +193,7 @@ static sal_Int16 JapaneseCharType(sal_Unicode c) { if (0x3041 <= c && c <= 0x309e) return HIRAKANA; - if (0x30a1 <= c && c <= 0x30fe || 0xff65 <= c && c <= 0xff9f) + if ((0x30a1 <= c && c <= 0x30fe) || (0xff65 <= c && c <= 0xff9f)) return KATAKANA; return KANJA; } diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 8a19ce5bade9..96eee0772bc1 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -765,8 +765,8 @@ Calendar_gregorian::isValid() throw(RuntimeException) static sal_Int16 SAL_CALL NatNumForCalendar(const com::sun::star::lang::Locale& aLocale, sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode, sal_Int16 value ) { - sal_Bool isShort = (nCalendarDisplayCode == CalendarDisplayCode::SHORT_YEAR || - nCalendarDisplayCode == CalendarDisplayCode::LONG_YEAR) && value >= 100 || + sal_Bool isShort = ((nCalendarDisplayCode == CalendarDisplayCode::SHORT_YEAR || + nCalendarDisplayCode == CalendarDisplayCode::LONG_YEAR) && value >= 100) || nCalendarDisplayCode == CalendarDisplayCode::SHORT_QUARTER || nCalendarDisplayCode == CalendarDisplayCode::LONG_QUARTER; sal_Bool isChinese = aLocale.Language.equalsAscii("zh"); diff --git a/i18npool/source/collator/data/makefile.mk b/i18npool/source/collator/data/makefile.mk index 18e610c7a996..bdf802adc94d 100644 --- a/i18npool/source/collator/data/makefile.mk +++ b/i18npool/source/collator/data/makefile.mk @@ -61,7 +61,7 @@ SHL1OBJS=$(SLOFILES) .INCLUDE : target.mk $(MISC)$/collator_%.cxx : %.txt - $(BIN)$/gencoll_rule $< $@ $* + $(AUGMENT_LIBRARY_PATH) $(BIN)$/gencoll_rule $< $@ $* # ugly - is this dependency really required here? $(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/gencoll_rule$(EXECPOST) diff --git a/i18npool/source/collator/makefile.mk b/i18npool/source/collator/makefile.mk index b1e2791f873b..bca1c00aa419 100644 --- a/i18npool/source/collator/makefile.mk +++ b/i18npool/source/collator/makefile.mk @@ -54,6 +54,7 @@ SLOFILES= \ $(rules_obj) APP1TARGET = gencoll_rule +APP1RPATH = NONE APP1OBJS = $(OBJ)$/gencoll_rule.obj diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index baf9ac38786b..8979a5ffc203 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -830,8 +830,8 @@ Sequence< sal_Int16 > DefaultNumberingProvider::getSupportedNumberingTypes( ) for(sal_Int16 i = 0; i < nSupported_NumberingTypes; i++) { if ( (aSupportedTypes[i].langOption & LANG_ALL) || - (aSupportedTypes[i].langOption & LANG_CJK) && cjkEnabled || - (aSupportedTypes[i].langOption & LANG_CTL) && ctlEnabled) + ((aSupportedTypes[i].langOption & LANG_CJK) && cjkEnabled) || + ((aSupportedTypes[i].langOption & LANG_CTL) && ctlEnabled) ) pArray[i] = aSupportedTypes[i].nType; } return aRet; diff --git a/i18npool/source/indexentry/data/makefile.mk b/i18npool/source/indexentry/data/makefile.mk index e58b0b7c2c90..6149bbd8b12a 100644 --- a/i18npool/source/indexentry/data/makefile.mk +++ b/i18npool/source/indexentry/data/makefile.mk @@ -64,7 +64,7 @@ LIB1OBJFILES=$(SHL1OBJS) .INCLUDE : target.mk $(MISC)$/%.cxx : %.txt - $(BIN)$/genindex_data $< $@ $* + $(AUGMENT_LIBRARY_PATH) $(BIN)$/genindex_data $< $@ $* # ugly - is this dependency really required here? $(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/genindex_data$(EXECPOST) diff --git a/i18npool/source/indexentry/makefile.mk b/i18npool/source/indexentry/makefile.mk index e10f05e920ed..770fe062c688 100644 --- a/i18npool/source/indexentry/makefile.mk +++ b/i18npool/source/indexentry/makefile.mk @@ -54,6 +54,7 @@ SLOFILES= \ OBJFILES = $(OBJ)$/genindex_data.obj APP1TARGET = genindex_data +APP1RPATH = NONE DEPOBJFILES = $(OBJ)$/genindex_data.obj APP1OBJS = $(DEPOBJFILES) diff --git a/i18npool/source/inputchecker/inputsequencechecker_th.cxx b/i18npool/source/inputchecker/inputsequencechecker_th.cxx index 7da4a7e5b73f..815431368237 100644 --- a/i18npool/source/inputchecker/inputsequencechecker_th.cxx +++ b/i18npool/source/inputchecker/inputsequencechecker_th.cxx @@ -122,19 +122,19 @@ http://www.openoffice.org/issues/show_bug.cgi?id=42661 8. <cons> <thanthakhat> + <abv1> => <cons> <abv1> <thanthakhat> (reorder) 9. <cons> <abv1>_x <thanthakhat> + <abv1>_y => <cons> <abv1>_y <thanthakhat>(reorder, replace) */ -#define CT_ABV(t) (t>=CT_AV1 && t<=CT_AV3 || t==CT_BV1 || t==CT_BV2) +#define CT_ABV(t) ( (t>=CT_AV1 && t<=CT_AV3) || t==CT_BV1 || t==CT_BV2) #define CT_ABV1(t) (t==CT_AV1 || t==CT_BV1) if (check(Text[nStartPos], inputChar, inputCheckMode)) Text = Text.replaceAt(++nStartPos, 0, OUString(inputChar)); else if (nStartPos > 0 && getCharType(Text[nStartPos-1]) == CT_CONS) { sal_uInt16 t1=getCharType(Text[nStartPos]), t2=getCharType(inputChar); - if (CT_ABV(t1) && CT_ABV(t2) || // 1. - t1==CT_TONE && t2==CT_TONE) // 2. + if ( (CT_ABV(t1) && CT_ABV(t2)) || // 1. + (t1==CT_TONE && t2==CT_TONE) )// 2. Text = Text.replaceAt(nStartPos, 1, OUString(inputChar)); - else if (t1==CT_TONE && CT_ABV(t2) || // 5. - t1==CT_FV1 && t2==CT_TONE || // 6. - Text[nStartPos]==0x0E4C && CT_ABV1(t2)) // 8. + else if ( (t1==CT_TONE && CT_ABV(t2)) || // 5. + (t1==CT_FV1 && t2==CT_TONE) || // 6. + (Text[nStartPos]==0x0E4C && CT_ABV1(t2)) ) // 8. Text = Text.replaceAt(nStartPos++, 0, OUString(inputChar)); else nStartPos=Text.getLength(); @@ -142,9 +142,9 @@ http://www.openoffice.org/issues/show_bug.cgi?id=42661 sal_uInt16 t1=getCharType(Text[nStartPos-1]), t2=getCharType(Text[nStartPos]), t3=getCharType(inputChar); if (CT_ABV(t1) && t2==CT_TONE && t3==CT_TONE) // 3. Text = Text.replaceAt(nStartPos, 1, OUString(inputChar)); - else if (CT_ABV(t1) && t2==CT_TONE && CT_ABV(t3) || // 4. - t1==CT_TONE && t2==CT_FV1 && t3==CT_TONE || // 7. - CT_ABV1(t1) && Text[nStartPos]==0x0E4C && CT_ABV1(t3)) // 9. + else if ( (CT_ABV(t1) && t2==CT_TONE && CT_ABV(t3)) || // 4. + (t1==CT_TONE && t2==CT_FV1 && t3==CT_TONE) || // 7. + (CT_ABV1(t1) && Text[nStartPos]==0x0E4C && CT_ABV1(t3)) ) // 9. Text = Text.replaceAt(nStartPos-1, 1, OUString(inputChar)); else nStartPos=Text.getLength(); diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk index b288275a386e..3eca889e7ccc 100644 --- a/i18npool/source/localedata/data/makefile.mk +++ b/i18npool/source/localedata/data/makefile.mk @@ -495,6 +495,6 @@ DEPOBJFILES= \ $(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST) $(MISC)$/localedata_%.cxx : %.xml - $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb + $(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb $(RM) $(BIN)$/$(@:b).rdb diff --git a/i18npool/source/localedata/data/ro_RO.xml b/i18npool/source/localedata/data/ro_RO.xml index f570204bcdea..b5033ce9bb27 100644 --- a/i18npool/source/localedata/data/ro_RO.xml +++ b/i18npool/source/localedata/data/ro_RO.xml @@ -223,7 +223,7 @@ <LC_COLLATION ref="en_US"/> <LC_SEARCH ref="en_US"/> <LC_INDEX> -<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-Z Ă Î Ş Ţ</IndexKey> +<IndexKey unoid="alphanumeric" default="true" phonetic="false">A Ă Â B-I Î J-S Ş T Ţ U-Z</IndexKey> <UnicodeScript>0</UnicodeScript> <UnicodeScript>1</UnicodeScript> <UnicodeScript>2</UnicodeScript> diff --git a/i18npool/source/localedata/data/sk_SK.xml b/i18npool/source/localedata/data/sk_SK.xml index b3615c480af5..7820ef290a46 100644 --- a/i18npool/source/localedata/data/sk_SK.xml +++ b/i18npool/source/localedata/data/sk_SK.xml @@ -1,462 +1,460 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Locale SYSTEM 'locale.dtd'> -<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.2"> -<LC_INFO> -<Language> -<LangID>sk</LangID> -<DefaultName>Slovak</DefaultName> -</Language> -<Country> -<CountryID>SK</CountryID> -<DefaultName>Slovak Republic</DefaultName> -</Country> -<Platform> -<PlatformID>generic</PlatformID> -</Platform> -</LC_INFO> -<LC_CTYPE unoid="generic"> -<Separators> -<DateSeparator>.</DateSeparator> -<ThousandSeparator> </ThousandSeparator> -<DecimalSeparator>,</DecimalSeparator> -<TimeSeparator>:</TimeSeparator> -<Time100SecSeparator>,</Time100SecSeparator> -<ListSeparator>;</ListSeparator> -<LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> -<LongDateDaySeparator>. </LongDateDaySeparator> -<LongDateMonthSeparator> </LongDateMonthSeparator> -<LongDateYearSeparator> </LongDateYearSeparator> -</Separators> -<Markers> -<QuotationStart>‚</QuotationStart> -<QuotationEnd>‘</QuotationEnd> -<DoubleQuotationStart>„</DoubleQuotationStart> -<DoubleQuotationEnd>“</DoubleQuotationEnd> -</Markers> -<TimeAM>dop.</TimeAM> -<TimePM>odp.</TimePM> -<MeasurementSystem>Metric</MeasurementSystem> -</LC_CTYPE> -<LC_FORMAT> -<FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18"> -<FormatCode>D.M.YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="28"> -<FormatCode>NN, DD. MMM YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="34"> -<FormatCode>MM YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="35"> -<FormatCode>MMM DD</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="36"> -<FormatCode>MMMM</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey6" default="false" type="medium" usage="DATE" formatindex="37"> -<FormatCode>QQ YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="21"> -<FormatCode>DD.MM.YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20"> -<FormatCode>DD.MM.YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19"> -<FormatCode>NNNNMMMM DD. YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey10" default="false" type="long" usage="DATE" formatindex="22"> -<FormatCode>MMM D. YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey11" default="false" type="long" usage="DATE" formatindex="23"> -<FormatCode>MMM D. YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey12" default="false" type="long" usage="DATE" formatindex="25"> -<FormatCode>MMMM D. YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey13" default="false" type="long" usage="DATE" formatindex="27"> -<FormatCode>NN, MMM D. YY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey14" default="false" type="long" usage="DATE" formatindex="29"> -<FormatCode>NN, MMMM D. YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="30"> -<FormatCode>NNNNMMMM D. YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="24"> -<FormatCode>D. MMM YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="26"> -<FormatCode>D. MMMM YYYY</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey18" default="false" type="short" usage="DATE" formatindex="31"> -<FormatCode>MM-DD</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey19" default="false" type="medium" usage="DATE" formatindex="32"> -<FormatCode>YY-MM-DD</FormatCode> -<DefaultName>ISO 8601</DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey20" default="false" type="medium" usage="DATE" formatindex="33"> -<FormatCode>YYYY-MM-DD</FormatCode> -<DefaultName>ISO 8601</DefaultName> -</FormatElement> -<FormatElement msgid="DateFormatskey21" default="false" type="medium" usage="DATE" formatindex="38"> -<FormatCode>WW</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey1" default="true" type="short" usage="TIME" formatindex="39"> -<FormatCode>HH:MM</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey2" default="true" type="medium" usage="TIME" formatindex="40"> -<FormatCode>HH:MM:SS</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey3" default="false" type="short" usage="TIME" formatindex="41"> -<FormatCode>HH:MM AM/PM</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey4" default="false" type="medium" usage="TIME" formatindex="42"> -<FormatCode>HH:MM:SS AM/PM</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> -<FormatCode>[HH]:MM:SS</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> -<FormatCode>MM:SS,00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> -<FormatCode>[HH]:MM:SS,00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> -<FormatCode>DD.MM.YY HH:MM</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> -<FormatCode>DD.MM.YYYY HH:MM:SS</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> -<FormatCode>Standard</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> -<FormatCode>0</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> -<FormatCode>0,00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> -<FormatCode># ##0</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> -<FormatCode># ##0,00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> -<FormatCode># ###,00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> -<FormatCode># ##0 [$Sk-41B];-# ##0 [$Sk-41B]</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> -<FormatCode># ##0,00 [$Sk-41B];-# ##0,00 [$Sk-41B]</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> -<FormatCode># ##0 [$Sk-41B];[RED]-# ##0 [$Sk-41B]</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> -<FormatCode># ##0,00 [$Sk-41B];[RED]-# ##0,00 [$Sk-41B]</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> -<FormatCode># ##0,00 CCC</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> -<FormatCode># ##0,-- [$Sk-41B];[RED]-# ##0,-- [$Sk-41B]</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> -<FormatCode>0%</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> -<FormatCode>0,00%</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> -<FormatCode>0,00E+000</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -<FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> -<FormatCode>0,00E+00</FormatCode> -<DefaultName></DefaultName> -</FormatElement> -</LC_FORMAT> -<LC_COLLATION> -<Collator unoid="alphanumeric" default="true"/> -<CollationOptions> -<TransliterationModules>IGNORE_CASE</TransliterationModules> -</CollationOptions> -</LC_COLLATION> -<LC_SEARCH> -<SearchOptions> -<TransliterationModules>IGNORE_CASE</TransliterationModules> -</SearchOptions> -</LC_SEARCH> -<LC_INDEX> -<IndexKey unoid="alphanumeric" default="true" phonetic="false">A-Z Ä Č Ô Š Ž</IndexKey> -<UnicodeScript>0</UnicodeScript> -<UnicodeScript>1</UnicodeScript> -<UnicodeScript>2</UnicodeScript> -<FollowPageWord>p.</FollowPageWord> -<FollowPageWord>pp.</FollowPageWord> -</LC_INDEX> -<LC_CALENDAR> -<Calendar unoid="gregorian" default="true"> -<DaysOfWeek> -<Day> -<DayID>sun</DayID> -<DefaultAbbrvName>Ne</DefaultAbbrvName> -<DefaultFullName>Nedeľa</DefaultFullName> -</Day> -<Day> -<DayID>mon</DayID> -<DefaultAbbrvName>Po</DefaultAbbrvName> -<DefaultFullName>Pondelok</DefaultFullName> -</Day> -<Day> -<DayID>tue</DayID> -<DefaultAbbrvName>Ut</DefaultAbbrvName> -<DefaultFullName>Utorok</DefaultFullName> -</Day> -<Day> -<DayID>wed</DayID> -<DefaultAbbrvName>St</DefaultAbbrvName> -<DefaultFullName>Streda</DefaultFullName> -</Day> -<Day> -<DayID>thu</DayID> -<DefaultAbbrvName>Št</DefaultAbbrvName> -<DefaultFullName>Štvrtok</DefaultFullName> -</Day> -<Day> -<DayID>fri</DayID> -<DefaultAbbrvName>Pi</DefaultAbbrvName> -<DefaultFullName>Piatok</DefaultFullName> -</Day> -<Day> -<DayID>sat</DayID> -<DefaultAbbrvName>So</DefaultAbbrvName> -<DefaultFullName>Sobota</DefaultFullName> -</Day> -</DaysOfWeek> -<MonthsOfYear> -<Month> -<MonthID>jan</MonthID> -<DefaultAbbrvName>január</DefaultAbbrvName> -<DefaultFullName>januára</DefaultFullName> -</Month> -<Month> -<MonthID>feb</MonthID> -<DefaultAbbrvName>február</DefaultAbbrvName> -<DefaultFullName>februára</DefaultFullName> -</Month> -<Month> -<MonthID>mar</MonthID> -<DefaultAbbrvName>marec</DefaultAbbrvName> -<DefaultFullName>marca</DefaultFullName> -</Month> -<Month> -<MonthID>apr</MonthID> -<DefaultAbbrvName>apríl</DefaultAbbrvName> -<DefaultFullName>apríla</DefaultFullName> -</Month> -<Month> -<MonthID>may</MonthID> -<DefaultAbbrvName>máj</DefaultAbbrvName> -<DefaultFullName>mája</DefaultFullName> -</Month> -<Month> -<MonthID>jun</MonthID> -<DefaultAbbrvName>jún</DefaultAbbrvName> -<DefaultFullName>júna</DefaultFullName> -</Month> -<Month> -<MonthID>jul</MonthID> -<DefaultAbbrvName>júl</DefaultAbbrvName> -<DefaultFullName>júla</DefaultFullName> -</Month> -<Month> -<MonthID>aug</MonthID> -<DefaultAbbrvName>august</DefaultAbbrvName> -<DefaultFullName>augusta</DefaultFullName> -</Month> -<Month> -<MonthID>sep</MonthID> -<DefaultAbbrvName>september</DefaultAbbrvName> -<DefaultFullName>septembra</DefaultFullName> -</Month> -<Month> -<MonthID>oct</MonthID> -<DefaultAbbrvName>október</DefaultAbbrvName> -<DefaultFullName>októbra</DefaultFullName> -</Month> -<Month> -<MonthID>nov</MonthID> -<DefaultAbbrvName>november</DefaultAbbrvName> -<DefaultFullName>novembra</DefaultFullName> -</Month> -<Month> -<MonthID>dec</MonthID> -<DefaultAbbrvName>december</DefaultAbbrvName> -<DefaultFullName>decembra</DefaultFullName> -</Month> -</MonthsOfYear> -<Eras> -<Era> -<EraID>bc</EraID> -<DefaultAbbrvName>pred nl.</DefaultAbbrvName> -<DefaultFullName>pred nl.</DefaultFullName> -</Era> -<Era> -<EraID>ad</EraID> -<DefaultAbbrvName>nl.</DefaultAbbrvName> -<DefaultFullName>nl.</DefaultFullName> -</Era> -</Eras> -<StartDayOfWeek> -<DayID>mon</DayID> -</StartDayOfWeek> -<MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> -</Calendar> -</LC_CALENDAR> -<LC_CURRENCY> -<Currency default="true" usedInCompatibleFormatCodes="true"> -<CurrencyID>SKK</CurrencyID> -<CurrencySymbol>Sk</CurrencySymbol> -<BankSymbol>SKK</BankSymbol> -<CurrencyName>Koruna</CurrencyName> -<DecimalPlaces>2</DecimalPlaces> -</Currency> -</LC_CURRENCY> -<LC_TRANSLITERATION> -<Transliteration unoid="UPPERCASE_LOWERCASE"/> -<Transliteration unoid="IGNORE_CASE"/> -<Transliteration unoid="LOWERCASE_UPPERCASE" /> -</LC_TRANSLITERATION> -<LC_MISC> -<ReservedWords> -<trueWord>pravda</trueWord> -<falseWord>nepravda</falseWord> -<quarter1Word>1. štvrťrok</quarter1Word> -<quarter2Word>2. štvrťrok</quarter2Word> -<quarter3Word>3. štvrťrok</quarter3Word> -<quarter4Word>4. štvrťrok</quarter4Word> -<aboveWord>nad</aboveWord> -<belowWord>pod</belowWord> -<quarter1Abbreviation>Q1</quarter1Abbreviation> -<quarter2Abbreviation>Q2</quarter2Abbreviation> -<quarter3Abbreviation>Q3</quarter3Abbreviation> -<quarter4Abbreviation>Q4</quarter4Abbreviation> -</ReservedWords> -</LC_MISC> -<LC_NumberingLevel> -<NumberingLevel Prefix=" " NumType="4" Suffix=")" /> -<NumberingLevel Prefix=" " NumType="4" Suffix="." /> -<NumberingLevel Prefix="(" NumType="4" Suffix="." /> -<NumberingLevel Prefix=" " NumType="2" Suffix="." /> -<NumberingLevel Prefix=" " NumType="0" Suffix=")" /> -<NumberingLevel Prefix=" " NumType="1" Suffix=")" /> -<NumberingLevel Prefix="(" NumType="1" Suffix=")" /> -<NumberingLevel Prefix=" " NumType="3" Suffix="." /> -</LC_NumberingLevel> -<LC_OutLineNumberingLevel> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="1" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix="(" NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix="." BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="2" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="2" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="1" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="1" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="2" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="3" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="4" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -<OutlineStyle> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="27A2" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="E006" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=")" BulletChar="E004" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> -<OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> -</OutlineStyle> -</LC_OutLineNumberingLevel> +<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.3"> + <LC_INFO> + <Language> + <LangID>sk</LangID> + <DefaultName>Slovak</DefaultName> + </Language> + <Country> + <CountryID>SK</CountryID> + <DefaultName>Slovak Republic</DefaultName> + </Country> + <Platform> + <PlatformID>generic</PlatformID> + </Platform> + </LC_INFO> + <LC_CTYPE unoid="generic"> + <Separators> + <DateSeparator>.</DateSeparator> + <ThousandSeparator> </ThousandSeparator> + <DecimalSeparator>,</DecimalSeparator> + <TimeSeparator>:</TimeSeparator> + <Time100SecSeparator>,</Time100SecSeparator> + <ListSeparator>;</ListSeparator> + <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> + <LongDateDaySeparator>. </LongDateDaySeparator> + <LongDateMonthSeparator> </LongDateMonthSeparator> + <LongDateYearSeparator> </LongDateYearSeparator> + </Separators> + <Markers> + <QuotationStart>‚</QuotationStart> + <QuotationEnd>‘</QuotationEnd> + <DoubleQuotationStart>„</DoubleQuotationStart> + <DoubleQuotationEnd>“</DoubleQuotationEnd> + </Markers> + <TimeAM>dop.</TimeAM> + <TimePM>odp.</TimePM> + <MeasurementSystem>Metric</MeasurementSystem> + </LC_CTYPE> + <LC_FORMAT> + <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18"> + <FormatCode>D.M.YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="28"> + <FormatCode>NN, DD. MMM YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="34"> + <FormatCode>MM YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="35"> + <FormatCode>MMM DD</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="36"> + <FormatCode>MMMM</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey6" default="false" type="medium" usage="DATE" formatindex="37"> + <FormatCode>QQ YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="21"> + <FormatCode>DD.MM.YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20"> + <FormatCode>DD.MM.YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19"> + <FormatCode>NNNNMMMM DD. YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey10" default="false" type="long" usage="DATE" formatindex="22"> + <FormatCode>MMM D. YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey11" default="false" type="long" usage="DATE" formatindex="23"> + <FormatCode>MMM D. YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey12" default="false" type="long" usage="DATE" formatindex="25"> + <FormatCode>MMMM D. YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey13" default="false" type="long" usage="DATE" formatindex="27"> + <FormatCode>NN, MMM D. YY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey14" default="false" type="long" usage="DATE" formatindex="29"> + <FormatCode>NN, MMMM D. YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="30"> + <FormatCode>NNNNMMMM D. YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="24"> + <FormatCode>D. MMM YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="26"> + <FormatCode>D. MMMM YYYY</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey18" default="false" type="short" usage="DATE" formatindex="31"> + <FormatCode>MM-DD</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey19" default="false" type="medium" usage="DATE" formatindex="32"> + <FormatCode>YY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey20" default="false" type="medium" usage="DATE" formatindex="33"> + <FormatCode>YYYY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey21" default="false" type="medium" usage="DATE" formatindex="38"> + <FormatCode>WW</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey1" default="true" type="short" usage="TIME" formatindex="39"> + <FormatCode>HH:MM</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey2" default="true" type="medium" usage="TIME" formatindex="40"> + <FormatCode>HH:MM:SS</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey3" default="false" type="short" usage="TIME" formatindex="41"> + <FormatCode>HH:MM AM/PM</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey4" default="false" type="medium" usage="TIME" formatindex="42"> + <FormatCode>HH:MM:SS AM/PM</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> + <FormatCode>[HH]:MM:SS</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> + <FormatCode>MM:SS,00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> + <FormatCode>[HH]:MM:SS,00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> + <FormatCode>DD.MM.YY HH:MM</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> + <FormatCode>DD.MM.YYYY HH:MM:SS</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> + <FormatCode>Standard</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> + <FormatCode>0</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> + <FormatCode>0,00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> + <FormatCode># ##0</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> + <FormatCode># ##0,00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> + <FormatCode># ###,00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> + <FormatCode># ##0 [$Sk-41B];-# ##0 [$Sk-41B]</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> + <FormatCode># ##0,00 [$Sk-41B];-# ##0,00 [$Sk-41B]</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> + <FormatCode># ##0 [$Sk-41B];[RED]-# ##0 [$Sk-41B]</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> + <FormatCode># ##0,00 [$Sk-41B];[RED]-# ##0,00 [$Sk-41B]</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> + <FormatCode># ##0,00 CCC</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> + <FormatCode># ##0,-- [$Sk-41B];[RED]-# ##0,-- [$Sk-41B]</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> + <FormatCode>0%</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> + <FormatCode>0,00%</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> + <FormatCode>0,00E+000</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> + <FormatCode>0,00E+00</FormatCode> + <DefaultName></DefaultName> + </FormatElement> + </LC_FORMAT> + <LC_COLLATION ref="en_US"/> + <LC_SEARCH ref="en_US"/> + <LC_INDEX> + <IndexKey unoid="alphanumeric" default="true" phonetic="false">A Ä B-C Č D-H {Ch} I-O Ô P-S Š T-Z Ž</IndexKey> + <UnicodeScript>0</UnicodeScript> + <UnicodeScript>1</UnicodeScript> + <UnicodeScript>2</UnicodeScript> + <FollowPageWord>p.</FollowPageWord> + <FollowPageWord>pp.</FollowPageWord> + </LC_INDEX> + <LC_CALENDAR> + <Calendar unoid="gregorian" default="true"> + <DaysOfWeek> + <Day> + <DayID>sun</DayID> + <DefaultAbbrvName>Ne</DefaultAbbrvName> + <DefaultFullName>Nedeľa</DefaultFullName> + </Day> + <Day> + <DayID>mon</DayID> + <DefaultAbbrvName>Po</DefaultAbbrvName> + <DefaultFullName>Pondelok</DefaultFullName> + </Day> + <Day> + <DayID>tue</DayID> + <DefaultAbbrvName>Ut</DefaultAbbrvName> + <DefaultFullName>Utorok</DefaultFullName> + </Day> + <Day> + <DayID>wed</DayID> + <DefaultAbbrvName>St</DefaultAbbrvName> + <DefaultFullName>Streda</DefaultFullName> + </Day> + <Day> + <DayID>thu</DayID> + <DefaultAbbrvName>Št</DefaultAbbrvName> + <DefaultFullName>Štvrtok</DefaultFullName> + </Day> + <Day> + <DayID>fri</DayID> + <DefaultAbbrvName>Pi</DefaultAbbrvName> + <DefaultFullName>Piatok</DefaultFullName> + </Day> + <Day> + <DayID>sat</DayID> + <DefaultAbbrvName>So</DefaultAbbrvName> + <DefaultFullName>Sobota</DefaultFullName> + </Day> + </DaysOfWeek> + <MonthsOfYear> + <Month> + <MonthID>jan</MonthID> + <DefaultAbbrvName>január</DefaultAbbrvName> + <DefaultFullName>januára</DefaultFullName> + </Month> + <Month> + <MonthID>feb</MonthID> + <DefaultAbbrvName>február</DefaultAbbrvName> + <DefaultFullName>februára</DefaultFullName> + </Month> + <Month> + <MonthID>mar</MonthID> + <DefaultAbbrvName>marec</DefaultAbbrvName> + <DefaultFullName>marca</DefaultFullName> + </Month> + <Month> + <MonthID>apr</MonthID> + <DefaultAbbrvName>apríl</DefaultAbbrvName> + <DefaultFullName>apríla</DefaultFullName> + </Month> + <Month> + <MonthID>may</MonthID> + <DefaultAbbrvName>máj</DefaultAbbrvName> + <DefaultFullName>mája</DefaultFullName> + </Month> + <Month> + <MonthID>jun</MonthID> + <DefaultAbbrvName>jún</DefaultAbbrvName> + <DefaultFullName>júna</DefaultFullName> + </Month> + <Month> + <MonthID>jul</MonthID> + <DefaultAbbrvName>júl</DefaultAbbrvName> + <DefaultFullName>júla</DefaultFullName> + </Month> + <Month> + <MonthID>aug</MonthID> + <DefaultAbbrvName>august</DefaultAbbrvName> + <DefaultFullName>augusta</DefaultFullName> + </Month> + <Month> + <MonthID>sep</MonthID> + <DefaultAbbrvName>september</DefaultAbbrvName> + <DefaultFullName>septembra</DefaultFullName> + </Month> + <Month> + <MonthID>oct</MonthID> + <DefaultAbbrvName>október</DefaultAbbrvName> + <DefaultFullName>októbra</DefaultFullName> + </Month> + <Month> + <MonthID>nov</MonthID> + <DefaultAbbrvName>november</DefaultAbbrvName> + <DefaultFullName>novembra</DefaultFullName> + </Month> + <Month> + <MonthID>dec</MonthID> + <DefaultAbbrvName>december</DefaultAbbrvName> + <DefaultFullName>decembra</DefaultFullName> + </Month> + </MonthsOfYear> + <Eras> + <Era> + <EraID>bc</EraID> + <DefaultAbbrvName>pred kr.</DefaultAbbrvName> + <DefaultFullName>pred kristom</DefaultFullName> + </Era> + <Era> + <EraID>ad</EraID> + <DefaultAbbrvName>po kr.</DefaultAbbrvName> + <DefaultFullName>po kristovi</DefaultFullName> + </Era> + </Eras> + <StartDayOfWeek> + <DayID>mon</DayID> + </StartDayOfWeek> + <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> + </Calendar> + </LC_CALENDAR> + <LC_CURRENCY> + <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>SKK</CurrencyID> + <CurrencySymbol>Sk</CurrencySymbol> + <BankSymbol>SKK</BankSymbol> + <CurrencyName>Koruna</CurrencyName> + <DecimalPlaces>2</DecimalPlaces> + </Currency> + </LC_CURRENCY> + <LC_TRANSLITERATION> + <Transliteration unoid="UPPERCASE_LOWERCASE"/> + <Transliteration unoid="IGNORE_CASE"/> + <Transliteration unoid="LOWERCASE_UPPERCASE" /> + </LC_TRANSLITERATION> + <LC_MISC> + <ReservedWords> + <trueWord>pravda</trueWord> + <falseWord>nepravda</falseWord> + <quarter1Word>1. štvrťrok</quarter1Word> + <quarter2Word>2. štvrťrok</quarter2Word> + <quarter3Word>3. štvrťrok</quarter3Word> + <quarter4Word>4. štvrťrok</quarter4Word> + <aboveWord>nad</aboveWord> + <belowWord>pod</belowWord> + <quarter1Abbreviation>Q1</quarter1Abbreviation> + <quarter2Abbreviation>Q2</quarter2Abbreviation> + <quarter3Abbreviation>Q3</quarter3Abbreviation> + <quarter4Abbreviation>Q4</quarter4Abbreviation> + </ReservedWords> + </LC_MISC> + <LC_NumberingLevel> + <NumberingLevel Prefix=" " NumType="4" Suffix=")" /> + <NumberingLevel Prefix=" " NumType="4" Suffix="." /> + <NumberingLevel Prefix="(" NumType="4" Suffix="." /> + <NumberingLevel Prefix=" " NumType="2" Suffix="." /> + <NumberingLevel Prefix=" " NumType="0" Suffix=")" /> + <NumberingLevel Prefix=" " NumType="1" Suffix=")" /> + <NumberingLevel Prefix="(" NumType="1" Suffix=")" /> + <NumberingLevel Prefix=" " NumType="3" Suffix="." /> + </LC_NumberingLevel> + <LC_OutLineNumberingLevel> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="1" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix="(" NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix="." BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="2" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="1" Suffix=")" BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="0" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="2" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="1" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="3" Suffix="." BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="1" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="2" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="3" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="4" Suffix=" " BulletChar="0020" BulletFontName="" ParentNumbering="4" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + <OutlineStyle> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="27A2" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="0" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="E006" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="50" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=")" BulletChar="E004" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="100" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="150" SymbolTextDistance="50" FirstLineOffset="0" /> + <OutLineNumberingLevel Prefix=" " NumType="6" Suffix=" " BulletChar="2022" BulletFontName="StarSymbol" ParentNumbering="0" LeftMargin="200" SymbolTextDistance="50" FirstLineOffset="0" /> + </OutlineStyle> + </LC_OutLineNumberingLevel> </Locale> diff --git a/i18npool/source/localedata/makefile.mk b/i18npool/source/localedata/makefile.mk index 847d1df7240b..6b7cbc4a9292 100644 --- a/i18npool/source/localedata/makefile.mk +++ b/i18npool/source/localedata/makefile.mk @@ -68,11 +68,13 @@ OBJFILES = \ $(OBJ)$/filewriter.obj APP1TARGET = saxparser +APP1RPATH = NONE APP1OBJS = $(OBJFILES) APP1STDLIBS = \ $(SALLIB) \ + $(SALHELPERLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) diff --git a/i18npool/source/textconversion/data/makefile.mk b/i18npool/source/textconversion/data/makefile.mk index f1e2652c23cc..37569e1f3fd7 100644 --- a/i18npool/source/textconversion/data/makefile.mk +++ b/i18npool/source/textconversion/data/makefile.mk @@ -65,7 +65,7 @@ LIB1OBJFILES=$(SHL1OBJS) APP1TARGET = genconv_dict $(MISC)$/%.cxx : %.dic - $(BIN)$/genconv_dict $* $< $@ + $(AUGMENT_LIBRARY_PATH) $(BIN)$/genconv_dict $* $< $@ # ugly - is this dependency really required here? $(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/genconv_dict$(EXECPOST) diff --git a/i18npool/source/textconversion/makefile.mk b/i18npool/source/textconversion/makefile.mk index e271205ed010..431abb1b513f 100644 --- a/i18npool/source/textconversion/makefile.mk +++ b/i18npool/source/textconversion/makefile.mk @@ -51,6 +51,7 @@ SLOFILES= \ OBJFILES = $(OBJ)$/genconv_dict.obj APP1TARGET = genconv_dict +APP1RPATH = NONE APP1OBJS = $(OBJ)$/genconv_dict.obj diff --git a/i18npool/source/transliteration/hiraganaToKatakana.cxx b/i18npool/source/transliteration/hiraganaToKatakana.cxx index 160bce6e4ff8..0a47316f004f 100644 --- a/i18npool/source/transliteration/hiraganaToKatakana.cxx +++ b/i18npool/source/transliteration/hiraganaToKatakana.cxx @@ -46,7 +46,7 @@ namespace com { namespace sun { namespace star { namespace i18n { // see http://charts.unicode.org/Web/U3040.html Hiragana (U+3040..U+309F) // see http://charts.unicode.org/Web/U30A0.html Katakana (U+30A0..U+30FF) static sal_Unicode toKatakana (const sal_Unicode c) { - if (0x3041 <= c && c <= 0x3096 || 0x309d <= c && c <= 0x309f) { // 3040 - 309F HIRAGANA LETTER + if ( (0x3041 <= c && c <= 0x3096) || (0x309d <= c && c <= 0x309f) ) { // 3040 - 309F HIRAGANA LETTER // shift code point by 0x0060 return c + (0x30a0 - 0x3040); } diff --git a/i18npool/source/transliteration/katakanaToHiragana.cxx b/i18npool/source/transliteration/katakanaToHiragana.cxx index 3cb78c717f7a..013173840760 100644 --- a/i18npool/source/transliteration/katakanaToHiragana.cxx +++ b/i18npool/source/transliteration/katakanaToHiragana.cxx @@ -43,7 +43,7 @@ namespace com { namespace sun { namespace star { namespace i18n { // see http://charts.unicode.org/Web/U30A0.html Katakana (U+30A0..U+30FF) static sal_Unicode toHiragana (const sal_Unicode c) { - if (0x30a1 <= c && c <= 0x30f6 || 0x30fd <= c && c <= 0x30ff) { // 30A0 - 30FF KATAKANA LETTER + if ( (0x30a1 <= c && c <= 0x30f6) || (0x30fd <= c && c <= 0x30ff) ) { // 30A0 - 30FF KATAKANA LETTER // shift code point by 0x0060 return c - (0x30a0 - 0x3040); } diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx index 401a2a5803f7..8a679b8afbe5 100644 --- a/i18nutil/source/utility/casefolding.cxx +++ b/i18nutil/source/utility/casefolding.cxx @@ -131,9 +131,13 @@ is_ja_voice_sound_mark(sal_Unicode& current, sal_Unicode next) sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, Locale& aLocale, sal_uInt8 nMappingType, TransliterationModules moduleLoaded) throw (RuntimeException) { + if( idx >= len ) + return 0; + sal_Unicode c; + if (moduleLoaded & TransliterationModules_IGNORE_CASE) { - if (e.current >= e.element.nmap && idx < len ) { + if( e.current >= e.element.nmap ) { e.element = getValue(str, idx++, len, aLocale, nMappingType); e.current = 0; } @@ -141,6 +145,7 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal } else { c = *(str + idx++); } + if (moduleLoaded & TransliterationModules_IGNORE_KANA) { if (0x3040 <= c && c <= 0x3094 || 0x309d <= c && c <= 0x309f) c += 0x60; @@ -154,7 +159,9 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal is_ja_voice_sound_mark(c, half2fullTable[*(str + idx)])) idx++; } + return c; } } } } } + diff --git a/o3tl/qa/makefile.mk b/o3tl/qa/makefile.mk index 5a71a7821325..563f4e2d3bf2 100644 --- a/o3tl/qa/makefile.mk +++ b/o3tl/qa/makefile.mk @@ -75,6 +75,6 @@ unittest : $(SHL1TARGETN) @echo ---------------------------------------------------------- @echo - start unit test on library $(SHL1TARGETN) @echo ---------------------------------------------------------- - testshl2 -sf $(mktmp ) $(SHL1TARGETN) + $(AUGMENT_LIBRARY_PATH) testshl2 -sf $(mktmp ) $(SHL1TARGETN) ALLTAR : unittest diff --git a/padmin/prj/build.lst b/padmin/prj/build.lst index 765675d73137..9aaab83cf7de 100644 --- a/padmin/prj/build.lst +++ b/padmin/prj/build.lst @@ -1,3 +1,3 @@ -pd padmin : psprint vcl svtools NULL +pd padmin : vcl svtools NULL pd padmin usr1 - all pd_mkout NULL pd padmin\source nmake - all pd_source NULL diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx index 587ddaad6595..c10be2d83fcd 100644 --- a/padmin/source/adddlg.cxx +++ b/padmin/source/adddlg.cxx @@ -29,15 +29,17 @@ ************************************************************************/ #include <unistd.h> -#include <vcl/msgbox.hxx> -#include <adddlg.hxx> -#include <newppdlg.hxx> -#include <cmddlg.hxx> -#ifndef _PAD_PADIALOG_HRC_ -#include <padialog.hrc> -#endif -#include <psprint/strhelper.hxx> -#include <osl/thread.h> + +#include "adddlg.hxx" +#include "newppdlg.hxx" +#include "cmddlg.hxx" +#include "padialog.hrc" + +#include "vcl/msgbox.hxx" +#include "vcl/strhelper.hxx" + +#include "osl/thread.h" + #include <hash_set> diff --git a/padmin/source/adddlg.hxx b/padmin/source/adddlg.hxx index c29390994bd4..e6fe17f30188 100644 --- a/padmin/source/adddlg.hxx +++ b/padmin/source/adddlg.hxx @@ -31,18 +31,15 @@ #ifndef _PAD_ADDDLG_HXX_ #define _PAD_ADDDLG_HXX_ -#include <vcl/dialog.hxx> -#include <vcl/tabpage.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/fixed.hxx> -#include <vcl/combobox.hxx> -#ifndef _PSP_PRINTERINFOMANAGER_HXX_ -#include <psprint/printerinfomanager.hxx> -#endif -#include <helper.hxx> -#include <titlectrl.hxx> +#include "helper.hxx" +#include "titlectrl.hxx" + +#include "vcl/dialog.hxx" +#include "vcl/tabpage.hxx" +#include "vcl/button.hxx" +#include "vcl/fixed.hxx" +#include "vcl/combobox.hxx" +#include "vcl/printerinfomanager.hxx" namespace padmin { diff --git a/padmin/source/fontentry.cxx b/padmin/source/fontentry.cxx index 29991c8193ea..d76171e704c1 100644 --- a/padmin/source/fontentry.cxx +++ b/padmin/source/fontentry.cxx @@ -28,25 +28,17 @@ * ************************************************************************/ -#include <vcl/msgbox.hxx> -#include <osl/thread.h> -#include <psprint/fontmanager.hxx> +#include "fontentry.hxx" +#include "helper.hxx" +#include "padialog.hrc" +#include "vcl/strhelper.hxx" -#ifndef _PAD_PADIALOG_HRC_ -#include <padialog.hrc> -#endif -#include <fontentry.hxx> -#include <helper.hxx> -#ifndef _CONFIG_HXX_ -#include <tools/config.hxx> -#endif -#include <psprint/strhelper.hxx> +#include "vcl/msgbox.hxx" +#include "vcl/fontmanager.hxx" -#if 0 -#include <convafm.hxx> -#include <progress.hxx> -#include <osl/file.hxx> -#endif +#include "osl/thread.h" + +#include "tools/config.hxx" using namespace padmin; using namespace osl; diff --git a/padmin/source/fontentry.hxx b/padmin/source/fontentry.hxx index dab60c6f2d99..30f53db97051 100644 --- a/padmin/source/fontentry.hxx +++ b/padmin/source/fontentry.hxx @@ -31,21 +31,18 @@ #ifndef _PAD_FONTENTRY_HXX_ #define _PAD_FONTENTRY_HXX_ -#include <vcl/timer.hxx> -#include <vcl/dialog.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/combobox.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/group.hxx> -#include <tools/urlobj.hxx> -#include <psprint/fontmanager.hxx> -#ifndef _PAD_PRGRESS_HXX -#include <progress.hxx> -#endif -#include <psprint/fontmanager.hxx> -#include <helper.hxx> +#include "progress.hxx" +#include "helper.hxx" + +#include "vcl/timer.hxx" +#include "vcl/dialog.hxx" +#include "vcl/button.hxx" +#include "vcl/combobox.hxx" +#include "vcl/lstbox.hxx" +#include "vcl/group.hxx" +#include "vcl/fontmanager.hxx" + +#include "tools/urlobj.hxx" namespace padmin { diff --git a/padmin/source/makefile.mk b/padmin/source/makefile.mk index 6edae757e8f6..63c2c2e5a6e1 100644 --- a/padmin/source/makefile.mk +++ b/padmin/source/makefile.mk @@ -83,12 +83,10 @@ SHL1OBJS=$(SLOFILES) SHL1STDLIBS=\ $(SVTOOLLIB) \ $(VCLLIB) \ - -lpsp$(DLLPOSTFIX) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) + $(COMPHELPERLIB) \ + $(CPPULIB) $(SALLIB) APP1TARGET=spadmin.bin APP1DEPN+=$(SHL1TARGETN) @@ -108,6 +106,10 @@ APP1STDLIBS= \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ + $(I18NISOLANGLIB) $(ICUUCLIB) $(ICULELIB) $(ICUDATALIB)\ + $(TKLIB) $(SOTLIB) $(SVLLIB) $(I18NUTILLIB) $(VOSLIB) \ + $(BASEGFXLIB) $(JVMFWKLIB) $(SALHELPERLIB) \ + $(JVMACCESSLIB) \ -lXext -lX11 UNIXTEXT = $(MISC)$/spadmin.sh diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx index 957e8a062a7e..8d5414a2ceef 100644 --- a/padmin/source/newppdlg.cxx +++ b/padmin/source/newppdlg.cxx @@ -30,22 +30,23 @@ #include <stdio.h> #include <unistd.h> -#include <psprint/ppdparser.hxx> -#include <psprint/helper.hxx> -#include <vcl/svapp.hxx> -#include <vcl/mnemonic.hxx> -#include <tools/urlobj.hxx> -#ifndef __SGI_STL_LIST + +#include "helper.hxx" +#include "padialog.hrc" +#include "newppdlg.hxx" +#include "padialog.hxx" +#include "progress.hxx" + +#include "vcl/ppdparser.hxx" +#include "vcl/helper.hxx" +#include "vcl/svapp.hxx" +#include "vcl/mnemonic.hxx" + +#include "tools/urlobj.hxx" + +#include "osl/file.hxx" + #include <list> -#endif -#include <osl/file.hxx> -#include <helper.hxx> -#ifndef _PAD_PADIALOG_HRC_ -#include <padialog.hrc> -#endif -#include <newppdlg.hxx> -#include <padialog.hxx> -#include <progress.hxx> #define PPDIMPORT_GROUP "PPDImport" diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx index 3e1d3496d17c..5b49409a1c8a 100644 --- a/padmin/source/padialog.cxx +++ b/padmin/source/padialog.cxx @@ -33,34 +33,33 @@ #include <unistd.h> #include <string.h> #include <math.h> -#include <vcl/msgbox.hxx> -#include <vcl/print.hxx> -#include <vcl/gradient.hxx> -#include <vcl/bitmap.hxx> -#include <vcl/lineinfo.hxx> -#include <vcl/svapp.hxx> -#include <vcl/event.hxx> -#include <tools/stream.hxx> -#include <tools/color.hxx> -#ifndef _PAD_PADIALOG_HRC_ -#include <padialog.hrc> -#endif -#include <fontentry.hxx> -#include <helper.hxx> -#ifndef _PSP_PRINTERINFOMANAGER_HXX_ -#include <psprint/printerinfomanager.hxx> -#endif -#include <padialog.hxx> -#include <adddlg.hxx> -#include <prtsetup.hxx> -#include <osl/file.hxx> -#include <unotools/localedatawrapper.hxx> -#include <unotools/configitem.hxx> -#include <unotools/configmgr.hxx> -#ifndef _RTL_USTRBUF_HXX -#include <rtl/ustrbuf.hxx> -#endif +#include "padialog.hrc" +#include "fontentry.hxx" +#include "helper.hxx" +#include "padialog.hxx" +#include "adddlg.hxx" +#include "prtsetup.hxx" + +#include "vcl/msgbox.hxx" +#include "vcl/print.hxx" +#include "vcl/gradient.hxx" +#include "vcl/bitmap.hxx" +#include "vcl/lineinfo.hxx" +#include "vcl/svapp.hxx" +#include "vcl/event.hxx" +#include "vcl/printerinfomanager.hxx" + +#include "tools/stream.hxx" +#include "tools/color.hxx" + +#include "osl/file.hxx" + +#include "rtl/ustrbuf.hxx" + +#include "unotools/localedatawrapper.hxx" +#include "unotools/configitem.hxx" +#include "unotools/configmgr.hxx" using namespace psp; using namespace rtl; using namespace padmin; diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index 1b363e710f7a..1a6894789bb5 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -28,14 +28,14 @@ * ************************************************************************/ -#include <psprint/fontmanager.hxx> -#include <prtsetup.hxx> -#include <helper.hxx> // for PaResId -#ifndef _PAD_RTSETUP_HRC_ -#include <rtsetup.hrc> -#endif -#include <cmddlg.hxx> -#include <osl/thread.h> +#include "prtsetup.hxx" +#include "helper.hxx" // for PaResId +#include "rtsetup.hrc" +#include "cmddlg.hxx" + +#include "vcl/fontmanager.hxx" + +#include "osl/thread.h" #define LSCAPE_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Landscape" ) ) #define PORTRAIT_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Portrait" ) ) diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx index 171f8bdf29f5..56e68336dfd8 100644 --- a/padmin/source/prtsetup.hxx +++ b/padmin/source/prtsetup.hxx @@ -31,22 +31,20 @@ #ifndef _PAD_PRTSETUP_HXX_ #define _PAD_PRTSETUP_HXX_ -#include <tools/link.hxx> -#include <vcl/tabdlg.hxx> -#include <vcl/tabpage.hxx> -#include <vcl/tabctrl.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/field.hxx> -#include <vcl/combobox.hxx> -#ifndef _PSPPRINT_PPDPARSER_HXX_ -#include <psprint/ppdparser.hxx> -#endif -#include <psprint/printerinfomanager.hxx> -#include <helper.hxx> +#include "helper.hxx" + +#include "tools/link.hxx" + +#include "vcl/tabdlg.hxx" +#include "vcl/tabpage.hxx" +#include "vcl/tabctrl.hxx" +#include "vcl/button.hxx" +#include "vcl/fixed.hxx" +#include "vcl/lstbox.hxx" +#include "vcl/field.hxx" +#include "vcl/combobox.hxx" +#include "vcl/ppdparser.hxx" +#include "vcl/printerinfomanager.hxx" namespace padmin { diff --git a/psprint/inc/makefile.mk b/psprint/inc/makefile.mk deleted file mode 100644 index d553bfa1eb94..000000000000 --- a/psprint/inc/makefile.mk +++ /dev/null @@ -1,51 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=.. - -PRJNAME=psprint -TARGET=inc - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.IF "$(ENABLE_PCH)"!="" -ALLTAR : \ - $(SLO)$/precompiled.pch \ - $(SLO)$/precompiled_ex.pch - -.ENDIF # "$(ENABLE_PCH)"!="" - diff --git a/psprint/inc/pch/precompiled_psprint.cxx b/psprint/inc/pch/precompiled_psprint.cxx deleted file mode 100644 index a3bafabe8e0a..000000000000 --- a/psprint/inc/pch/precompiled_psprint.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: precompiled_psprint.cxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "precompiled_psprint.hxx" - diff --git a/psprint/inc/pch/precompiled_psprint.hxx b/psprint/inc/pch/precompiled_psprint.hxx deleted file mode 100644 index 0cf979d35851..000000000000 --- a/psprint/inc/pch/precompiled_psprint.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: precompiled_psprint.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:54.170635 - -#ifdef PRECOMPILED_HEADERS -#endif - diff --git a/psprint/prj/build.lst b/psprint/prj/build.lst deleted file mode 100644 index 2161df02c527..000000000000 --- a/psprint/prj/build.lst +++ /dev/null @@ -1,9 +0,0 @@ -pp psprint : tools unotools cpputools jvmaccess SO:print_header jvmfwk NULL -pp psprint usr1 - all pp_mkout NULL -pp psprint\inc nmake - all pp_inc NULL -pp psprint\source\fontsubset nmake - all pp_fontsset pp_inc NULL -pp psprint\source\printer nmake - u pp_printer pp_inc NULL -pp psprint\source\fontmanager nmake - u pp_fontmgr pp_inc NULL -pp psprint\source\helper nmake - u pp_helper pp_inc NULL -pp psprint\source\printergfx nmake - u pp_printergfx pp_inc NULL -pp psprint\util nmake - all pp_util pp_fontmgr.u pp_fontsset pp_helper.u pp_printer.u pp_printergfx.u NULL diff --git a/psprint/prj/d.lst b/psprint/prj/d.lst deleted file mode 100644 index f11667bf9742..000000000000 --- a/psprint/prj/d.lst +++ /dev/null @@ -1,10 +0,0 @@ -mkdir: %_DEST%\inc%_EXT%\psprint - -..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% -..\%__SRC%\slb\apsp.lib %_DEST%\lib%_EXT%\apsp.lib -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib -..\%__SRC%\lib\libpsp.a %_DEST%\lib%_EXT%\libpsp.a - -..\inc\psprint\*.hxx %_DEST%\inc%_EXT%\psprint\*.hxx -..\source\fontsubset\sft.h %_DEST%\inc%_EXT%\psprint\sft.h -..\source\fontsubset\list.h %_DEST%\inc%_EXT%\psprint\list.h diff --git a/psprint/source/helper/makefile.mk b/psprint/source/helper/makefile.mk deleted file mode 100644 index 597a9a57f75f..000000000000 --- a/psprint/source/helper/makefile.mk +++ /dev/null @@ -1,65 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -ENABLE_EXCEPTIONS=TRUE -PRJNAME=psprint -TARGET=helper - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -.IF "$(GUIBASE)"=="aqua" - -dummy: - @echo "Nothing to build for GUIBASE $(GUIBASE)" - -.ELSE # "$(GUIBASE)"=="aqua" - -.IF "$(WITH_SYSTEM_PPD_DIR)" != "" -CDEFS += -DSYSTEM_PPD_DIR=\"$(WITH_SYSTEM_PPD_DIR)\" -.ENDIF - -SLOFILES=\ - $(SLO)$/ppdparser.obj \ - $(SLO)$/strhelper.obj \ - $(SLO)$/helper.obj - - -.ENDIF # GUIBASE = aqua - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/psprint/util/libpsp_linux.map b/psprint/util/libpsp_linux.map deleted file mode 100644 index 7a13241d269b..000000000000 --- a/psprint/util/libpsp_linux.map +++ /dev/null @@ -1,9 +0,0 @@ -LIBPSPRINT_1_0 { - global: - *psp*; - OpenTTFontBuffer; - CloseTTFont; - GetTTGlobalFontInfo; - local: - *; -}; diff --git a/psprint/util/libpsp_mingw.map b/psprint/util/libpsp_mingw.map deleted file mode 100644 index 8dabb61fd8ea..000000000000 --- a/psprint/util/libpsp_mingw.map +++ /dev/null @@ -1,12 +0,0 @@ -UDK_3_0_0 { - global: - *psp*; - OpenTTFontBuffer; - MapChar; - GetTTGlobalFontInfo; - GetTTSimpleGlyphMetrics; - CreateTTFromTTGlyphs; - CloseTTFont; - local: - *; -}; diff --git a/psprint/util/libpsp_solaris.map b/psprint/util/libpsp_solaris.map deleted file mode 100644 index 873189c2bb6f..000000000000 --- a/psprint/util/libpsp_solaris.map +++ /dev/null @@ -1,74 +0,0 @@ -{ - local: - AddTable; - cmapAdd; - CountTTCFonts; - CreateT3FromTTGlyphs; - CreateT42FromTTGlyphs; - CreateTTFromTTGlyphs; - DisposeNameRecords; - GetRawData; - GetTTGlyphComponents; - GetTTGlyphPoints; - GetTTNameRecords; - GetTTRawGlyphData; - GetTTSimpleCharMetrics; - GetTTSimpleGlyphMetrics; - glyfAdd; - glyfCount; - listAppend; - listClear; - listCount; - listCurrent; - listDispose; - listFind; - listIsEmpty; - listNewEmpty; - listNext; - listPositionAt; - listRemove; - listSetElementDtor; - listSkipForward; - listToFirst; - listToLast; - MapChar; - MapString; - modextra; - modname; - modver; - nameAdd; - OpenTTFontFile; - ReadGSUB; - RemoveTable; - StreamToFile; - StreamToMemory; - TranslateChar12; - TranslateChar13; - TranslateChar14; - TranslateChar15; - TranslateChar16; - TranslateString12; - TranslateString13; - TranslateString14; - TranslateString15; - TranslateString16; - TrueTypeCreatorDispose; - TrueTypeCreatorNewEmpty; - TrueTypeTableDispose; - TrueTypeTableNew; - TrueTypeTableNew_cmap; - TrueTypeTableNew_glyf; - TrueTypeTableNew_head; - TrueTypeTableNew_hhea; - TrueTypeTableNew_loca; - TrueTypeTableNew_maxp; - TrueTypeTableNew_name; - TrueTypeTableNew_post; - ulcodes; - UseGSUB; - xlat_1_2; - xlat_1_3; - xlat_1_4; - xlat_1_5; - xlat_1_6; -}; diff --git a/psprint/util/makefile.mk b/psprint/util/makefile.mk deleted file mode 100644 index cc0e73ae23e2..000000000000 --- a/psprint/util/makefile.mk +++ /dev/null @@ -1,87 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.24 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=psprint -TARGET=psp - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Windows, OS/2 and Mac OS X Aqua Targets ---------------------------- - -.IF "$(OS)"=="WNT" || "$(OS)"=="OS2" || "$(GUIBASE)"=="aqua" -LIB1ARCHIV=$(LB)$/lib$(TARGET).a -LIB1TARGET= $(SLB)$/a$(TARGET).lib -LIB1FILES= $(SLB)$/fontsubset.lib - -# --- Other Targets --- -.ELSE - -LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1FILES= $(SLB)$/fontman.lib \ - $(SLB)$/helper.lib \ - $(SLB)$/printer.lib \ - $(SLB)$/fontsubset.lib \ - $(SLB)$/gfx.lib - -SHL1TARGET= psp$(DLLPOSTFIX) -SHL1IMPLIB= ipsp -SHL1LIBS=$(LIB1FILES) - -.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC" -SHL1VERSIONMAP=libpsp_solaris.map -.ELSE # should work for all gcc/binutils based linker (ld) -SHL1VERSIONMAP=libpsp_linux.map -.ENDIF - -SHL1STDLIBS=$(UNOTOOLSLIB) \ - $(I18NISOLANGLIB) \ - $(TOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - -lX11 - -.IF "$(LIBPAPER_LINK)" == "YES" -SHL1STDLIBS += -lpaper -.ENDIF - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -.ENDIF # "$(OS)"=="WNT" - -# --- Targets ------------------------------------------------------------ - - -.INCLUDE : target.mk diff --git a/rsc/source/prj/makefile.mk b/rsc/source/prj/makefile.mk index a82a593dfacb..1de2d2dd0f8f 100644 --- a/rsc/source/prj/makefile.mk +++ b/rsc/source/prj/makefile.mk @@ -46,7 +46,7 @@ OBJFILES= $(OBJ)$/gui.obj \ $(OBJ)$/start.obj APP1TARGET= rsc -APP1STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) # $(RTLLIB) +APP1STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) APP1LIBS= $(LB)$/rsctoo.lib APP1OBJS= $(OBJ)$/start.obj .IF "$(GUI)" != "OS2" @@ -54,6 +54,7 @@ APP1OBJS= $(OBJ)$/start.obj APP1STACK=64000 #APP1STACK=32768 .ENDIF +APP1RPATH=NONE APP2TARGET= rsc2 .IF "$(OS)"=="SCO" @@ -61,7 +62,7 @@ APP2TARGET= rsc2 # rsc2 muss daher statisch gelinkt werden APP2STDLIBS=$(STATIC) -latools $(BPICONVLIB) $(VOSLIB) $(OSLLIB) $(RTLLIB) $(DYNAMIC) .ELSE -APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) #RTLLIB) +APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB) $(VOSLIB) $(SALLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) .ENDIF APP2LIBS= $(LB)$/rsctoo.lib \ $(LB)$/rscres.lib \ @@ -74,6 +75,7 @@ APP2OBJS= $(OBJ)$/gui.obj APP2STACK=64000 #APP2STACK=32768 .ENDIF +APP2RPATH=NONE # --- Targets ------------------------------------------------------------ diff --git a/svtools/bmpmaker/makefile.mk b/svtools/bmpmaker/makefile.mk index d5280a2ab500..b5575ab77d23 100644 --- a/svtools/bmpmaker/makefile.mk +++ b/svtools/bmpmaker/makefile.mk @@ -54,6 +54,10 @@ APP1TARGET= $(TARGET) APP1STDLIBS = \ $(VCLLIB) \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ + $(UNOTOOLSLIB) \ + $(ICUDATALIB) $(ICUUCLIB) $(ICULELIB) \ + $(SOTLIB) $(I18NUTILLIB) $(JVMACCESSLIB) \ $(VOSLIB) \ $(SALLIB) @@ -70,7 +74,11 @@ APP2OBJS = $(OBJ)$/bmpsum.obj APP2STDLIBS = $(VCLLIB) \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ + $(UNOTOOLSLIB) \ + $(ICUDATALIB) $(ICUUCLIB) $(ICULELIB) \ + $(SOTLIB) $(I18NUTILLIB) $(JVMACCESSLIB) \ $(SALLIB) # --- Targets ------------------------------------------------------ diff --git a/svtools/inc/fileview.hxx b/svtools/inc/fileview.hxx index 47254ed83b5d..7527436e0f38 100644 --- a/svtools/inc/fileview.hxx +++ b/svtools/inc/fileview.hxx @@ -40,6 +40,7 @@ #include <vcl/button.hxx> #endif #include <vcl/dialog.hxx> +#include <rtl/ustring.hxx> // class SvtFileView ----------------------------------------------------- @@ -84,6 +85,8 @@ class SVT_DLLPUBLIC SvtFileView : public Control private: SvtFileView_Impl* mpImp; + ::com::sun::star::uno::Sequence< ::rtl::OUString > mpBlackList; + SVT_DLLPRIVATE void OpenFolder( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aContents ); DECL_DLLPRIVATE_LINK( HeaderSelect_Impl, HeaderBar * ); @@ -123,9 +126,14 @@ public: FileViewResult Initialize( const String& rFolderURL, const String& rFilter, - const FileViewAsyncAction* pAsyncDescriptor + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ); + FileViewResult Initialize( + const String& rFolderURL, + const String& rFilter, + const FileViewAsyncAction* pAsyncDescriptor ); /** initialze the view with a sequence of contents, which have already been obtained elsewhere This method will never return <member>eStillRunning</member>, since it will fill the @@ -135,7 +143,8 @@ public: /** initializes the view with the content of a folder given by an UCB content */ - sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent, const String& rFilter ); + sal_Bool Initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent, + const String& rFilter ); /** reads the current content of the current folder again, and applies the given filter to it diff --git a/svtools/inc/svtools/documentlockfile.hxx b/svtools/inc/svtools/documentlockfile.hxx index 73e64f4f04a5..f2625f7955bb 100644 --- a/svtools/inc/svtools/documentlockfile.hxx +++ b/svtools/inc/svtools/documentlockfile.hxx @@ -41,44 +41,25 @@ #include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <osl/mutex.hxx> - -// TODO/LATER: should be combined with sharecontrolfile -#define LOCKFILE_OOOUSERNAME_ID 0 -#define LOCKFILE_SYSUSERNAME_ID 1 -#define LOCKFILE_LOCALHOST_ID 2 -#define LOCKFILE_EDITTIME_ID 3 -#define LOCKFILE_USERURL_ID 4 -#define LOCKFILE_ENTRYSIZE 5 +#include <svtools/lockfilecommon.hxx> namespace svt { -class SVT_DLLPUBLIC DocumentLockFile +class SVT_DLLPUBLIC DocumentLockFile : public LockFileCommon { // the workaround for automated testing! static sal_Bool m_bAllowInteraction; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - ::rtl::OUString m_aURL; - - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenStream(); void WriteEntryToStream( ::com::sun::star::uno::Sequence< ::rtl::OUString > aEntry, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xStream ); - ::com::sun::star::uno::Sequence< ::rtl::OUString > ParseEntry( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer ); - ::rtl::OUString ParseName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); - ::rtl::OUString EscapeCharacters( const ::rtl::OUString& aSource ); - ::rtl::OUString GetOOOUserName(); - ::rtl::OUString GetCurrentLocalTime(); - public: DocumentLockFile( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ); ~DocumentLockFile(); sal_Bool CreateOwnLockFile(); ::com::sun::star::uno::Sequence< ::rtl::OUString > GetLockData(); - ::com::sun::star::uno::Sequence< ::rtl::OUString > GenerateOwnEntry(); sal_Bool OverwriteOwnLockFile(); void RemoveFile(); diff --git a/svtools/inc/svtools/itempool.hxx b/svtools/inc/svtools/itempool.hxx index 3b08b44aece5..81407cee2d0c 100644 --- a/svtools/inc/svtools/itempool.hxx +++ b/svtools/inc/svtools/itempool.hxx @@ -41,6 +41,7 @@ #include <tools/string.hxx> #include <svtools/svarray.hxx> #include <svtools/poolitem.hxx> +#include <vector> class SvStream; class SfxBroadcaster; @@ -80,6 +81,15 @@ struct SfxItemInfo class SfxStyleSheetIterator; struct SfxPoolItemArray_Impl; +class SfxItemPool; + +class SVL_DLLPUBLIC SfxItemPoolUser +{ +public: + virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool) = 0; +}; + +typedef ::std::vector< SfxItemPoolUser* > SfxItemPoolUserVector; class SVL_DLLPUBLIC SfxItemPool @@ -116,6 +126,14 @@ class SVL_DLLPUBLIC SfxItemPool USHORT* _pPoolRanges; FASTBOOL bPersistentRefCounts; +private: + // ObjectUser section + SfxItemPoolUserVector maSfxItemPoolUsers; + +public: + void AddSfxItemPoolUser(SfxItemPoolUser& rNewUser); + void RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser); + //--------------------------------------------------------------------- #ifndef _SFXITEMS_HXX @@ -156,7 +174,10 @@ public: USHORT *pSlotIds = 0, #endif FASTBOOL bLoadRefCounts = TRUE ); +protected: virtual ~SfxItemPool(); +public: + static void Free(SfxItemPool* pPool); SfxBroadcaster& BC(); diff --git a/svtools/inc/svtools/langtab.hxx b/svtools/inc/svtools/langtab.hxx index 9117159b1a3c..3a70525bb450 100644 --- a/svtools/inc/svtools/langtab.hxx +++ b/svtools/inc/svtools/langtab.hxx @@ -52,6 +52,9 @@ public: LanguageType GetTypeAtIndex( sal_uInt32 nIndex ) const; }; +// Add LRE or RLE embedding characters to the string based on the +// String content (see #i78466#, #i32179#) +SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ); #endif diff --git a/svtools/inc/svtools/lockfilecommon.hxx b/svtools/inc/svtools/lockfilecommon.hxx new file mode 100644 index 000000000000..c8bd6251f9cb --- /dev/null +++ b/svtools/inc/svtools/lockfilecommon.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: documentlockfile.hxx,v $ + * + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVT_LOCKFILECOMMON_HXX +#define _SVT_LOCKFILECOMMON_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <osl/mutex.hxx> +#include <tools/urlobj.hxx> + +#define LOCKFILE_OOOUSERNAME_ID 0 +#define LOCKFILE_SYSUSERNAME_ID 1 +#define LOCKFILE_LOCALHOST_ID 2 +#define LOCKFILE_EDITTIME_ID 3 +#define LOCKFILE_USERURL_ID 4 +#define LOCKFILE_ENTRYSIZE 5 + +namespace svt { + +// This is a general implementation that is used in document lock file implementation and in sharing control file implementation +class SVT_DLLPUBLIC LockFileCommon +{ +protected: + ::osl::Mutex m_aMutex; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; + ::rtl::OUString m_aURL; + + + INetURLObject ResolveLinks( const INetURLObject& aDocURL ); + +public: + LockFileCommon( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, const ::rtl::OUString& aPrefix ); + ~LockFileCommon(); + + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > ParseList( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > ParseEntry( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); + static ::rtl::OUString ParseName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); + static ::rtl::OUString EscapeCharacters( const ::rtl::OUString& aSource ); + static ::rtl::OUString GetOOOUserName(); + static ::rtl::OUString GetCurrentLocalTime(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > GenerateOwnEntry(); +}; + +} + +#endif + diff --git a/svtools/inc/svtools/optionsdrawinglayer.hxx b/svtools/inc/svtools/optionsdrawinglayer.hxx index 4e97de7d6792..e0b287002f34 100644 --- a/svtools/inc/svtools/optionsdrawinglayer.hxx +++ b/svtools/inc/svtools/optionsdrawinglayer.hxx @@ -175,12 +175,18 @@ class SVL_DLLPUBLIC SvtOptionsDrawinglayer // primitives sal_Bool IsAntiAliasing() const; + sal_Bool IsSnapHorVerLinesToDiscrete() const; sal_Bool IsSolidDragCreate() const; + sal_Bool IsRenderDecoratedTextDirect() const; + sal_Bool IsRenderSimpleTextDirect() const; sal_uInt32 GetQuadratic3DRenderLimit() const; sal_uInt32 GetQuadraticFormControlRenderLimit() const; void SetAntiAliasing( sal_Bool bState ); + void SetSnapHorVerLinesToDiscrete( sal_Bool bState ); void SetSolidDragCreate( sal_Bool bState ); + void SetRenderDecoratedTextDirect( sal_Bool bState ); + void SetRenderSimpleTextDirect( sal_Bool bState ); void SetQuadratic3DRenderLimit(sal_uInt32 nNew); void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew); diff --git a/svtools/inc/svtools/sharecontrolfile.hxx b/svtools/inc/svtools/sharecontrolfile.hxx index 2ab0d48a72f9..8735f8c5ccf7 100644 --- a/svtools/inc/svtools/sharecontrolfile.hxx +++ b/svtools/inc/svtools/sharecontrolfile.hxx @@ -40,24 +40,19 @@ #include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <osl/mutex.hxx> +#include <svtools/lockfilecommon.hxx> -#define SHARED_OOOUSERNAME_ID 0 -#define SHARED_SYSUSERNAME_ID 1 -#define SHARED_LOCALHOST_ID 2 -#define SHARED_EDITTIME_ID 3 -#define SHARED_USERURL_ID 4 -#define SHARED_ENTRYSIZE 5 +#define SHARED_OOOUSERNAME_ID LOCKFILE_OOOUSERNAME_ID +#define SHARED_SYSUSERNAME_ID LOCKFILE_SYSUSERNAME_ID +#define SHARED_LOCALHOST_ID LOCKFILE_LOCALHOST_ID +#define SHARED_EDITTIME_ID LOCKFILE_EDITTIME_ID +#define SHARED_USERURL_ID LOCKFILE_USERURL_ID +#define SHARED_ENTRYSIZE LOCKFILE_ENTRYSIZE namespace svt { -class SVT_DLLPUBLIC ShareControlFile +class SVT_DLLPUBLIC ShareControlFile : public LockFileCommon { - ::osl::Mutex m_aMutex; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - - ::rtl::OUString m_aURL; - ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOutputStream; @@ -73,14 +68,6 @@ class SVT_DLLPUBLIC ShareControlFile return ( m_xFactory.is() && m_xStream.is() && m_xInputStream.is() && m_xOutputStream.is() && m_xSeekable.is() && m_xTruncate.is() ); } - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > ParseList( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer ); - ::com::sun::star::uno::Sequence< ::rtl::OUString > ParseEntry( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); - ::rtl::OUString ParseName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); - ::rtl::OUString EscapeCharacters( const ::rtl::OUString& aSource ); - ::rtl::OUString GetOOOUserName(); - ::rtl::OUString GetCurrentLocalTime(); - ::com::sun::star::uno::Sequence< ::rtl::OUString > GenerateOwnEntry(); - public: // The constructor will throw exception in case the stream can not be opened diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx index ac93cb16d13a..c3e9ea21dca9 100644 --- a/svtools/inc/svtools/transfer.hxx +++ b/svtools/inc/svtools/transfer.hxx @@ -204,8 +204,8 @@ private: mutable ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTerminateListener > mxTerminateListener; DataFlavorExVector* mpFormats; + TransferableObjectDescriptor* mpObjDesc; void* mpDummy1; - void* mpDummy2; protected: inline const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& @@ -288,6 +288,8 @@ public: TransferableHelper(); + void PrepareOLE( const TransferableObjectDescriptor& rObjDesc ); + void CopyToClipboard( Window *pWindow ) const; void CopyToSelection( Window *pWindow ) const; void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions, @@ -319,7 +321,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > mxTransfer; ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard; DataFlavorExVector* mpFormats; - void* mpDummy2; + TransferableObjectDescriptor* mpObjDesc; TransferableDataHelper_Impl* mpImpl; void* mpDummy4; diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx index 67fe34517ce1..c5be561fec9d 100644 --- a/svtools/inc/tabbar.hxx +++ b/svtools/inc/tabbar.hxx @@ -478,10 +478,22 @@ public: BOOL IsEditModeCanceled() const { return mbEditCanceled; } USHORT GetEditPageId() const { return mnEditId; } - /** Mirrors the entire control. It will draw RTL in LTR GUI, and vice versa. */ + /** Mirrors the entire control including position of buttons and splitter. + Mirroring is done relative to the current direction of the GUI. + @param bMirrored TRUE = the control will draw itself RTL in LTR GUI, + and vice versa; FALSE = the control behaves according to the + current direction of the GUI. */ void SetMirrored( BOOL bMirrored = TRUE ); + /** Returns TRUE, if the control is set to mirrored mode (see SetMirrored()). */ BOOL IsMirrored() const { return mbMirrored; } + /** Sets the control to LTR or RTL mode regardless of the GUI direction. + @param bRTL FALSE = the control will draw from left to right; + TRUE = the control will draw from right to left. */ + void SetEffectiveRTL( BOOL bRTL ); + /** Returns TRUE, if the control draws from right to left (see SetEffectiveRTL()). */ + BOOL IsEffectiveRTL() const; + BOOL StartDrag( const CommandEvent& rCEvt, Region& rRegion ); USHORT ShowDropPos( const Point& rPos ); void HideDropPos(); diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst index bd3f87f0e2b3..6b85194db6c1 100644 --- a/svtools/prj/d.lst +++ b/svtools/prj/d.lst @@ -110,6 +110,7 @@ mkdir: %_DEST%\inc%_EXT%\svtools ..\inc\scrwin.hxx %_DEST%\inc%_EXT%\svtools\scrwin.hxx ..\inc\svtools\sharecontrolfile.hxx %_DEST%\inc%_EXT%\svtools\sharecontrolfile.hxx ..\inc\svtools\documentlockfile.hxx %_DEST%\inc%_EXT%\svtools\documentlockfile.hxx +..\inc\svtools\lockfilecommon.hxx %_DEST%\inc%_EXT%\svtools\lockfilecommon.hxx ..\inc\svtools\slstitm.hxx %_DEST%\inc%_EXT%\svtools\slstitm.hxx ..\inc\svtools\ilstitem.hxx %_DEST%\inc%_EXT%\svtools\ilstitem.hxx ..\inc\svtools\smplhint.hxx %_DEST%\inc%_EXT%\svtools\smplhint.hxx diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 526af00e5b5f..05ab0e1b0c91 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -1683,10 +1683,12 @@ BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection ) CursorMoved(); if ( !bMultiSelection && !bKeepSelection ) + { if ( !bSelecting ) Select(); else bSelect = TRUE; + } return TRUE; } @@ -1727,10 +1729,12 @@ BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove USHORT nFrozen = FrozenColCount(); if ( bMakeVisible && nLastPos && nNewPos >= nFrozen && ( nNewPos < nFirstPos || nNewPos > nLastPos ) ) + { if ( nNewPos < nFirstPos ) ScrollColumns( nNewPos-nFirstPos ); else if ( nNewPos > nLastPos ) ScrollColumns( nNewPos-nLastPos ); + } DoShowCursor( "GoToColumnId" ); if (!bRowColMove) diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index ca418de8cba9..0c39fde11390 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -562,13 +562,13 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) COL_BLUE, // BASICOPERATOR , COL_BLUE, // BASICKEYWORD , COL_RED, //BASICERROR - 0xF84E4E, // SQLIDENTIFIER - 0xCC66CC, // SQLNUMBER - 0x7CDB8C, // SQLSTRING - COL_BLACK, // SQLOPERATOR - 0x0000FF, // SQLKEYWORD + 0x009900, // SQLIDENTIFIER + 0x000000, // SQLNUMBER + 0xCE7B00, // SQLSTRING + 0x000000, // SQLOPERATOR + 0x0000E6, // SQLKEYWORD 0x259D9D, // SQLPARAMTER - COL_GRAY,// SQLCOMMENT + 0x969696,// SQLCOMMENT }; Color aRet; switch(eEntry) diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index c63dc2154c55..125827d17faf 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -85,7 +85,10 @@ using namespace ::com::sun::star::uno ; // primitives #define DEFAULT_ANTIALIASING sal_True +#define DEFAULT_SNAPHORVERLINESTODISCRETE sal_True #define DEFAULT_SOLIDDRAGCREATE sal_True +#define DEFAULT_RENDERDECORATEDTEXTDIRECT sal_True +#define DEFAULT_RENDERSIMPLETEXTDIRECT sal_True #define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000 #define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000 @@ -115,7 +118,10 @@ using namespace ::com::sun::star::uno ; // primitives #define PROPERTYNAME_ANTIALIASING OUString(RTL_CONSTASCII_USTRINGPARAM("AntiAliasing")) +#define PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString(RTL_CONSTASCII_USTRINGPARAM("SnapHorVerLinesToDiscrete")) #define PROPERTYNAME_SOLIDDRAGCREATE OUString(RTL_CONSTASCII_USTRINGPARAM("SolidDragCreate")) +#define PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderDecoratedTextDirect")) +#define PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderSimpleTextDirect")) #define PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("Quadratic3DRenderLimit")) #define PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("QuadraticFormControlRenderLimit")) @@ -145,11 +151,14 @@ using namespace ::com::sun::star::uno ; // primitives #define PROPERTYHANDLE_ANTIALIASING 17 -#define PROPERTYHANDLE_SOLIDDRAGCREATE 18 -#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 19 -#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 20 +#define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18 +#define PROPERTYHANDLE_SOLIDDRAGCREATE 19 +#define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20 +#define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21 +#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22 +#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23 -#define PROPERTYCOUNT 21 +#define PROPERTYCOUNT 24 class SvtOptionsDrawinglayer_Impl : public ConfigItem { @@ -224,12 +233,18 @@ public: // primitives sal_Bool IsAntiAliasing() const; + sal_Bool IsSnapHorVerLinesToDiscrete() const; sal_Bool IsSolidDragCreate() const; + sal_Bool IsRenderDecoratedTextDirect() const; + sal_Bool IsRenderSimpleTextDirect() const; sal_uInt32 GetQuadratic3DRenderLimit() const; sal_uInt32 GetQuadraticFormControlRenderLimit() const; void SetAntiAliasing( sal_Bool bState ); + void SetSnapHorVerLinesToDiscrete( sal_Bool bState ); void SetSolidDragCreate( sal_Bool bState ); + void SetRenderDecoratedTextDirect( sal_Bool bState ); + void SetRenderSimpleTextDirect( sal_Bool bState ); void SetQuadratic3DRenderLimit(sal_uInt32 nNew); void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew); @@ -273,7 +288,10 @@ private: // primitives sal_Bool m_bAntiAliasing; + sal_Bool m_bSnapHorVerLinesToDiscrete; sal_Bool m_bSolidDragCreate; + sal_Bool m_bRenderDecoratedTextDirect; + sal_Bool m_bRenderSimpleTextDirect; sal_uInt32 m_nQuadratic3DRenderLimit; sal_uInt32 m_nQuadraticFormControlRenderLimit; @@ -317,7 +335,10 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : // primitives m_bAntiAliasing(DEFAULT_ANTIALIASING), + m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE), m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE), + m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT), + m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT), m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT), m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT), @@ -474,6 +495,14 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : } break; + // primitives + case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE: + { + DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" ); + seqValues[nProperty] >>= m_bSnapHorVerLinesToDiscrete; + } + break; + case PROPERTYHANDLE_SOLIDDRAGCREATE: { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" ); @@ -481,6 +510,20 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : } break; + case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT: + { + DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" ); + seqValues[nProperty] >>= m_bRenderDecoratedTextDirect; + } + break; + + case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT: + { + DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" ); + seqValues[nProperty] >>= m_bRenderSimpleTextDirect; + } + break; + case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT: { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" ); @@ -595,10 +638,22 @@ void SvtOptionsDrawinglayer_Impl::Commit() aSeqValues[nProperty] <<= m_bAntiAliasing; break; + case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE: + aSeqValues[nProperty] <<= m_bSnapHorVerLinesToDiscrete; + break; + case PROPERTYHANDLE_SOLIDDRAGCREATE: aSeqValues[nProperty] <<= m_bSolidDragCreate; break; + case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT: + aSeqValues[nProperty] <<= m_bRenderDecoratedTextDirect; + break; + + case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT: + aSeqValues[nProperty] <<= m_bRenderSimpleTextDirect; + break; + case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT: aSeqValues[nProperty] <<= m_nQuadratic3DRenderLimit; break; @@ -917,11 +972,26 @@ sal_Bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const return m_bAntiAliasing; } +sal_Bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const +{ + return m_bSnapHorVerLinesToDiscrete; +} + sal_Bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const { return m_bSolidDragCreate; } +sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const +{ + return m_bRenderDecoratedTextDirect; +} + +sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const +{ + return m_bRenderSimpleTextDirect; +} + sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const { return m_nQuadratic3DRenderLimit; @@ -941,6 +1011,15 @@ void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState ) } } +void SvtOptionsDrawinglayer_Impl::SetSnapHorVerLinesToDiscrete( sal_Bool bState ) +{ + if(m_bSnapHorVerLinesToDiscrete != bState) + { + m_bSnapHorVerLinesToDiscrete = bState; + SetModified(); + } +} + void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState ) { if(m_bSolidDragCreate != bState) @@ -950,6 +1029,24 @@ void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState ) } } +void SvtOptionsDrawinglayer_Impl::SetRenderDecoratedTextDirect( sal_Bool bState ) +{ + if(m_bRenderDecoratedTextDirect != bState) + { + m_bRenderDecoratedTextDirect = bState; + SetModified(); + } +} + +void SvtOptionsDrawinglayer_Impl::SetRenderSimpleTextDirect( sal_Bool bState ) +{ + if(m_bRenderSimpleTextDirect != bState) + { + m_bRenderSimpleTextDirect = bState; + SetModified(); + } +} + void SvtOptionsDrawinglayer_Impl::SetQuadratic3DRenderLimit(sal_uInt32 nNew) { if(m_nQuadratic3DRenderLimit != nNew) @@ -1002,7 +1099,10 @@ Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames() // primitives PROPERTYNAME_ANTIALIASING, + PROPERTYNAME_SNAPHORVERLINESTODISCRETE, PROPERTYNAME_SOLIDDRAGCREATE, + PROPERTYNAME_RENDERDECORATEDTEXTDIRECT, + PROPERTYNAME_RENDERSIMPLETEXTDIRECT, PROPERTYNAME_QUADRATIC3DRENDERLIMIT, PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT }; @@ -1308,12 +1408,30 @@ sal_Bool SvtOptionsDrawinglayer::IsAntiAliasing() const return m_pDataContainer->IsAntiAliasing() && IsAAPossibleOnThisSystem(); } +sal_Bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + return m_pDataContainer->IsAntiAliasing() && m_pDataContainer->IsSnapHorVerLinesToDiscrete(); +} + sal_Bool SvtOptionsDrawinglayer::IsSolidDragCreate() const { MutexGuard aGuard( GetOwnStaticMutex() ); return m_pDataContainer->IsSolidDragCreate(); } +sal_Bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + return m_pDataContainer->IsRenderDecoratedTextDirect(); +} + +sal_Bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + return m_pDataContainer->IsRenderSimpleTextDirect(); +} + sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const { MutexGuard aGuard( GetOwnStaticMutex() ); @@ -1332,12 +1450,30 @@ void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState ) m_pDataContainer->SetAntiAliasing( bState ); } +void SvtOptionsDrawinglayer::SetSnapHorVerLinesToDiscrete( sal_Bool bState ) +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + m_pDataContainer->SetSnapHorVerLinesToDiscrete( bState ); +} + void SvtOptionsDrawinglayer::SetSolidDragCreate( sal_Bool bState ) { MutexGuard aGuard( GetOwnStaticMutex() ); m_pDataContainer->SetSolidDragCreate( bState ); } +void SvtOptionsDrawinglayer::SetRenderDecoratedTextDirect( sal_Bool bState ) +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + m_pDataContainer->SetRenderDecoratedTextDirect( bState ); +} + +void SvtOptionsDrawinglayer::SetRenderSimpleTextDirect( sal_Bool bState ) +{ + MutexGuard aGuard( GetOwnStaticMutex() ); + m_pDataContainer->SetRenderSimpleTextDirect( bState ); +} + void SvtOptionsDrawinglayer::SetQuadratic3DRenderLimit(sal_uInt32 nNew) { MutexGuard aGuard( GetOwnStaticMutex() ); diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx index 828be6fb8e62..af379db9b12b 100644 --- a/svtools/source/contnr/contentenumeration.cxx +++ b/svtools/source/contnr/contentenumeration.cxx @@ -105,6 +105,7 @@ namespace svt ,m_pFilter ( NULL ) ,m_pTranslator ( _pTranslator ) ,m_bCancelled ( false ) + ,m_rBlackList ( ::com::sun::star::uno::Sequence< ::rtl::OUString >() ) { } @@ -126,13 +127,17 @@ namespace svt } //-------------------------------------------------------------------- - EnumerationResult FileViewContentEnumerator::enumerateFolderContentSync( const FolderDescriptor& _rFolder, const IUrlFilter* _pFilter ) + EnumerationResult FileViewContentEnumerator::enumerateFolderContentSync( + const FolderDescriptor& _rFolder, + const IUrlFilter* _pFilter, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { { ::osl::MutexGuard aGuard( m_aMutex ); m_aFolder = _rFolder; m_pFilter = _pFilter; m_pResultHandler = NULL; + m_rBlackList = rBlackList; } return enumerateFolderContent(); } @@ -273,6 +278,9 @@ namespace svt ::osl::MutexGuard aGuard( m_aMutex ); if ( m_pFilter && !m_pFilter->isUrlAllowed( sRealURL ) ) continue; + + if ( /* m_rBlackList.hasElements() && */ URLOnBlackList ( sRealURL ) ) + continue; } pData = new SortingData_Impl; @@ -387,6 +395,21 @@ namespace svt } //-------------------------------------------------------------------- + + sal_Bool FileViewContentEnumerator::URLOnBlackList ( const ::rtl::OUString& sRealURL ) + { + ::rtl::OUString entryName = sRealURL.copy( sRealURL.lastIndexOf( rtl::OUString::createFromAscii("/")) +1 ); + + for (int i = 0; i < m_rBlackList.getLength() ; i++) + { + if ( entryName.equals( m_rBlackList[i] ) ) + return true; + } + + return false; + } + + //-------------------------------------------------------------------- sal_Bool FileViewContentEnumerator::implGetDocTitle( const OUString& _rTargetURL, OUString& _rRet ) const { sal_Bool bRet = sal_False; diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx index be7cb62a7b23..dd6c3e727f05 100644 --- a/svtools/source/contnr/contentenumeration.hxx +++ b/svtools/source/contnr/contentenumeration.hxx @@ -58,6 +58,7 @@ namespace svt ::rtl::OUString maTitle; // -> be carefull when changing maTitle to update maFilename only when new ::rtl::OUString maLowerTitle; + public: ::rtl::OUString maType; ::rtl::OUString maTargetURL; @@ -209,6 +210,10 @@ namespace svt mutable ::com::sun::star::uno::Reference< ::com::sun::star::document::XStandaloneDocumentInfo > m_xDocInfo; + ::com::sun::star::uno::Sequence< ::rtl::OUString > m_rBlackList; + + sal_Bool URLOnBlackList ( const ::rtl::OUString& sRealURL ); + public: /** constructs an enumerator instance @@ -245,7 +250,8 @@ namespace svt */ EnumerationResult enumerateFolderContentSync( const FolderDescriptor& _rFolder, - const IUrlFilter* _pFilter + const IUrlFilter* _pFilter, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); /** cancels the running operation. diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index ade5841a1f7a..d56c270fd5a8 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -557,6 +557,7 @@ protected: bool m_bRunningAsyncAction; bool m_bAsyncActionCancelled; + public: ::std::vector< SortingData_Impl* > maContent; @@ -588,8 +589,15 @@ public: void Clear(); - FileViewResult GetFolderContent_Impl( const String& rFolder, const FileViewAsyncAction* pAsyncDescriptor ); - FileViewResult GetFolderContent_Impl( const FolderDescriptor& _rFolder, const FileViewAsyncAction* pAsyncDescriptor ); + FileViewResult GetFolderContent_Impl( + const String& rFolder, + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); + + FileViewResult GetFolderContent_Impl( + const FolderDescriptor& _rFolder, + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >()); void FilterFolderContent_Impl( const OUString &rFilter ); void CancelRunningAsyncAction(); @@ -1281,7 +1289,7 @@ FileViewResult SvtFileView::PreviousLevel( const FileViewAsyncAction* pAsyncDesc String sParentURL; if ( GetParentURL( sParentURL ) ) - eResult = Initialize( sParentURL, mpImp->maCurrentFilter, pAsyncDescriptor ); + eResult = Initialize( sParentURL, mpImp->maCurrentFilter, pAsyncDescriptor, mpBlackList ); return eResult; } @@ -1367,9 +1375,14 @@ sal_Bool SvtFileView::Initialize( const ::com::sun::star::uno::Reference< ::com: } // ----------------------------------------------------------------------- -FileViewResult SvtFileView::Initialize( const String& rURL, const String& rFilter, const FileViewAsyncAction* pAsyncDescriptor ) +FileViewResult SvtFileView::Initialize( + const String& rURL, + const String& rFilter, + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { WaitObject aWaitCursor( this ); + mpBlackList = rBlackList; String sPushURL( mpImp->maViewURL ); @@ -1393,6 +1406,17 @@ FileViewResult SvtFileView::Initialize( const String& rURL, const String& rFilte } // ----------------------------------------------------------------------- +FileViewResult SvtFileView::Initialize( + const String& rURL, + const String& rFilter, + const FileViewAsyncAction* pAsyncDescriptor ) +{ + return Initialize( rURL, rFilter, pAsyncDescriptor, ::com::sun::star::uno::Sequence< ::rtl::OUString >()); +} + +// ----------------------------------------------------------------------- + +// ----------------------------------------------------------------------- sal_Bool SvtFileView::Initialize( const Sequence< OUString >& aContents ) { WaitObject aWaitCursor( this ); @@ -1419,7 +1443,7 @@ FileViewResult SvtFileView::ExecuteFilter( const String& rFilter, const FileView mpImp->maCurrentFilter.ToLowerAscii(); mpImp->Clear(); - FileViewResult eResult = mpImp->GetFolderContent_Impl( mpImp->maViewURL, pAsyncDescriptor ); + FileViewResult eResult = mpImp->GetFolderContent_Impl( mpImp->maViewURL, pAsyncDescriptor, mpBlackList ); OSL_ENSURE( ( eResult != eStillRunning ) || pAsyncDescriptor, "SvtFileView::ExecuteFilter: we told it to read synchronously!" ); return eResult; } @@ -1804,7 +1828,10 @@ void SvtFileView_Impl::Clear() } // ----------------------------------------------------------------------- -FileViewResult SvtFileView_Impl::GetFolderContent_Impl( const String& rFolder, const FileViewAsyncAction* pAsyncDescriptor ) +FileViewResult SvtFileView_Impl::GetFolderContent_Impl( + const String& rFolder, + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { ::osl::ClearableMutexGuard aGuard( maMutex ); INetURLObject aFolderObj( rFolder ); @@ -1816,11 +1843,14 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( const String& rFolder, c FolderDescriptor aFolder( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ) ); aGuard.clear(); - return GetFolderContent_Impl( aFolder, pAsyncDescriptor ); + return GetFolderContent_Impl( aFolder, pAsyncDescriptor, rBlackList ); } // ----------------------------------------------------------------------- -FileViewResult SvtFileView_Impl::GetFolderContent_Impl( const FolderDescriptor& _rFolder, const FileViewAsyncAction* pAsyncDescriptor ) +FileViewResult SvtFileView_Impl::GetFolderContent_Impl( + const FolderDescriptor& _rFolder, + const FileViewAsyncAction* pAsyncDescriptor, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { DBG_TESTSOLARMUTEX(); ::osl::ClearableMutexGuard aGuard( maMutex ); @@ -1832,7 +1862,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( const FolderDescriptor& if ( !pAsyncDescriptor ) { - ::svt::EnumerationResult eResult = m_pContentEnumerator->enumerateFolderContentSync( _rFolder, mpUrlFilter ); + ::svt::EnumerationResult eResult = m_pContentEnumerator->enumerateFolderContentSync( _rFolder, mpUrlFilter, rBlackList ); if ( ::svt::SUCCESS == eResult ) { implEnumerationSuccess(); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 32b37d3fdf7f..276557854f02 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1865,6 +1865,11 @@ void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry ) // #97680# -------------- UpdateContextBmpWidthVectorFromMovedEntry( pEntry ); + if ( !pStartEntry ) + // this might happen if the only entry in the view is moved to its very same position + // #i97346# + pStartEntry = pView->First(); + aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1)); USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry ); USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry ); diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index f6365e354522..042088d317bb 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -1743,7 +1743,7 @@ void SvtDocumentTemplateDialog::InitImpl( ) pImpl->aTitle = GetText(); aMoreTemplatesLink.SetURL( String( - RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/templates?cid=923508" ) ) ); + RTL_CONSTASCII_STRINGPARAM( "http://templates.services.openoffice.org/?cid=923508" ) ) ); aMoreTemplatesLink.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OpenLinkHdl_Impl ) ); aManageBtn.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OrganizerHdl_Impl ) ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 2f15ee7d0c6a..6f3db6175677 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -35,21 +35,11 @@ #include <tools/time.hxx> #include <tools/debug.hxx> #include <tools/poly.hxx> -#ifndef _VCL_APP_HXX #include <vcl/svapp.hxx> -#endif -#ifndef _VCL_HELP_HXX #include <vcl/help.hxx> -#endif -#ifndef _VCL_DECOVIEW_HXX #include <vcl/decoview.hxx> -#endif -#ifndef _VCL_BUTTON_HXX #include <vcl/button.hxx> -#endif -#ifndef _VCL_EDIT_HXX #include <vcl/edit.hxx> -#endif #include "svtaccessiblefactory.hxx" // ======================================================================= @@ -1418,6 +1408,16 @@ void TabBar::StateChanged( StateChangedType nType ) ImplInitSettings( FALSE, TRUE ); Invalidate(); } + else if ( nType == STATE_CHANGE_MIRRORING ) + { + // reacts on calls of EnableRTL, have to mirror all child controls + if( mpFirstBtn ) mpFirstBtn->EnableRTL( IsRTLEnabled() ); + if( mpPrevBtn ) mpPrevBtn->EnableRTL( IsRTLEnabled() ); + if( mpNextBtn ) mpNextBtn->EnableRTL( IsRTLEnabled() ); + if( mpLastBtn ) mpLastBtn->EnableRTL( IsRTLEnabled() ); + if( mpImpl->mpSizer ) mpImpl->mpSizer->EnableRTL( IsRTLEnabled() ); + if( mpEdit ) mpEdit->EnableRTL( IsRTLEnabled() ); + } } // ----------------------------------------------------------------------- @@ -2169,6 +2169,16 @@ void TabBar::SetMirrored( BOOL bMirrored ) } } +void TabBar::SetEffectiveRTL( BOOL bRTL ) +{ + SetMirrored( bRTL != Application::GetSettings().GetLayoutRTL() ); +} + +BOOL TabBar::IsEffectiveRTL() const +{ + return IsMirrored() != Application::GetSettings().GetLayoutRTL(); +} + // ----------------------------------------------------------------------- void TabBar::SetMaxPageWidth( long nMaxWidth ) diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx index 0a392eaddba4..68acffc62a74 100644 --- a/svtools/source/dialogs/printdlg.cxx +++ b/svtools/source/dialogs/printdlg.cxx @@ -158,8 +158,6 @@ PrintDialog::PrintDialog( Window* pWindow, bool bWithSheetsAndCells ) : maRbtAll.Check(); ImplSetImages(); - - maNumCopies.GrabFocus(); } // ----------------------------------------------------------------------- @@ -773,6 +771,8 @@ short PrintDialog::Execute() ImplSetInfo(); maStatusTimer.Start(); ImplInitControls(); + maNumCopies.GrabFocus(); + maNumCopies.SetSelection( Selection( 0, maNumCopies.GetText().Len() ) ); ImplModifyControlHdl( NULL ); // Dialog starten diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index c1553f5ab35e..e2e71e86b662 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -485,7 +485,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, { // Naechstes Zeichen holen c = peekChar(); - bIdentifierChar = testCharFlags( c, CHAR_IN_IDENTIFIER ); + bIdentifierChar = BasicSimpleCharClass::isAlpha( c, true ); if( bIdentifierChar ) getChar(); } @@ -499,16 +499,28 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, if (cPeekNext=='-') { // Alle Zeichen bis Zeilen-Ende oder EOF entfernen - sal_Unicode cPeek = peekChar(); - while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) { getChar(); - cPeek = peekChar(); + cPeekNext = peekChar(); } - reType = TT_COMMENT; } } + else if (c=='/') + { + sal_Unicode cPeekNext = peekChar(); + if (cPeekNext=='/') + { + // Alle Zeichen bis Zeilen-Ende oder EOF entfernen + while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE ) + { + getChar(); + cPeekNext = peekChar(); + } + reType = TT_COMMENT; + } + } else { // Kommentar ? diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index 3cffaa23ebe8..80ceda96fab5 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -67,7 +67,6 @@ class VCLXMultiLineEdit : public ::com::sun::star::awt::XTextComponent, { private: TextListenerMultiplexer maTextListeners; - bool mbJavaCompatibleTextNotifications; LineEnd meLineEndType; protected: diff --git a/svtools/source/items/style.cxx b/svtools/source/items/style.cxx index 26ef160ffb93..ad11f1527ce7 100644 --- a/svtools/source/items/style.cxx +++ b/svtools/source/items/style.cxx @@ -180,11 +180,12 @@ SfxStyleSheetBase::SfxStyleSheetBase( const SfxStyleSheetBase& r ) static SfxStyleSheetBasePool& implGetStaticPool() { static SfxStyleSheetBasePool* pSheetPool = 0; + static SfxItemPool* pBasePool = 0; if( !pSheetPool ) { UniString aName; - static SfxItemPool aPool( aName, 0, 0, 0 ); - pSheetPool = new SfxStyleSheetBasePool( aPool ); + pBasePool = new SfxItemPool( aName, 0, 0, 0 ); + pSheetPool = new SfxStyleSheetBasePool(*pBasePool); } return *pSheetPool; } diff --git a/svtools/source/items1/itempool.cxx b/svtools/source/items1/itempool.cxx index f6a48b51019f..e54bca8d3c19 100644 --- a/svtools/source/items1/itempool.cxx +++ b/svtools/source/items1/itempool.cxx @@ -41,6 +41,7 @@ #include <svtools/brdcst.hxx> #include <svtools/smplhint.hxx> #include "poolio.hxx" +#include <algorithm> // STATIC DATA ----------------------------------------------------------- @@ -52,6 +53,20 @@ SV_IMPL_PTRARR( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl* ); //======================================================================== +void SfxItemPool::AddSfxItemPoolUser(SfxItemPoolUser& rNewUser) +{ + maSfxItemPoolUsers.push_back(&rNewUser); +} + +void SfxItemPool::RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser) +{ + const SfxItemPoolUserVector::iterator aFindResult = ::std::find(maSfxItemPoolUsers.begin(), maSfxItemPoolUsers.end(), &rOldUser); + if(aFindResult != maSfxItemPoolUsers.end()) + { + maSfxItemPoolUsers.erase(aFindResult); + } +} + const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( USHORT nWhich ) const { DBG_CHKTHIS(SfxItemPool, 0); @@ -162,7 +177,8 @@ SfxItemPool::SfxItemPool pSecondary(0), pMaster(this), _pPoolRanges( 0 ), - bPersistentRefCounts(bLoadRefCounts) + bPersistentRefCounts(bLoadRefCounts), + maSfxItemPoolUsers() { DBG_CTOR(SfxItemPool, 0); DBG_ASSERT(nStart, "Start-Which-Id must be greater 0" ); @@ -222,7 +238,8 @@ SfxItemPool::SfxItemPool pSecondary(0), pMaster(this), _pPoolRanges( 0 ), - bPersistentRefCounts(rPool.bPersistentRefCounts ) + bPersistentRefCounts(rPool.bPersistentRefCounts ), + maSfxItemPoolUsers() { DBG_CTOR(SfxItemPool, 0); pImp->eDefMetric = rPool.pImp->eDefMetric; @@ -387,6 +404,29 @@ SfxItemPool::~SfxItemPool() delete[] _pPoolRanges; delete pImp; } + +void SfxItemPool::Free(SfxItemPool* pPool) +{ + if(pPool) + { + // tell all the registered SfxItemPoolUsers that the pool is in destruction + SfxItemPoolUserVector aListCopy(pPool->maSfxItemPoolUsers.begin(), pPool->maSfxItemPoolUsers.end()); + for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++) + { + SfxItemPoolUser* pSfxItemPoolUser = *aIterator; + DBG_ASSERT(pSfxItemPoolUser, "corrupt SfxItemPoolUser list (!)"); + pSfxItemPoolUser->ObjectInDestruction(*pPool); + } + + // Clear the vector. This means that user do not need to call RemoveSfxItemPoolUser() + // when they get called from ObjectInDestruction(). + pPool->maSfxItemPoolUsers.clear(); + + // delete pool + delete pPool; + } +} + // ----------------------------------------------------------------------- diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 6b66c6dbb8b7..e6e78656eedd 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -79,6 +79,7 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> +#include <comphelper/uieventslogger.hxx> //=============================================== // namespace @@ -256,6 +257,22 @@ sal_Bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) sal_Bool bRet = xDispatch.is(); if ( bRet ) { + if(::comphelper::UiEventsLogger::isEnabled() && m_xSMGR.is() && m_xDispatcher.is()) //#i88653# + { + try + { + css::uno::Reference< css::frame::XModuleManager > xModuleDetection( + m_xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), + css::uno::UNO_QUERY_THROW); + + const ::rtl::OUString sModule = xModuleDetection->identify(m_xDispatcher); + css::uno::Sequence<css::beans::PropertyValue> source; + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sModule, ::rtl::OUString::createFromAscii("AcceleratorExecute")); + ::comphelper::UiEventsLogger::logDispatch(aURL, source); + } + catch(const css::uno::Exception&) + { } + } // Note: Such instance can be used one times only and destroy itself afterwards .-) AsyncAccelExec* pExec = AsyncAccelExec::createOnShotInstance(xDispatch, aURL); pExec->execAsync(); @@ -465,7 +482,7 @@ css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::st { sModule = xModuleDetection->identify(xFrame); } - catch(const css::uno::RuntimeException& exRuntime) + catch(const css::uno::RuntimeException&) { throw; } catch(const css::uno::Exception&) { return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); } @@ -560,7 +577,7 @@ IMPL_LINK(AsyncAccelExec, impl_ts_asyncCallback, void*,) } catch(const css::lang::DisposedException&) {} - catch(const css::uno::RuntimeException& exRuntime) + catch(const css::uno::RuntimeException&) { throw; } catch(const css::uno::Exception&) {} diff --git a/svtools/source/misc/documentlockfile.cxx b/svtools/source/misc/documentlockfile.cxx index c8904ef010a4..71b541cfe894 100644 --- a/svtools/source/misc/documentlockfile.cxx +++ b/svtools/source/misc/documentlockfile.cxx @@ -68,20 +68,8 @@ sal_Bool DocumentLockFile::m_bAllowInteraction = sal_True; // ---------------------------------------------------------------------- DocumentLockFile::DocumentLockFile( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: m_xFactory( xFactory ) +: LockFileCommon( aOrigURL, xFactory, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".~lock." ) ) ) { - if ( !m_xFactory.is() ) - m_xFactory = ::comphelper::getProcessServiceFactory(); - - INetURLObject aDocURL( aOrigURL ); - if ( aDocURL.HasError() ) - throw lang::IllegalArgumentException(); - - ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName(); - aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".~lock." ) ); - aShareURLString += aDocURL.GetName(); - aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "#" ) ); - m_aURL = INetURLObject( aShareURLString ).GetMainURL( INetURLObject::NO_DECODE ); } // ---------------------------------------------------------------------- @@ -92,6 +80,8 @@ DocumentLockFile::~DocumentLockFile() // ---------------------------------------------------------------------- void DocumentLockFile::WriteEntryToStream( uno::Sequence< ::rtl::OUString > aEntry, uno::Reference< io::XOutputStream > xOutput ) { + ::osl::MutexGuard aGuard( m_aMutex ); + ::rtl::OUStringBuffer aBuffer; for ( sal_Int32 nEntryInd = 0; nEntryInd < aEntry.getLength(); nEntryInd++ ) @@ -111,6 +101,8 @@ void DocumentLockFile::WriteEntryToStream( uno::Sequence< ::rtl::OUString > aEnt // ---------------------------------------------------------------------- sal_Bool DocumentLockFile::CreateOwnLockFile() { + ::osl::MutexGuard aGuard( m_aMutex ); + try { uno::Reference< io::XStream > xTempFile( @@ -154,136 +146,10 @@ sal_Bool DocumentLockFile::CreateOwnLockFile() } // ---------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > DocumentLockFile::ParseEntry( const uno::Sequence< sal_Int8 >& aBuffer ) -{ - sal_Int32 nCurPos = 0; - - uno::Sequence< ::rtl::OUString > aResult( LOCKFILE_ENTRYSIZE ); - - for ( int nInd = 0; nInd < LOCKFILE_ENTRYSIZE; nInd++ ) - { - aResult[nInd] = ParseName( aBuffer, nCurPos ); - if ( nCurPos >= aBuffer.getLength() - || ( nInd < LOCKFILE_ENTRYSIZE - 1 && aBuffer[nCurPos++] != ',' ) - || ( nInd == LOCKFILE_ENTRYSIZE - 1 && aBuffer[nCurPos++] != ';' ) ) - throw io::WrongFormatException(); - } - - return aResult; -} - -// ---------------------------------------------------------------------- -::rtl::OUString DocumentLockFile::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ) -{ - ::rtl::OStringBuffer aResult; - sal_Bool bHaveName = sal_False; - sal_Bool bEscape = sal_False; - - while( !bHaveName ) - { - if ( o_nCurPos >= aBuffer.getLength() ) - throw io::WrongFormatException(); - - if ( bEscape ) - { - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - else - throw io::WrongFormatException(); - - bEscape = sal_False; - o_nCurPos++; - } - else if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) - bHaveName = sal_True; - else - { - if ( aBuffer[o_nCurPos] == '\\' ) - bEscape = sal_True; - else - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - - o_nCurPos++; - } - } - - return ::rtl::OStringToOUString( aResult.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); -} - -// ---------------------------------------------------------------------- -::rtl::OUString DocumentLockFile::EscapeCharacters( const ::rtl::OUString& aSource ) -{ - ::rtl::OUStringBuffer aBuffer; - const sal_Unicode* pStr = aSource.getStr(); - for ( sal_Int32 nInd = 0; nInd < aSource.getLength() && pStr[nInd] != 0; nInd++ ) - { - if ( pStr[nInd] == '\\' || pStr[nInd] == ';' || pStr[nInd] == ',' ) - aBuffer.append( (sal_Unicode)'\\' ); - aBuffer.append( pStr[nInd] ); - } - - return aBuffer.makeStringAndClear(); -} - -// ---------------------------------------------------------------------- -::rtl::OUString DocumentLockFile::GetOOOUserName() -{ - SvtUserOptions aUserOpt; - ::rtl::OUString aName = aUserOpt.GetFirstName(); - if ( aName.getLength() ) - aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ); - aName += aUserOpt.GetLastName(); - - return aName; -} - -// ---------------------------------------------------------------------- -::rtl::OUString DocumentLockFile::GetCurrentLocalTime() -{ - ::rtl::OUString aTime; - - TimeValue aSysTime; - if ( osl_getSystemTime( &aSysTime ) ) - { - TimeValue aLocTime; - if ( osl_getLocalTimeFromSystemTime( &aSysTime, &aLocTime ) ) - { - oslDateTime aDateTime; - if ( osl_getDateTimeFromTimeValue( &aLocTime, &aDateTime ) ) - { - char pDateTime[20]; - sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day, aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes ); - aTime = ::rtl::OUString::createFromAscii( pDateTime ); - } - } - } - - return aTime; -} - -// ---------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > DocumentLockFile::GenerateOwnEntry() -{ - uno::Sequence< ::rtl::OUString > aResult( LOCKFILE_ENTRYSIZE ); - - aResult[LOCKFILE_OOOUSERNAME_ID] = GetOOOUserName(); - - ::osl::Security aSecurity; - aSecurity.getUserName( aResult[LOCKFILE_SYSUSERNAME_ID] ); - - aResult[LOCKFILE_LOCALHOST_ID] = ::osl::SocketAddr::getLocalHostname(); - - aResult[LOCKFILE_EDITTIME_ID] = GetCurrentLocalTime(); - - ::utl::Bootstrap::locateUserInstallation( aResult[LOCKFILE_USERURL_ID] ); - - - return aResult; -} - -// ---------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > DocumentLockFile::GetLockData() { + ::osl::MutexGuard aGuard( m_aMutex ); + uno::Reference< io::XInputStream > xInput = OpenStream(); if ( !xInput.is() ) throw uno::RuntimeException(); @@ -299,12 +165,15 @@ uno::Sequence< ::rtl::OUString > DocumentLockFile::GetLockData() if ( nRead == nBufLen ) throw io::WrongFormatException(); - return ParseEntry( aBuffer ); + sal_Int32 nCurPos = 0; + return ParseEntry( aBuffer, nCurPos ); } // ---------------------------------------------------------------------- uno::Reference< io::XInputStream > DocumentLockFile::OpenStream() { + ::osl::MutexGuard aGuard( m_aMutex ); + uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( xFactory->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SimpleFileAccess") ), @@ -344,6 +213,8 @@ sal_Bool DocumentLockFile::OverwriteOwnLockFile() // ---------------------------------------------------------------------- void DocumentLockFile::RemoveFile() { + ::osl::MutexGuard aGuard( m_aMutex ); + // TODO/LATER: the removing is not atomar, is it possible in general to make it atomar? uno::Sequence< ::rtl::OUString > aNewEntry = GenerateOwnEntry(); uno::Sequence< ::rtl::OUString > aFileData = GetLockData(); diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index 8e03db7bbf41..d667580b41fb 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -58,6 +58,13 @@ SvEmbedTransferHelper::SvEmbedTransferHelper( const uno::Reference< embed::XEmbe , m_pGraphic( pGraphic ? new Graphic( *pGraphic ) : NULL ) , m_nAspect( nAspect ) { + if( xObj.is() ) + { + TransferableObjectDescriptor aObjDesc; + + FillTransferableObjectDescriptor( aObjDesc, m_xObj, NULL, m_nAspect ); + PrepareOLE( aObjDesc ); + } } // ----------------------------------------------------------------------------- diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 6226992136c8..870e6378a216 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -36,12 +36,97 @@ #include <tools/shl.hxx> #include <tools/debug.hxx> +//#include <com/sun/star/i18n/XCharacterClassification.hpp> +#include <com/sun/star/i18n/DirectionProperty.hpp> + #include <i18npool/lang.h> #include <i18npool/mslangid.hxx> #include <svtools/svtools.hrc> #include <svtools/svtdata.hxx> #include <svtools/langtab.hxx> +#include <svtools/syslocale.hxx> + + +using namespace ::com::sun::star; + +//------------------------------------------------------------------------ + +SVT_DLLPUBLIC const String ApplyLreOrRleEmbedding( const String &rText ) +{ + const USHORT nLen = rText.Len(); + if (nLen == 0) + return String(); + + const sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding + const sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding + const sal_Unicode cPopDirectionalFormat = 0x202C; // the unicode PDF (POP_DIRECTIONAL_FORMAT) char that terminates an LRE/RLE embedding + + // check if there are alreay embedding characters at the strings start + // if so change nothing + const sal_Unicode cChar = rText.GetBuffer()[0]; + if (cChar == cLRE_Embedding || cChar == cRLE_Embedding) + return rText; + + // since we only call the function getCharacterDirection + // it does not matter which locale the CharClass is for. + // Thus we can readily make use of SvtSysLocale::GetCharClass() + // which should come at no cost... + SvtSysLocale aSysLocale; + const CharClass &rCharClass = aSysLocale.GetCharClass(); + + // we should look for the first non-neutral LTR or RTL character + // and use that to determine the embedding of the whole text... + // Thus we can avoid to check every character of the text. + bool bFound = false; + bool bIsRtlText = false; + for (USHORT i = 0; i < nLen && !bFound; ++i) + { + sal_Int16 nDirection = rCharClass.getCharacterDirection( rText, i ); + switch (nDirection) + { + case i18n::DirectionProperty_LEFT_TO_RIGHT : + case i18n::DirectionProperty_LEFT_TO_RIGHT_EMBEDDING : + case i18n::DirectionProperty_LEFT_TO_RIGHT_OVERRIDE : + case i18n::DirectionProperty_EUROPEAN_NUMBER : + case i18n::DirectionProperty_ARABIC_NUMBER : // yes! arabic numbers are written from left to right + { + bIsRtlText = false; + bFound = true; + break; + } + + case i18n::DirectionProperty_RIGHT_TO_LEFT : + case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC : + case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING : + case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE : + { + bIsRtlText = true; + bFound = true; + break; + } + + default: + { + // nothing to be done, character is considered to be neutral we need to look further ... + } + } + } + + sal_Unicode cStart = cLRE_Embedding; // default is to use LRE embedding characters + if (bIsRtlText) + cStart = cRLE_Embedding; // then use RLE embedding + + // add embedding start and end chars to the text if the direction could be determined + String aRes( rText ); + if (bFound) + { + aRes.Insert( cStart, 0 ); + aRes.Insert( cPopDirectionalFormat ); + } + + return aRes; +} //------------------------------------------------------------------------ diff --git a/svtools/source/misc/lockfilecommon.cxx b/svtools/source/misc/lockfilecommon.cxx new file mode 100644 index 000000000000..ef2cf89d8572 --- /dev/null +++ b/svtools/source/misc/lockfilecommon.cxx @@ -0,0 +1,276 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#include <stdio.h> + +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/InsertCommandArgument.hpp> +#include <com/sun/star/ucb/NameClashException.hpp> +#include <com/sun/star/io/WrongFormatException.hpp> + +#include <osl/time.h> +#include <osl/security.hxx> +#include <osl/socket.hxx> +#include <osl/file.hxx> + +#include <rtl/string.hxx> +#include <rtl/ustring.hxx> +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> + +#include <comphelper/processfactory.hxx> + +#include <tools/urlobj.hxx> +#include <unotools/bootstrap.hxx> + +#include <ucbhelper/content.hxx> + +#include <svtools/useroptions.hxx> + +#include <svtools/lockfilecommon.hxx> + +using namespace ::com::sun::star; + +namespace svt { + +// ---------------------------------------------------------------------- +LockFileCommon::LockFileCommon( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory, const ::rtl::OUString& aPrefix ) +: m_xFactory( xFactory ) +{ + if ( !m_xFactory.is() ) + m_xFactory = ::comphelper::getProcessServiceFactory(); + + INetURLObject aDocURL = ResolveLinks( INetURLObject( aOrigURL ) ); + + ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName(); + aShareURLString += aPrefix; + aShareURLString += aDocURL.GetName(); + aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "#" ) ); + m_aURL = INetURLObject( aShareURLString ).GetMainURL( INetURLObject::NO_DECODE ); +} + +// ---------------------------------------------------------------------- +LockFileCommon::~LockFileCommon() +{ +} + +// ---------------------------------------------------------------------- +INetURLObject LockFileCommon::ResolveLinks( const INetURLObject& aDocURL ) +{ + if ( aDocURL.HasError() ) + throw lang::IllegalArgumentException(); + + ::rtl::OUString aURLToCheck = aDocURL.GetMainURL( INetURLObject::NO_DECODE ); + + sal_Bool bNeedsChecking = sal_True; + sal_Int32 nMaxLinkCount = 128; + sal_Int32 nCount = 0; + + while( bNeedsChecking ) + { + bNeedsChecking = sal_False; + + // do not allow too deep links + if ( nCount++ >= nMaxLinkCount ) + throw io::IOException(); + + // there is currently no UCB functionality to resolve the symbolic links; + // since the lock files are used only for local file systems the osl functionality is used directly + + ::osl::FileStatus aStatus( FileStatusMask_Type | FileStatusMask_LinkTargetURL ); + ::osl::DirectoryItem aItem; + if ( ::osl::FileBase::E_None == ::osl::DirectoryItem::get( aURLToCheck, aItem ) + && aItem.is() && ::osl::FileBase::E_None == aItem.getFileStatus( aStatus ) ) + { + if ( aStatus.isValid( FileStatusMask_Type ) + && aStatus.isValid( FileStatusMask_LinkTargetURL ) + && aStatus.getFileType() == ::osl::FileStatus::Link ) + { + aURLToCheck = aStatus.getLinkTargetURL(); + bNeedsChecking = sal_True; + } + } + } + + return INetURLObject( aURLToCheck ); +} + +// ---------------------------------------------------------------------- +uno::Sequence< uno::Sequence< ::rtl::OUString > > LockFileCommon::ParseList( const uno::Sequence< sal_Int8 >& aBuffer ) +{ + sal_Int32 nCurPos = 0; + sal_Int32 nCurEntry = 0; + uno::Sequence< uno::Sequence< ::rtl::OUString > > aResult( 10 ); + + while ( nCurPos < aBuffer.getLength() ) + { + if ( nCurEntry >= aResult.getLength() ) + aResult.realloc( nCurEntry + 10 ); + aResult[nCurEntry] = ParseEntry( aBuffer, nCurPos ); + nCurEntry++; + } + + aResult.realloc( nCurEntry ); + return aResult; +} + +// ---------------------------------------------------------------------- +uno::Sequence< ::rtl::OUString > LockFileCommon::ParseEntry( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& io_nCurPos ) +{ + uno::Sequence< ::rtl::OUString > aResult( LOCKFILE_ENTRYSIZE ); + + for ( int nInd = 0; nInd < LOCKFILE_ENTRYSIZE; nInd++ ) + { + aResult[nInd] = ParseName( aBuffer, io_nCurPos ); + if ( io_nCurPos >= aBuffer.getLength() + || ( nInd < LOCKFILE_ENTRYSIZE - 1 && aBuffer[io_nCurPos++] != ',' ) + || ( nInd == LOCKFILE_ENTRYSIZE - 1 && aBuffer[io_nCurPos++] != ';' ) ) + throw io::WrongFormatException(); + } + + return aResult; +} + +// ---------------------------------------------------------------------- +::rtl::OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& io_nCurPos ) +{ + ::rtl::OStringBuffer aResult; + sal_Bool bHaveName = sal_False; + sal_Bool bEscape = sal_False; + + while( !bHaveName ) + { + if ( io_nCurPos >= aBuffer.getLength() ) + throw io::WrongFormatException(); + + if ( bEscape ) + { + if ( aBuffer[io_nCurPos] == ',' || aBuffer[io_nCurPos] == ';' || aBuffer[io_nCurPos] == '\\' ) + aResult.append( (sal_Char)aBuffer[io_nCurPos] ); + else + throw io::WrongFormatException(); + + bEscape = sal_False; + io_nCurPos++; + } + else if ( aBuffer[io_nCurPos] == ',' || aBuffer[io_nCurPos] == ';' ) + bHaveName = sal_True; + else + { + if ( aBuffer[io_nCurPos] == '\\' ) + bEscape = sal_True; + else + aResult.append( (sal_Char)aBuffer[io_nCurPos] ); + + io_nCurPos++; + } + } + + return ::rtl::OStringToOUString( aResult.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); +} + +// ---------------------------------------------------------------------- +::rtl::OUString LockFileCommon::EscapeCharacters( const ::rtl::OUString& aSource ) +{ + ::rtl::OUStringBuffer aBuffer; + const sal_Unicode* pStr = aSource.getStr(); + for ( sal_Int32 nInd = 0; nInd < aSource.getLength() && pStr[nInd] != 0; nInd++ ) + { + if ( pStr[nInd] == '\\' || pStr[nInd] == ';' || pStr[nInd] == ',' ) + aBuffer.append( (sal_Unicode)'\\' ); + aBuffer.append( pStr[nInd] ); + } + + return aBuffer.makeStringAndClear(); +} + +// ---------------------------------------------------------------------- +::rtl::OUString LockFileCommon::GetOOOUserName() +{ + SvtUserOptions aUserOpt; + ::rtl::OUString aName = aUserOpt.GetFirstName(); + if ( aName.getLength() ) + aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ); + aName += aUserOpt.GetLastName(); + + return aName; +} + +// ---------------------------------------------------------------------- +::rtl::OUString LockFileCommon::GetCurrentLocalTime() +{ + ::rtl::OUString aTime; + + TimeValue aSysTime; + if ( osl_getSystemTime( &aSysTime ) ) + { + TimeValue aLocTime; + if ( osl_getLocalTimeFromSystemTime( &aSysTime, &aLocTime ) ) + { + oslDateTime aDateTime; + if ( osl_getDateTimeFromTimeValue( &aLocTime, &aDateTime ) ) + { + char pDateTime[20]; + sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day, aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes ); + aTime = ::rtl::OUString::createFromAscii( pDateTime ); + } + } + } + + return aTime; +} + +// ---------------------------------------------------------------------- +uno::Sequence< ::rtl::OUString > LockFileCommon::GenerateOwnEntry() +{ + uno::Sequence< ::rtl::OUString > aResult( LOCKFILE_ENTRYSIZE ); + + aResult[LOCKFILE_OOOUSERNAME_ID] = GetOOOUserName(); + + ::osl::Security aSecurity; + aSecurity.getUserName( aResult[LOCKFILE_SYSUSERNAME_ID] ); + + aResult[LOCKFILE_LOCALHOST_ID] = ::osl::SocketAddr::getLocalHostname(); + + aResult[LOCKFILE_EDITTIME_ID] = GetCurrentLocalTime(); + + ::utl::Bootstrap::locateUserInstallation( aResult[LOCKFILE_USERURL_ID] ); + + + return aResult; +} + +} // namespace svt + diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk index a9f8c583e85b..a23092e120da 100644 --- a/svtools/source/misc/makefile.mk +++ b/svtools/source/misc/makefile.mk @@ -82,6 +82,7 @@ SLOFILES=\ $(SLO)$/dialogclosedlistener.obj\ $(SLO)$/dialogcontrolling.obj \ $(SLO)$/chartprettypainter.obj \ + $(SLO)$/lockfilecommon.obj \ $(SLO)$/sharecontrolfile.obj \ $(SLO)$/documentlockfile.obj \ $(SLO)$/langtab.obj diff --git a/svtools/source/misc/sharecontrolfile.cxx b/svtools/source/misc/sharecontrolfile.cxx index 0fd661f85135..dbea89f54bcc 100644 --- a/svtools/source/misc/sharecontrolfile.cxx +++ b/svtools/source/misc/sharecontrolfile.cxx @@ -67,21 +67,8 @@ namespace svt { // ---------------------------------------------------------------------- ShareControlFile::ShareControlFile( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: m_xFactory( xFactory ) +: LockFileCommon( aOrigURL, xFactory, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".~sharing." ) ) ) { - if ( !m_xFactory.is() ) - m_xFactory = ::comphelper::getProcessServiceFactory(); - - INetURLObject aDocURL( aOrigURL ); - if ( aDocURL.HasError() ) - throw lang::IllegalArgumentException(); - - ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName(); - aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".~sharing." ) ); - aShareURLString += aDocURL.GetName(); - aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "#" ) ); - m_aURL = INetURLObject( aShareURLString ).GetMainURL( INetURLObject::NO_DECODE ); - OpenStream(); if ( !IsValid() ) @@ -182,152 +169,6 @@ void ShareControlFile::Close() } // ---------------------------------------------------------------------- -uno::Sequence< uno::Sequence< ::rtl::OUString > > ShareControlFile::ParseList( const uno::Sequence< sal_Int8 >& aBuffer ) -{ - sal_Int32 nCurPos = 0; - sal_Int32 nCurEntry = 0; - uno::Sequence< uno::Sequence< ::rtl::OUString > > aResult( 10 ); - - while ( nCurPos < aBuffer.getLength() ) - { - if ( nCurEntry >= aResult.getLength() ) - aResult.realloc( nCurEntry + 10 ); - aResult[nCurEntry] = ParseEntry( aBuffer, nCurPos ); - nCurEntry++; - } - - aResult.realloc( nCurEntry ); - return aResult; -} - -// ---------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > ShareControlFile::ParseEntry( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ) -{ - uno::Sequence< ::rtl::OUString > aResult( SHARED_ENTRYSIZE ); - - for ( int nInd = 0; nInd < SHARED_ENTRYSIZE; nInd++ ) - { - aResult[nInd] = ParseName( aBuffer, o_nCurPos ); - if ( o_nCurPos >= aBuffer.getLength() - || ( nInd < SHARED_ENTRYSIZE - 1 && aBuffer[o_nCurPos++] != ',' ) - || ( nInd == SHARED_ENTRYSIZE - 1 && aBuffer[o_nCurPos++] != ';' ) ) - throw io::WrongFormatException(); - } - - return aResult; -} - -// ---------------------------------------------------------------------- -::rtl::OUString ShareControlFile::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ) -{ - ::rtl::OStringBuffer aResult; - sal_Bool bHaveName = sal_False; - sal_Bool bEscape = sal_False; - - while( !bHaveName ) - { - if ( o_nCurPos >= aBuffer.getLength() ) - throw io::WrongFormatException(); - - if ( bEscape ) - { - if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' || aBuffer[o_nCurPos] == '\\' ) - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - else - throw io::WrongFormatException(); - - bEscape = sal_False; - o_nCurPos++; - } - else if ( aBuffer[o_nCurPos] == ',' || aBuffer[o_nCurPos] == ';' ) - bHaveName = sal_True; - else - { - if ( aBuffer[o_nCurPos] == '\\' ) - bEscape = sal_True; - else - aResult.append( (sal_Char)aBuffer[o_nCurPos] ); - - o_nCurPos++; - } - } - - return ::rtl::OStringToOUString( aResult.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); -} - -// ---------------------------------------------------------------------- -::rtl::OUString ShareControlFile::EscapeCharacters( const ::rtl::OUString& aSource ) -{ - ::rtl::OUStringBuffer aBuffer; - const sal_Unicode* pStr = aSource.getStr(); - for ( sal_Int32 nInd = 0; nInd < aSource.getLength() && pStr[nInd] != 0; nInd++ ) - { - if ( pStr[nInd] == '\\' || pStr[nInd] == ';' || pStr[nInd] == ',' ) - aBuffer.append( (sal_Unicode)'\\' ); - aBuffer.append( pStr[nInd] ); - } - - return aBuffer.makeStringAndClear(); -} - -// ---------------------------------------------------------------------- -::rtl::OUString ShareControlFile::GetOOOUserName() -{ - SvtUserOptions aUserOpt; - ::rtl::OUString aName = aUserOpt.GetFirstName(); - if ( aName.getLength() ) - aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ); - aName += aUserOpt.GetLastName(); - - return aName; -} - -// ---------------------------------------------------------------------- -::rtl::OUString ShareControlFile::GetCurrentLocalTime() -{ - ::rtl::OUString aTime; - - TimeValue aSysTime; - if ( osl_getSystemTime( &aSysTime ) ) - { - TimeValue aLocTime; - if ( osl_getLocalTimeFromSystemTime( &aSysTime, &aLocTime ) ) - { - oslDateTime aDateTime; - if ( osl_getDateTimeFromTimeValue( &aLocTime, &aDateTime ) ) - { - char pDateTime[20]; - sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day, aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes ); - aTime = ::rtl::OUString::createFromAscii( pDateTime ); - } - } - } - - return aTime; -} - -// ---------------------------------------------------------------------- -uno::Sequence< ::rtl::OUString > ShareControlFile::GenerateOwnEntry() -{ - uno::Sequence< ::rtl::OUString > aResult( SHARED_ENTRYSIZE ); - - aResult[SHARED_OOOUSERNAME_ID] = GetOOOUserName(); - - ::osl::Security aSecurity; - aSecurity.getUserName( aResult[SHARED_SYSUSERNAME_ID] ); - - aResult[SHARED_LOCALHOST_ID] = ::osl::SocketAddr::getLocalHostname(); - - aResult[SHARED_EDITTIME_ID] = GetCurrentLocalTime(); - - ::utl::Bootstrap::locateUserInstallation( aResult[SHARED_USERURL_ID] ); - - - return aResult; -} - - -// ---------------------------------------------------------------------- uno::Sequence< uno::Sequence< ::rtl::OUString > > ShareControlFile::GetUsersData() { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 7e882dac35ff..0bcd00af40aa 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -81,6 +81,7 @@ #include <svtools/wmf.hxx> #include <svtools/imap.hxx> #include <svtools/transfer.hxx> +#include <cstdio> // -------------- // - Namespaces - @@ -155,6 +156,136 @@ SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjD return rOStm; } +// ----------------------------------------------------------------------------- + +static ::rtl::OUString ImplGetParameterString( const TransferableObjectDescriptor& rObjDesc ) +{ + const ::rtl::OUString aChar( ::rtl::OUString::createFromAscii( "\"" ) ); + const ::rtl::OUString aClassName( rObjDesc.maClassName.GetHexName() ); + ::rtl::OUString aParams; + + if( aClassName.getLength() ) + { + aParams += ::rtl::OUString::createFromAscii( ";classname=\"" ); + aParams += aClassName; + aParams += aChar; + } + + if( rObjDesc.maTypeName.Len() ) + { + aParams += ::rtl::OUString::createFromAscii( ";typename=\"" ); + aParams += rObjDesc.maTypeName; + aParams += aChar; + } + + if( rObjDesc.maDisplayName.Len() ) + { + aParams += ::rtl::OUString::createFromAscii( ";displayname=\"" ); + aParams += rObjDesc.maDisplayName; + aParams += aChar; + } + + aParams += ::rtl::OUString::createFromAscii( ";viewaspect=\"" ); + aParams += ::rtl::OUString::valueOf( static_cast< sal_Int32 >( rObjDesc.mnViewAspect ) ); + aParams += aChar; + + aParams += ::rtl::OUString::createFromAscii( ";width=\"" ); + aParams += ::rtl::OUString::valueOf( rObjDesc.maSize.Width() ); + aParams += aChar; + + aParams += ::rtl::OUString::createFromAscii( ";height=\"" ); + aParams += ::rtl::OUString::valueOf( rObjDesc.maSize.Height() ); + aParams += aChar; + + aParams += ::rtl::OUString::createFromAscii( ";posx=\"" ); + aParams += ::rtl::OUString::valueOf( rObjDesc.maDragStartPos.X() ); + aParams += aChar; + + aParams += ::rtl::OUString::createFromAscii( ";posy=\"" ); + aParams += ::rtl::OUString::valueOf( rObjDesc.maDragStartPos.X() ); + aParams += aChar; + + return aParams; +} + +// ----------------------------------------------------------------------------- + +static void ImplSetParameterString( TransferableObjectDescriptor& rObjDesc, const DataFlavorEx& rFlavorEx ) +{ + Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); + Reference< XMimeContentTypeFactory > xMimeFact; + + try + { + if( xFact.is() ) + { + xMimeFact = Reference< XMimeContentTypeFactory >( xFact->createInstance( ::rtl::OUString::createFromAscii( + "com.sun.star.datatransfer.MimeContentTypeFactory" ) ), + UNO_QUERY ); + } + + if( xMimeFact.is() ) + { + Reference< XMimeContentType > xMimeType( xMimeFact->createMimeContentType( rFlavorEx.MimeType ) ); + + if( xMimeType.is() ) + { + const ::rtl::OUString aClassNameString( ::rtl::OUString::createFromAscii( "classname" ) ); + const ::rtl::OUString aTypeNameString( ::rtl::OUString::createFromAscii( "typename" ) ); + const ::rtl::OUString aDisplayNameString( ::rtl::OUString::createFromAscii( "displayname" ) ); + const ::rtl::OUString aViewAspectString( ::rtl::OUString::createFromAscii( "viewaspect" ) ); + const ::rtl::OUString aWidthString( ::rtl::OUString::createFromAscii( "width" ) ); + const ::rtl::OUString aHeightString( ::rtl::OUString::createFromAscii( "height" ) ); + const ::rtl::OUString aPosXString( ::rtl::OUString::createFromAscii( "posx" ) ); + const ::rtl::OUString aPosYString( ::rtl::OUString::createFromAscii( "posy" ) ); + + if( xMimeType->hasParameter( aClassNameString ) ) + { + rObjDesc.maClassName.MakeId( xMimeType->getParameterValue( aClassNameString ) ); + } + + if( xMimeType->hasParameter( aTypeNameString ) ) + { + rObjDesc.maTypeName = xMimeType->getParameterValue( aTypeNameString ); + } + + if( xMimeType->hasParameter( aDisplayNameString ) ) + { + rObjDesc.maDisplayName = xMimeType->getParameterValue( aDisplayNameString ); + } + + if( xMimeType->hasParameter( aViewAspectString ) ) + { + rObjDesc.mnViewAspect = static_cast< sal_uInt16 >( xMimeType->getParameterValue( aViewAspectString ).toInt32() ); + } + + if( xMimeType->hasParameter( aWidthString ) ) + { + rObjDesc.maSize.Width() = xMimeType->getParameterValue( aWidthString ).toInt32(); + } + + if( xMimeType->hasParameter( aHeightString ) ) + { + rObjDesc.maSize.Height() = xMimeType->getParameterValue( aHeightString ).toInt32(); + } + + if( xMimeType->hasParameter( aPosXString ) ) + { + rObjDesc.maDragStartPos.X() = xMimeType->getParameterValue( aPosXString ).toInt32(); + } + + if( xMimeType->hasParameter( aPosYString ) ) + { + rObjDesc.maDragStartPos.Y() = xMimeType->getParameterValue( aPosYString ).toInt32(); + } + } + } + } + catch( const ::com::sun::star::uno::Exception& ) + { + } +} + // ----------------------------------------- // - TransferableHelper::TerminateListener - // ----------------------------------------- @@ -194,7 +325,8 @@ void SAL_CALL TransferableHelper::TerminateListener::notifyTermination( const Ev // ---------------------- TransferableHelper::TransferableHelper() : - mpFormats( new DataFlavorExVector ) + mpFormats( new DataFlavorExVector ), + mpObjDesc( NULL ) { } @@ -202,6 +334,7 @@ TransferableHelper::TransferableHelper() : TransferableHelper::~TransferableHelper() { + delete mpObjDesc; delete mpFormats; } @@ -307,6 +440,11 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th // if any is not yet filled, use standard format if( !maAny.hasValue() ) GetData( rFlavor ); + +#ifdef DEBUG + if( maAny.hasValue() && ::com::sun::star::uno::TypeClass_STRING != maAny.getValueType().getTypeClass() ) + fprintf( stderr, "TransferableHelper delivers sequence of data [ %s ]\n", ByteString( String( rFlavor.MimeType), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); +#endif } catch( const ::com::sun::star::uno::Exception& ) { @@ -325,9 +463,6 @@ Sequence< DataFlavor > SAL_CALL TransferableHelper::getTransferDataFlavors() thr { const ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - - try { if( !mpFormats->size() ) @@ -342,7 +477,9 @@ Sequence< DataFlavor > SAL_CALL TransferableHelper::getTransferDataFlavors() thr sal_uInt32 nCurPos = 0; while( aIter != aEnd ) + { aRet[ nCurPos++ ] = *aIter++; + } return aRet; } @@ -513,11 +650,24 @@ void TransferableHelper::AddFormat( const DataFlavor& rFlavor ) sal_Bool bAdd = sal_True; while( aIter != aEnd ) - { - if( TransferableDataHelper::IsEqual( *aIter, rFlavor ) ) { + // update MimeType for SOT_FORMATSTR_ID_OBJECTDESCRIPTOR in every case + if( ( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR == aIter->mnSotId ) && mpObjDesc ) + { + DataFlavor aObjDescFlavor; + + SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDescFlavor ); + aIter->MimeType = aObjDescFlavor.MimeType; + aIter->MimeType += ::ImplGetParameterString( *mpObjDesc ); + +#ifdef DEBUG + fprintf( stderr, "TransferableHelper exchanged objectdescriptor [ %s ]\n", + ByteString( String( aIter->MimeType), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); +#endif + } + aIter = aEnd; bAdd = sal_False; } @@ -527,13 +677,17 @@ void TransferableHelper::AddFormat( const DataFlavor& rFlavor ) if( bAdd ) { - DataFlavorEx aFlavorEx; + DataFlavorEx aFlavorEx; + DataFlavor aObjDescFlavor; aFlavorEx.MimeType = rFlavor.MimeType; aFlavorEx.HumanPresentableName = rFlavor.HumanPresentableName; aFlavorEx.DataType = rFlavor.DataType; aFlavorEx.mnSotId = SotExchange::RegisterFormat( rFlavor ); + if( ( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR == aFlavorEx.mnSotId ) && mpObjDesc ) + aFlavorEx.MimeType += ::ImplGetParameterString( *mpObjDesc ); + mpFormats->push_back( aFlavorEx ); if( FORMAT_BITMAP == aFlavorEx.mnSotId ) @@ -702,6 +856,8 @@ sal_Bool TransferableHelper::SetImageMap( const ImageMap& rIMap, const ::com::su sal_Bool TransferableHelper::SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& ) { + PrepareOLE( rDesc ); + SvMemoryStream aMemStm( 1024, 1024 ); aMemStm << rDesc; @@ -823,7 +979,8 @@ sal_Bool TransferableHelper::SetFileList( const FileList& rFileList, aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); aMemStm << rFileList; - maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) ); + maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), + aMemStm.Seek( STREAM_SEEK_TO_END ) ); return( maAny.hasValue() ); } @@ -890,6 +1047,17 @@ void TransferableHelper::ObjectReleased() // ----------------------------------------------------------------------------- +void TransferableHelper::PrepareOLE( const TransferableObjectDescriptor& rObjDesc ) +{ + delete mpObjDesc; + mpObjDesc = new TransferableObjectDescriptor( rObjDesc ); + + if( HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) ) + AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); +} + +// ----------------------------------------------------------------------------- + void TransferableHelper::CopyToClipboard( Window *pWindow ) const { DBG_ASSERT( pWindow, "Window pointer is NULL" ); @@ -1161,29 +1329,32 @@ struct TransferableDataHelper_Impl // - TransferableDataHelper - // -------------------------- -TransferableDataHelper::TransferableDataHelper() - :mpFormats( new DataFlavorExVector ) - ,mpImpl( new TransferableDataHelper_Impl ) +TransferableDataHelper::TransferableDataHelper() : + mpFormats( new DataFlavorExVector ), + mpObjDesc( new TransferableObjectDescriptor ), + mpImpl( new TransferableDataHelper_Impl ) { } // ----------------------------------------------------------------------------- -TransferableDataHelper::TransferableDataHelper( const Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable ) - :mxTransfer( rxTransferable ) - ,mpFormats( new DataFlavorExVector ) - ,mpImpl( new TransferableDataHelper_Impl ) +TransferableDataHelper::TransferableDataHelper( const Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable ) : + mxTransfer( rxTransferable ), + mpFormats( new DataFlavorExVector ), + mpObjDesc( new TransferableObjectDescriptor ), + mpImpl( new TransferableDataHelper_Impl ) { InitFormats(); } // ----------------------------------------------------------------------------- -TransferableDataHelper::TransferableDataHelper( const TransferableDataHelper& rDataHelper ) - :mxTransfer( rDataHelper.mxTransfer ) - ,mxClipboard( rDataHelper.mxClipboard ) - ,mpFormats( new DataFlavorExVector( *rDataHelper.mpFormats ) ) - ,mpImpl( new TransferableDataHelper_Impl ) +TransferableDataHelper::TransferableDataHelper( const TransferableDataHelper& rDataHelper ) : + mxTransfer( rDataHelper.mxTransfer ), + mxClipboard( rDataHelper.mxClipboard ), + mpFormats( new DataFlavorExVector( *rDataHelper.mpFormats ) ), + mpObjDesc( new TransferableObjectDescriptor( *rDataHelper.mpObjDesc ) ), + mpImpl( new TransferableDataHelper_Impl ) { } @@ -1196,12 +1367,13 @@ TransferableDataHelper& TransferableDataHelper::operator=( const TransferableDat ::osl::MutexGuard aGuard( mpImpl->maMutex ); bool bWasClipboardListening = ( NULL != mpImpl->mpClipboardListener ); + if ( bWasClipboardListening ) StopClipboardListening(); mxTransfer = rDataHelper.mxTransfer; delete mpFormats, mpFormats = new DataFlavorExVector( *rDataHelper.mpFormats ); - + delete mpObjDesc, mpObjDesc = new TransferableObjectDescriptor( *rDataHelper.mpObjDesc ); mxClipboard = rDataHelper.mxClipboard; if ( bWasClipboardListening ) @@ -1219,6 +1391,7 @@ TransferableDataHelper::~TransferableDataHelper() { ::osl::MutexGuard aGuard( mpImpl->maMutex ); delete mpFormats, mpFormats = NULL; + delete mpObjDesc, mpObjDesc = NULL; } delete mpImpl; } @@ -1313,6 +1486,10 @@ void TransferableDataHelper::FillDataFlavorExVector( const Sequence< DataFlavor { rDataFlavorExVector[ rDataFlavorExVector.size() - 1 ].mnSotId = SOT_FORMAT_FILE_LIST; } + else if( xMimeType.is() && xMimeType->getFullMediaType().equalsIgnoreAsciiCase( ::rtl::OUString::createFromAscii( "application/x-openoffice-objectdescriptor-xml" ) ) ) + { + rDataFlavorExVector[ rDataFlavorExVector.size() - 1 ].mnSotId = SOT_FORMATSTR_ID_OBJECTDESCRIPTOR; + } } } catch( const ::com::sun::star::uno::Exception& ) @@ -1328,8 +1505,25 @@ void TransferableDataHelper::InitFormats() ::osl::MutexGuard aGuard( mpImpl->maMutex ); mpFormats->clear(); + delete mpObjDesc, mpObjDesc = new TransferableObjectDescriptor; + if( mxTransfer.is() ) + { TransferableDataHelper::FillDataFlavorExVector( mxTransfer->getTransferDataFlavors(), *mpFormats ); + + DataFlavorExVector::iterator aIter( mpFormats->begin() ), aEnd( mpFormats->end() ); + + while( aIter != aEnd ) + { + if( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR == aIter->mnSotId ) + { + ImplSetParameterString( *mpObjDesc, *aIter ); + aIter = aEnd; + } + else + ++aIter; + } + } } // ----------------------------------------------------------------------------- @@ -1741,18 +1935,10 @@ sal_Bool TransferableDataHelper::GetTransferableObjectDescriptor( SotFormatStrin // ----------------------------------------------------------------------------- -sal_Bool TransferableDataHelper::GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, TransferableObjectDescriptor& rDesc ) +sal_Bool TransferableDataHelper::GetTransferableObjectDescriptor( const ::com::sun::star::datatransfer::DataFlavor&, TransferableObjectDescriptor& rDesc ) { - SotStorageStreamRef xStm; - sal_Bool bRet = GetSotStorageStream( rFlavor, xStm ); - - if( bRet ) - { - *xStm >> rDesc; - bRet = ( xStm->GetError() == ERRCODE_NONE ); - } - - return bRet; + rDesc = *mpObjDesc; + return true; } // ----------------------------------------------------------------------------- @@ -1980,6 +2166,10 @@ sal_Bool TransferableDataHelper::GetSequence( SotFormatStringId nFormat, Sequenc sal_Bool TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, Sequence< sal_Int8 >& rSeq ) { +#ifdef DEBUG + fprintf( stderr, "TransferableDataHelper requests sequence of data\n" ); +#endif + const Any aAny( GetAny( rFlavor ) ); return( aAny.hasValue() && ( aAny >>= rSeq ) ); } @@ -2000,7 +2190,6 @@ sal_Bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, sal_Bool bRet = GetSequence( rFlavor, aSeq ); if( bRet ) - { rxStream = new SotStorageStream( String() ); rxStream->Write( aSeq.getConstArray(), aSeq.getLength() ); diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index f454fbd135a7..07cae571b2ae 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -175,7 +175,6 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com:: // ---------------------------------------------------- VCLXMultiLineEdit::VCLXMultiLineEdit() :maTextListeners( *this ) - ,mbJavaCompatibleTextNotifications( true ) ,meLineEndType( LINEEND_LF ) // default behavior before introducing this property: LF (unix-like) { } @@ -221,17 +220,11 @@ void VCLXMultiLineEdit::setText( const ::rtl::OUString& aText ) throw(::com::sun { pEdit->SetText( aText ); - if ( mbJavaCompatibleTextNotifications ) - { - // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht. - // ::com::sun::star::awt::Toolkit soll JAVA-komform sein... - if ( maTextListeners.getLength() ) - { - ::com::sun::star::awt::TextEvent aEvent; - aEvent.Source = (::cppu::OWeakObject*)this; - maTextListeners.textChanged( aEvent ); - } - } + // #107218# Call same listeners like VCL would do after user interaction + SetSynthesizingVCLEvent( sal_True ); + pEdit->SetModifyFlag(); + pEdit->Modify(); + SetSynthesizingVCLEvent( sal_False ); } } @@ -422,12 +415,6 @@ void VCLXMultiLineEdit::setProperty( const ::rtl::OUString& PropertyName, const MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow(); if ( pMultiLineEdit ) { - if ( PropertyName.equalsAscii( "JavaCompatibleTextNotifications" ) ) - { - Value >>= mbJavaCompatibleTextNotifications; - return; - } - sal_uInt16 nPropType = GetPropertyId( PropertyName ); switch ( nPropType ) { diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk index d40195609115..fffd9692e5dd 100644 --- a/svtools/util/makefile.mk +++ b/svtools/util/makefile.mk @@ -235,6 +235,10 @@ APP2STDLIBS+= -lsvl$(DLLPOSTFIX) APP2STDLIBS+= $(VCLLIB) \ $(TOOLSLIB) \ $(VOSLIB) \ + $(TKLIB) $(SOTLIB) $(UNOTOOLSLIB) $(I18NISOLANGLIB) $(I18NUTILLIB) \ + $(UCBHELPERLIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(CPPULIB) $(ICUUCLIB) \ + $(JVMFWKLIB) $(BASEGFXLIB) $(ICUDATALIB) $(JVMACCESSLIB) \ + $(SALHELPERLIB) $(ICULELIB) \ $(SALLIB) # --- Targets ------------------------------------------------------ diff --git a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java index be1ebef84a17..8f2d5ca839c5 100644 --- a/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java +++ b/toolkit/qa/complex/xunitconversion/XUnitConversionTest.java @@ -177,6 +177,11 @@ public class XUnitConversionTest extends ComplexTestCase assure("Size.Width not correct", delta(aSizeInMM_100TH.Width, aSizeInMM_10TH.Width * 10) < 10); assure("Size.Height not correct", delta(aSizeInMM_100TH.Height, aSizeInMM_10TH.Height * 10) < 10); + // new + checkSize(aSize, com.sun.star.util.MeasureUnit.PIXEL, "pixel"); + checkSize(aSize, com.sun.star.util.MeasureUnit.APPFONT, "appfont"); + checkSize(aSize, com.sun.star.util.MeasureUnit.SYSFONT, "sysfont"); + // simply check some more parameters checkSize(aSize, com.sun.star.util.MeasureUnit.MM, "mm"); checkSize(aSize, com.sun.star.util.MeasureUnit.CM, "cm"); diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx index af26e36072ed..cf00e1480a96 100644 --- a/toolkit/source/awt/vclxdevice.cxx +++ b/toolkit/source/awt/vclxdevice.cxx @@ -282,17 +282,16 @@ VCLXVirtualDevice::~VCLXVirtualDevice() // ----------------------------------------------------------------------------- -// ::com::sun::star::awt::XUnitConversion +// Interface implementation of ::com::sun::star::awt::XUnitConversion // ----------------------------------------------------------------------------- ::com::sun::star::awt::Point SAL_CALL VCLXDevice::convertPointToLogic( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { (void)aPoint; ::vos::OGuard aGuard( GetMutex() ); - if (TargetUnit == com::sun::star::util::MeasureUnit::PERCENT || - TargetUnit == com::sun::star::util::MeasureUnit::PIXEL) + if (TargetUnit == com::sun::star::util::MeasureUnit::PERCENT ) { - // pixel or percentage not allowed here + // percentage not allowed here throw ::com::sun::star::lang::IllegalArgumentException(); } @@ -339,10 +338,9 @@ VCLXVirtualDevice::~VCLXVirtualDevice() { (void)aSize; ::vos::OGuard aGuard( GetMutex() ); - if (TargetUnit == com::sun::star::util::MeasureUnit::PERCENT || - TargetUnit == com::sun::star::util::MeasureUnit::PIXEL) + if (TargetUnit == com::sun::star::util::MeasureUnit::PERCENT) { - // pixel or percentage not allowed here + // percentage not allowed here throw ::com::sun::star::lang::IllegalArgumentException(); } diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 298fb710d8a4..d76b56a6a37d 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -618,6 +618,23 @@ MapUnit /* MapModeUnit */ VCLUnoHelper::ConvertToMapModeUnit(sal_Int16 /* com.su case com::sun::star::util::MeasureUnit::PERCENT: break; */ + case com::sun::star::util::MeasureUnit::APPFONT: + eMode = MAP_APPFONT; + break; + + case com::sun::star::util::MeasureUnit::SYSFONT: + eMode = MAP_SYSFONT; + break; + +/* + case com::sun::star::util::MeasureUnit::RELATIVE: + eMode = MAP_RELATIVE; + break; + case com::sun::star::util::MeasureUnit::REALAPPFONT: + eMode = MAP_REALAPPFONT; + break; +*/ + default: throw ::com::sun::star::lang::IllegalArgumentException(::rtl::OUString::createFromAscii("Unsupported measure unit."), NULL, 1 ); } @@ -673,21 +690,20 @@ sal_Int16 /* com.sun.star.util.MeasureUnit.* */ VCLUnoHelper::ConvertToMeasureme nMeasureUnit = com::sun::star::util::MeasureUnit::PIXEL; break; -/* - case MAP_SYSFONT: + case MAP_APPFONT: + nMeasureUnit = com::sun::star::util::MeasureUnit::APPFONT; break; - case MAP_APPFONT: + case MAP_SYSFONT: + nMeasureUnit = com::sun::star::util::MeasureUnit::SYSFONT; break; +/* case MAP_RELATIVE: break; case MAP_REALAPPFONT: break; - - case MAP_LASTENUMDUMMY: - break; */ default: throw ::com::sun::star::lang::IllegalArgumentException(::rtl::OUString::createFromAscii("Unsupported MapMode unit."), NULL, 1 ); diff --git a/tools/bootstrp/addexes2/makefile.mk b/tools/bootstrp/addexes2/makefile.mk index 064a98de1301..343dd39c8c71 100644 --- a/tools/bootstrp/addexes2/makefile.mk +++ b/tools/bootstrp/addexes2/makefile.mk @@ -43,7 +43,7 @@ TARGETTYPE=CUI APP1TARGET= mkunroll APP1OBJS= $(OBJ)$/mkfilt.obj -APP1STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) +APP1STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) .IF "$(OS)"=="LINUX" APP1STDLIBS+=-lpthread .ENDIF diff --git a/tools/bootstrp/makefile.mk b/tools/bootstrp/makefile.mk index 33f161cf30a3..eca32dbd0503 100644 --- a/tools/bootstrp/makefile.mk +++ b/tools/bootstrp/makefile.mk @@ -81,17 +81,18 @@ LIB2OBJFILES=\ APP1TARGET= sspretty APP1OBJS= $(OBJ)$/sspretty.obj APP1LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib -APP1STDLIBS=$(SALLIB) $(VOSLIB) $(TOOLSLIB) +APP1STDLIBS=$(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) APP2TARGET= rscdep APP2OBJS= $(OBJ)$/rscdep.obj APP2LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib -APP2STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) +APP2STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) +APP2RPATH= NONE APP3TARGET= so_checksum APP3OBJS= $(OBJ)$/md5.obj \ $(OBJ)$/so_checksum.obj -APP3STDLIBS= $(TOOLSLIB) $(SALLIB) +APP3STDLIBS= $(TOOLSLIB) $(SALLIB) $(VOSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) DEPOBJFILES = $(APP1OBJS) $(APP2OBJS) $(APP3OBJS) diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index cb08d2df6c1e..3a87ecc35250 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -2735,8 +2735,10 @@ FSysError DirEntry::CopyTo( const DirEntry& rDest, FSysAction nActions ) const HACK(redirection missing) ByteString aThis(GUI2FSYS(GetFull()), osl_getThreadTextEncoding()); ByteString aDest(GUI2FSYS(rDest.GetFull()), osl_getThreadTextEncoding()); - link( aThis.GetBuffer(), aDest.GetBuffer() ); - return Sys2SolarError_Impl( errno ); + if (link( aThis.GetBuffer(), aDest.GetBuffer() ) == -1) + return Sys2SolarError_Impl( errno ); + else + return FSYS_ERR_OK; } #else return FSYS_ERR_NOTSUPPORTED; diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx index af52e362c284..c01d7bbd31e5 100644 --- a/tools/source/misc/extendapplicationenvironment.cxx +++ b/tools/source/misc/extendapplicationenvironment.cxx @@ -71,7 +71,12 @@ void extendApplicationEnvironment() { if (rtl::Bootstrap::get( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP")), uri)) { - env.append(rtl::Bootstrap::encode(uri)); + if (!uri.matchIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.pathname:"))) + { + uri = rtl::Bootstrap::encode(uri); + } + env.append(uri); } else { if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None) { abort(); diff --git a/tools/source/testtoolloader/testtoolloader.cxx b/tools/source/testtoolloader/testtoolloader.cxx index a46b4d4c78c0..f0263c001e29 100644 --- a/tools/source/testtoolloader/testtoolloader.cxx +++ b/tools/source/testtoolloader/testtoolloader.cxx @@ -54,6 +54,7 @@ namespace tools static oslModule aTestToolModule = 0; // are we to be automated at all? static bool bAutomate = false; +static bool bLoggerStarted = false; sal_uInt32 GetCommandLineParamCount() @@ -137,7 +138,10 @@ void InitTestToolLib() oslGenericFunction pInitFunc = osl_getFunctionSymbol( aTestToolModule, aFuncName.pData ); if ( pInitFunc ) + { (reinterpret_cast< pfunc_CreateEventLogger >(pInitFunc))(); + bLoggerStarted = TRUE; + } else { DBG_ERROR1( "Unable to get Symbol 'CreateEventLogger' from library %s while loading testtool support.", SVLIBRARY( "sts" ) ); @@ -164,14 +168,17 @@ void DeInitTestToolLib() (reinterpret_cast< pfunc_DestroyRemoteControl >(pDeInitFunc))(); } - if ( ::comphelper::UiEventsLogger::isEnabled() ) + if ( bLoggerStarted /*::comphelper::UiEventsLogger::isEnabled()*/ ) { OUString aFuncName( RTL_CONSTASCII_USTRINGPARAM( "DestroyEventLogger" )); oslGenericFunction pDeInitFunc = osl_getFunctionSymbol( aTestToolModule, aFuncName.pData ); if ( pDeInitFunc ) + { (reinterpret_cast< pfunc_DestroyEventLogger >(pDeInitFunc))(); + bLoggerStarted = FALSE; + } } osl_unloadModule( aTestToolModule ); diff --git a/transex3/layout/makefile.mk b/transex3/layout/makefile.mk index 9864b46242b2..daa9d569508b 100644 --- a/transex3/layout/makefile.mk +++ b/transex3/layout/makefile.mk @@ -65,6 +65,7 @@ APP1OBJS = $(OBJFILES) APP1STDLIBS =\ $(TOOLSLIB)\ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(EXPATASCII3RDLIB)\ $(VOSLIB)\ $(CPPULIB) \ diff --git a/transex3/scripts/localize b/transex3/scripts/localize index 4c366d026ca4..74a75ecc3aee 100755 --- a/transex3/scripts/localize +++ b/transex3/scripts/localize @@ -3,6 +3,15 @@ if [ x${SOLARENV}x = xx ]; then echo No environment found, please use 'setsolar' exit 1 fi + +# localize.pl calls localize_sl in solver bin directory which depends on dynamic +# libraries in solver lib directory but has no correct RPATH (or equivalent): +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + if [ x${SOLARVER}x = xx -o x${UPDMINOR}x = xx ]; then exec perl -w $SOLARVERSION/$INPATH/bin/localize.pl "$@" else diff --git a/transex3/source/export2.cxx b/transex3/source/export2.cxx index 40ed6734c347..5db1067a7afb 100644 --- a/transex3/source/export2.cxx +++ b/transex3/source/export2.cxx @@ -165,15 +165,15 @@ void Export::QuotHTMLXRM( ByteString &rString ) switch ( rString.GetChar( i )) { case '<': if( i+2 < rString.Len() && - rString.GetChar( i+1 ) == 'b' || rString.GetChar( i+1 ) == 'B' && - rString.GetChar( +2 ) == '>' ) + (rString.GetChar( i+1 ) == 'b' || rString.GetChar( i+1 ) == 'B') && + rString.GetChar( i+2 ) == '>' ) { sReturn +="<b>"; i += 2; } else if( i+3 < rString.Len() && rString.GetChar( i+1 ) == '/' && - rString.GetChar( i+2 ) == 'b' || rString.GetChar( i+2 ) == 'B' && + (rString.GetChar( i+2 ) == 'b' || rString.GetChar( i+2 ) == 'B') && rString.GetChar( i+3 ) == '>' ) { sReturn +="</b>"; diff --git a/transex3/source/makefile.mk b/transex3/source/makefile.mk index 8c7a486e7381..b26a6e0a82bb 100644 --- a/transex3/source/makefile.mk +++ b/transex3/source/makefile.mk @@ -84,6 +84,7 @@ APP1TARGET= transex3 APP1OBJS= $(OBJ)$/src_yy_wrapper.obj APP1STDLIBS+= \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB)\ $(TOOLSLIB) \ $(VOSLIB) \ $(SALLIB) @@ -97,12 +98,13 @@ APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib APP2TARGET= helpex APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj $(OBJ)$/hw2fw.obj +APP2RPATH= NONE .IF "$(OS)"!="MACOSX" .ENDIF -APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB) - +APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) .IF "$(OS)"=="MACOSX" # static libs at end for OS X .ENDIF @@ -110,12 +112,14 @@ APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB) # extractor and merger for *.lng and *.lng APP3TARGET= ulfex APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/hw2fw.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj $(OBJ)$/utf8conv.obj +APP3RPATH= NONE .IF "$(OS)"!="MACOSX" #APP3STDLIBS+= $(BTSTRPLIB) .ENDIF APP3STDLIBS+= \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ $(SALLIB) .IF "$(OS)"=="MACOSX" @@ -127,6 +131,7 @@ APP4TARGET= gsiconv APP4OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/gsiconv.obj APP4STDLIBS+= \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ $(SALLIB) @@ -135,6 +140,7 @@ APP5TARGET= gsicheck APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj APP5STDLIBS+= \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ $(SALLIB) @@ -148,6 +154,7 @@ APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/hw2fw.obj $( APP6STDLIBS+= \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ $(SALLIB) @@ -158,12 +165,14 @@ APP6STDLIBS+= \ # extractor and merger for *.xrm APP7TARGET= xrmex APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/hw2fw.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj +APP7RPATH= NONE .IF "$(OS)"!="MACOSX" .ENDIF APP7STDLIBS+= \ $(TOOLSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(VOSLIB) \ $(SALLIB) @@ -175,7 +184,8 @@ APP7STDLIBS+= \ APP8TARGET= txtconv #APP8STACK= 16000 APP8OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/txtconv.obj $(OBJ)$/hw2fw.obj -APP8STDLIBS=$(TOOLSLIB) $(SALLIB) +APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(VOSLIB) \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) # localizer for l10n framework APP9TARGET= localize_sl @@ -184,6 +194,7 @@ EXCEPTIONSFILES= \ APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/utf8conv.obj $(OBJ)$/srciter.obj $(OBJ)$/export2.obj $(OBJ)$/file.obj $(OBJ)$/directory.obj APP9STDLIBS+= \ + $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(I18NISOLANGLIB) \ $(TOOLSLIB) \ $(VOSLIB) \ $(SALLIB) diff --git a/transex3/source/tagtest.cxx b/transex3/source/tagtest.cxx index 1a31221be7f0..89c1ecf15488 100644 --- a/transex3/source/tagtest.cxx +++ b/transex3/source/tagtest.cxx @@ -440,12 +440,12 @@ BOOL TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aVal BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const { // name everything that is allowed to be fixed automatically here - if ( aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" ) - || aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ) - || aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" ) - || aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" ) - || aTagName.EqualsAscii( "image" ) && aName.Equals( "src" ) - || aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) ) + if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" )) + || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" )) + || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" )) + || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" )) + || (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" )) + || (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) )) return TRUE; return FALSE; } diff --git a/transex3/source/xmlparse.cxx b/transex3/source/xmlparse.cxx index a2212783ad56..921f1d329f67 100644 --- a/transex3/source/xmlparse.cxx +++ b/transex3/source/xmlparse.cxx @@ -32,14 +32,14 @@ #include "precompiled_transex3.hxx" #include <iterator> /* std::iterator*/ - #include <stdio.h> #include <sal/alloca.h> #include "xmlparse.hxx" #include <fstream> #include <iostream> -#include "osl/mutex.hxx" +#include <osl/mutex.hxx> +#include <osl/thread.hxx> #ifdef __MINGW32__ #include <tools/prewin.h> #include <tools/postwin.h> @@ -281,11 +281,11 @@ BOOL XMLFile::Write( ByteString &aFilename ) if( !aFStream ) // From time to time the stream can not be opened the first time on NFS volumes, { // I wasn't able to track this down. I think this is an NFS issue ..... //cerr << "ERROR: - helpex - Can't write to tempfile " << aFilename.GetBuffer() << " No#" << x << "\n"; -#if defined(UNX) || defined(OS2) - sleep( 3 ); -#else - Sleep( 3 ); -#endif + TimeValue aTime; + aTime.Seconds = 3; + aTime.Nanosec = 0; + + osl::Thread::wait( aTime ); } else { diff --git a/unotools/inc/unotools/sharedunocomponent.hxx b/unotools/inc/unotools/sharedunocomponent.hxx index 0ca5f6fcf77f..10c552c38336 100644 --- a/unotools/inc/unotools/sharedunocomponent.hxx +++ b/unotools/inc/unotools/sharedunocomponent.hxx @@ -1,373 +1,373 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sharedunocomponent.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
-#define UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
-
-#include "unotoolsdllapi.h"
-
-#include <boost/shared_ptr.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <rtl/ref.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace lang {
- class XComponent;
- }
-} } }
-//............................................................................
-namespace utl
-{
-//............................................................................
-
- //========================================================================
- //= DisposableComponent
- //========================================================================
- /** is a class which controls lifetime of an UNO component via ->XComponent::dispose
-
- You'll usually never use this class directly, but only as parameter for a
- ->SharedUNOComponent class.
- */
- class UNOTOOLS_DLLPUBLIC DisposableComponent
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
- m_xComponent;
-
- public:
- /** constructs a ->DisposableComponent instance
-
- @param _rxComponent
- the component whose life time should be controlled by the instance. Must not be <NULL/>.
- */
- DisposableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
-
- /** disposes the component represented by the instance
-
- The component is queried for ->XComponent(which <em>must</em> be supported),
- and ->XComponent::dispose is invoked. A failure of this invocation (e.g. a thrown
- exception) is silenced in release builds, and reported in debug builds.
- */
- ~DisposableComponent();
-
- private:
- DisposableComponent(); // never implemented
- DisposableComponent( const DisposableComponent& ); // never implemented
- DisposableComponent& operator=( const DisposableComponent& ); // never implemented
- };
-
- //========================================================================
- //= CloseableComponent
- //========================================================================
- class CloseableComponentImpl;
- /** is a class which controls lifetime of an UNO component via ->XCloseable::close
-
- You'll usually never use this class directly, but only as parameter for a
- ->SharedUNOComponent class.
- */
- class UNOTOOLS_DLLPUBLIC CloseableComponent
- {
- private:
- /** Our IMPL class.
- */
- ::rtl::Reference< CloseableComponentImpl > m_pImpl;
-
- public:
- /** constructs a ->CloseableComponent instance
-
- @param _rxComponent
- the component whose life time should be controlled by the instance. Must not be <NULL/>.
- */
- CloseableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
-
- /** destroys resources associated with this instance, and disposes the component
-
- The component is queried for ->XCloseable (which <em>must</em> be supported),
- and ->XCloseable::close is invoked, with delivering the ownership.
- If the invocation fails with a ->CloseVetoException, this is ignored, since in
- this case the vetoing instance took the ownership.
-
- Any other failure will be reported in a debug version via assertion mechanisms,
- and silenced in release builds.
- */
- ~CloseableComponent();
-
- private:
- CloseableComponent(); // never implemented
- CloseableComponent( const CloseableComponent& ); // never implemented
- CloseableComponent& operator=( const CloseableComponent& ); // never implemented
- };
-
- //========================================================================
- //= SharedUNOComponent
- //========================================================================
- /** is a helper class for sharing ownership of a UNO component
-
- If you need to share an UNO component, which normally needs a dedicated owner,
- and is lifetime controlled by an explicit disposal action (not necessarily ->XComponent::dispose,
- but <em>any</em> explicit method call, after which the object is considered
- to be disposed), between different classes, ->SharedUNOComponent is what you need.
-
- Instead of passing around a <code>Reference< XFoo ></code>, and bothering
- with ownership and disposal, you just use a <code>SharedUNOComponent< XFoo ></code>.
- This instance can be passed around, including copying, and in nearly all respects behaves
- like the original <code>Reference< XFoo ></code>. However, when the last
- ->SharedUNOComponent referencing a certain <code>Reference< XFoo ></code> dies, it
- will automatically get rid of the object held by this reference.
-
- @param INTERFACE
- the UNO interface type as which the component should be held
-
- @param COMPONENT_HOLDER
- a class which can be used to represent and dispose a UNO component.
- The class must support (maybe explicit only) construction from a
- <code>Reference< INTERFACE ></code>, and destruction. Upon destruction,
- the class must dispose (by any suitable means) the component instance it was
- constructed with.
- */
- template < class INTERFACE, class COMPONENT = DisposableComponent >
- class SharedUNOComponent
- {
- private:
- typedef COMPONENT Component;
- typedef ::boost::shared_ptr< Component > ComponentPointer;
-
- private:
- ComponentPointer m_pComponent;
- ::com::sun::star::uno::Reference< INTERFACE > m_xTypedComponent;
-
- public:
- enum AssignmentMode
- {
- TakeOwnership,
- NoTakeOwnership
- };
-
- public:
- inline SharedUNOComponent()
- {
- }
-
- explicit inline SharedUNOComponent( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode eMode = TakeOwnership )
- {
- reset( _rxComponent, eMode );
- }
-
-#ifndef EXCEPTIONS_OFF
- inline SharedUNOComponent( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- set( _pInterface, _queryThrow );
- }
-
- inline SharedUNOComponent( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- set( _rRef, _queryThrow );
- }
-
- inline SharedUNOComponent( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- set( _rAny, _queryThrow );
- }
-
- inline SharedUNOComponent( const SharedUNOComponent& _rxComponent, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
- {
- set( _rxComponent, _setThrow );
- }
-#endif
-
-// SharedUNOComponent& operator=( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent );
- // this operator is not implemented by intention. There is no canonic ownership after this operatoer
- // would hvae been applied: Should the SharedUNOComponent have the ownership of the component,
- // or shouldn't it? Hard to guess, and probably wrong in 50 percent of all cases, anyway. So,
- // instead of tempting clients of this class to use such a dangerous operator, we do
- // not offer it at all. If you need to assign a Reference< INTERFACE > to your SharedUNOComponent,
- // use the ->reset method.
-
- /** assigns a new component, and releases the old one
- */
- void reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode = TakeOwnership );
-
- inline bool set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query );
- inline bool set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query );
- inline bool set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query );
-
-#ifndef EXCEPTIONS_OFF
- inline void set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
- inline void set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
- inline void set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow );
-
- inline void set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
- inline void set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
- inline void set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow );
-#endif
-
- INTERFACE* SAL_CALL operator->() const;
-
- inline operator const ::com::sun::star::uno::Reference< INTERFACE >&() const
- {
- return m_xTypedComponent;
- }
-
- inline const ::com::sun::star::uno::Reference< INTERFACE >& getTyped() const
- {
- return m_xTypedComponent;
- }
-
- inline bool is() const
- {
- return m_xTypedComponent.is();
- }
-
- inline void clear()
- {
- m_pComponent.reset();
- m_xTypedComponent.clear();
- }
- };
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- INTERFACE* SAL_CALL SharedUNOComponent< INTERFACE, COMPONENT >::operator->() const
- {
- return m_xTypedComponent.operator->();
- }
-
- //-------------------------------------------------------------------------
- // assignments
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode )
- {
- m_pComponent.reset( _eMode == TakeOwnership ? new COMPONENT( _rxComponent ) : NULL );
- m_xTypedComponent = _rxComponent;
- }
-
- //-------------------------------------------------------------------------
- // comparison operators
- template < class INTERFACE, class COMPONENT >
- bool operator==( const ::com::sun::star::uno::Reference< INTERFACE >& _rLHS, const SharedUNOComponent< INTERFACE, COMPONENT >& _rRHS )
- {
- return _rLHS == _rRHS.getTyped();
- }
-
- template < class INTERFACE, class COMPONENT >
- bool operator==( const SharedUNOComponent< INTERFACE, COMPONENT >& _rLHS, const ::com::sun::star::uno::Reference< INTERFACE >& _rRHS )
- {
- return _rLHS.getTyped() == _rRHS;
- }
-
- //-------------------------------------------------------------------------
- // conversion to Any
- template < class INTERFACE, class COMPONENT >
- inline void SAL_CALL operator <<= ( ::com::sun::star::uno::Any & rAny, const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW( () )
- {
- rAny <<= value.getTyped();
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- inline ::com::sun::star::uno::Any SAL_CALL makeAny( const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW( () )
- {
- return makeAny( value.getTyped() );
- }
-
-#ifndef EXCEPTIONS_OFF
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _queryThrow ), TakeOwnership );
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership );
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _queryThrow ), TakeOwnership );
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _setThrow ), TakeOwnership );
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _setThrow ), TakeOwnership );
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- void SharedUNOComponent< INTERFACE, COMPONENT >::set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow )
- {
- *this = _rComp;
- // provoke an exception in case the component is NULL
- m_xTypedComponent.set( m_xTypedComponent, _setThrow );
- }
-#endif
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- bool SharedUNOComponent< INTERFACE, COMPONENT >::set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _query ) );
- return is();
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _query ) );
- return is();
- }
-
- //-------------------------------------------------------------------------
- template < class INTERFACE, class COMPONENT >
- bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query )
- {
- reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _query ) );
- return is();
- }
-
-//............................................................................
-} // namespace utl
-//............................................................................
-
-#endif // UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sharedunocomponent.hxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX +#define UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX + +#include "unotoolsdllapi.h" + +#include <boost/shared_ptr.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <rtl/ref.hxx> + +namespace com { namespace sun { namespace star { + namespace lang { + class XComponent; + } +} } } +//............................................................................ +namespace utl +{ +//............................................................................ + + //======================================================================== + //= DisposableComponent + //======================================================================== + /** is a class which controls lifetime of an UNO component via ->XComponent::dispose + + You'll usually never use this class directly, but only as parameter for a + ->SharedUNOComponent class. + */ + class UNOTOOLS_DLLPUBLIC DisposableComponent + { + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > + m_xComponent; + + public: + /** constructs a ->DisposableComponent instance + + @param _rxComponent + the component whose life time should be controlled by the instance. Must not be <NULL/>. + */ + DisposableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); + + /** disposes the component represented by the instance + + The component is queried for ->XComponent(which <em>must</em> be supported), + and ->XComponent::dispose is invoked. A failure of this invocation (e.g. a thrown + exception) is silenced in release builds, and reported in debug builds. + */ + ~DisposableComponent(); + + private: + DisposableComponent(); // never implemented + DisposableComponent( const DisposableComponent& ); // never implemented + DisposableComponent& operator=( const DisposableComponent& ); // never implemented + }; + + //======================================================================== + //= CloseableComponent + //======================================================================== + class CloseableComponentImpl; + /** is a class which controls lifetime of an UNO component via ->XCloseable::close + + You'll usually never use this class directly, but only as parameter for a + ->SharedUNOComponent class. + */ + class UNOTOOLS_DLLPUBLIC CloseableComponent + { + private: + /** Our IMPL class. + */ + ::rtl::Reference< CloseableComponentImpl > m_pImpl; + + public: + /** constructs a ->CloseableComponent instance + + @param _rxComponent + the component whose life time should be controlled by the instance. Must not be <NULL/>. + */ + CloseableComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); + + /** destroys resources associated with this instance, and disposes the component + + The component is queried for ->XCloseable (which <em>must</em> be supported), + and ->XCloseable::close is invoked, with delivering the ownership. + If the invocation fails with a ->CloseVetoException, this is ignored, since in + this case the vetoing instance took the ownership. + + Any other failure will be reported in a debug version via assertion mechanisms, + and silenced in release builds. + */ + ~CloseableComponent(); + + private: + CloseableComponent(); // never implemented + CloseableComponent( const CloseableComponent& ); // never implemented + CloseableComponent& operator=( const CloseableComponent& ); // never implemented + }; + + //======================================================================== + //= SharedUNOComponent + //======================================================================== + /** is a helper class for sharing ownership of a UNO component + + If you need to share an UNO component, which normally needs a dedicated owner, + and is lifetime controlled by an explicit disposal action (not necessarily ->XComponent::dispose, + but <em>any</em> explicit method call, after which the object is considered + to be disposed), between different classes, ->SharedUNOComponent is what you need. + + Instead of passing around a <code>Reference< XFoo ></code>, and bothering + with ownership and disposal, you just use a <code>SharedUNOComponent< XFoo ></code>. + This instance can be passed around, including copying, and in nearly all respects behaves + like the original <code>Reference< XFoo ></code>. However, when the last + ->SharedUNOComponent referencing a certain <code>Reference< XFoo ></code> dies, it + will automatically get rid of the object held by this reference. + + @param INTERFACE + the UNO interface type as which the component should be held + + @param COMPONENT_HOLDER + a class which can be used to represent and dispose a UNO component. + The class must support (maybe explicit only) construction from a + <code>Reference< INTERFACE ></code>, and destruction. Upon destruction, + the class must dispose (by any suitable means) the component instance it was + constructed with. + */ + template < class INTERFACE, class COMPONENT = DisposableComponent > + class SharedUNOComponent + { + private: + typedef COMPONENT Component; + typedef ::boost::shared_ptr< Component > ComponentPointer; + + private: + ComponentPointer m_pComponent; + ::com::sun::star::uno::Reference< INTERFACE > m_xTypedComponent; + + public: + enum AssignmentMode + { + TakeOwnership, + NoTakeOwnership + }; + + public: + inline SharedUNOComponent() + { + } + + explicit inline SharedUNOComponent( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode eMode = TakeOwnership ) + { + reset( _rxComponent, eMode ); + } + +#ifndef EXCEPTIONS_OFF + inline SharedUNOComponent( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + set( _pInterface, _queryThrow ); + } + + inline SharedUNOComponent( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + set( _rRef, _queryThrow ); + } + + inline SharedUNOComponent( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + set( _rAny, _queryThrow ); + } + + inline SharedUNOComponent( const SharedUNOComponent& _rxComponent, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ) + { + set( _rxComponent, _setThrow ); + } +#endif + +// SharedUNOComponent& operator=( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent ); + // this operator is not implemented by intention. There is no canonic ownership after this operatoer + // would hvae been applied: Should the SharedUNOComponent have the ownership of the component, + // or shouldn't it? Hard to guess, and probably wrong in 50 percent of all cases, anyway. So, + // instead of tempting clients of this class to use such a dangerous operator, we do + // not offer it at all. If you need to assign a Reference< INTERFACE > to your SharedUNOComponent, + // use the ->reset method. + + /** assigns a new component, and releases the old one + */ + void reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode = TakeOwnership ); + + inline bool set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query ); + inline bool set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query ); + inline bool set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query ); + +#ifndef EXCEPTIONS_OFF + inline void set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); + inline void set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); + inline void set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ); + + inline void set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ); + inline void set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ); + inline void set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ); +#endif + + INTERFACE* SAL_CALL operator->() const; + + inline operator const ::com::sun::star::uno::Reference< INTERFACE >&() const + { + return m_xTypedComponent; + } + + inline const ::com::sun::star::uno::Reference< INTERFACE >& getTyped() const + { + return m_xTypedComponent; + } + + inline bool is() const + { + return m_xTypedComponent.is(); + } + + inline void clear() + { + m_pComponent.reset(); + m_xTypedComponent.clear(); + } + }; + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + INTERFACE* SAL_CALL SharedUNOComponent< INTERFACE, COMPONENT >::operator->() const + { + return m_xTypedComponent.operator->(); + } + + //------------------------------------------------------------------------- + // assignments + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::reset( const ::com::sun::star::uno::Reference< INTERFACE >& _rxComponent, AssignmentMode _eMode ) + { + m_pComponent.reset( _eMode == TakeOwnership ? new COMPONENT( _rxComponent ) : NULL ); + m_xTypedComponent = _rxComponent; + } + + //------------------------------------------------------------------------- + // comparison operators + template < class INTERFACE, class COMPONENT > + bool operator==( const ::com::sun::star::uno::Reference< INTERFACE >& _rLHS, const SharedUNOComponent< INTERFACE, COMPONENT >& _rRHS ) + { + return _rLHS == _rRHS.getTyped(); + } + + template < class INTERFACE, class COMPONENT > + bool operator==( const SharedUNOComponent< INTERFACE, COMPONENT >& _rLHS, const ::com::sun::star::uno::Reference< INTERFACE >& _rRHS ) + { + return _rLHS.getTyped() == _rRHS; + } + + //------------------------------------------------------------------------- + // conversion to Any + template < class INTERFACE, class COMPONENT > + inline void SAL_CALL operator <<= ( ::com::sun::star::uno::Any & rAny, const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW( () ) + { + rAny <<= value.getTyped(); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + inline ::com::sun::star::uno::Any SAL_CALL makeAny( const SharedUNOComponent< INTERFACE, COMPONENT >& value ) SAL_THROW( () ) + { + return makeAny( value.getTyped() ); + } + +#ifndef EXCEPTIONS_OFF + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _queryThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference & _rRef, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _queryThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_QueryThrow _queryThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _queryThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const INTERFACE* _pInterface, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _setThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Reference< INTERFACE >& _rRef, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _setThrow ), TakeOwnership ); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + void SharedUNOComponent< INTERFACE, COMPONENT >::set( const SharedUNOComponent& _rComp, ::com::sun::star::uno::UnoReference_SetThrow _setThrow ) + { + *this = _rComp; + // provoke an exception in case the component is NULL + m_xTypedComponent.set( m_xTypedComponent, _setThrow ); + } +#endif + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( ::com::sun::star::uno::XInterface* _pInterface, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _pInterface, _query ) ); + return is(); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::BaseReference& _rRef, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rRef, _query ) ); + return is(); + } + + //------------------------------------------------------------------------- + template < class INTERFACE, class COMPONENT > + bool SharedUNOComponent< INTERFACE, COMPONENT >::set( const ::com::sun::star::uno::Any& _rAny, ::com::sun::star::uno::UnoReference_Query _query ) + { + reset( ::com::sun::star::uno::Reference< INTERFACE >( _rAny, _query ) ); + return is(); + } + +//............................................................................ +} // namespace utl +//............................................................................ + +#endif // UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 234fa88c7c34..2b301efc4e52 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -694,7 +694,7 @@ sal_Bool UCBContentHelper::IsYounger( const String& rIsYoung, const String& rIsO // ----------------------------------------------------------------------- sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, String& rFile, BOOL bAllowWildCards ) { - BOOL bWild = bAllowWildCards && rName.Search( '*' ) != STRING_NOTFOUND || rName.Search( '?' ) != STRING_NOTFOUND; + BOOL bWild = bAllowWildCards && ( rName.Search( '*' ) != STRING_NOTFOUND || rName.Search( '?' ) != STRING_NOTFOUND ); sal_Bool bRet = sal_False; @@ -709,7 +709,7 @@ sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, Str INetURLObject aFileObject( pFiles[i] ); String aFile = aFileObject.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ).toAsciiLowerCase(); - if ( bWild && WildCard( rName ).Matches( aFile ) || aFile == rName ) + if ( (bWild && WildCard( rName ).Matches( aFile )) || aFile == rName ) { // names match rFile = aFileObject.GetMainURL( INetURLObject::NO_DECODE ); diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 0b44d742d776..e969cc8509a1 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -71,15 +71,15 @@ AquaSalFrame* mpFrame; // for NSTextInput - id mpLastEvent; - BOOL mbNeedSpecialKeyHandle; - BOOL mbInKeyInput; - BOOL mbKeyHandled; - NSRange mMarkedRange; - NSRange mSelectedRange; - id mpMouseEventListener; - id mDraggingDestinationHandler; - id mpLastSuperEvent; + NSEvent* mpLastEvent; + BOOL mbNeedSpecialKeyHandle; + BOOL mbInKeyInput; + BOOL mbKeyHandled; + NSRange mMarkedRange; + NSRange mSelectedRange; + id mpMouseEventListener; + id mDraggingDestinationHandler; + NSEvent* mpLastSuperEvent; } +(void)unsetMouseFrame: (AquaSalFrame*)pFrame; -(id)initWithSalFrame: (AquaSalFrame*)pFrame; @@ -100,6 +100,9 @@ -(void)otherMouseDragged: (NSEvent*)pEvent; -(void)otherMouseUp: (NSEvent*)pEvent; -(void)scrollWheel: (NSEvent*)pEvent; +-(void)magnifyWithEvent: (NSEvent*)pEvent; +-(void)rotateWithEvent: (NSEvent*)pEvent; +-(void)swipeWithEvent: (NSEvent*)pEvent; -(void)keyDown: (NSEvent*)pEvent; -(void)flagsChanged: (NSEvent*)pEvent; -(void)sendMouseEventToFrame:(NSEvent*)pEvent button:(USHORT)nButton eventtype:(USHORT)nEvent; diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm index cec0064e420f..4bf88d49d04a 100644 --- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm +++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm @@ -264,58 +264,12 @@ using namespace ::com::sun::star::uno; return nativeSubrole; } -// TODO: the role description requires a localized string with a short description of the specific control -// i.e. "button" if the Role is AccessibleRole::PUSH_BUTTON. the OOo-a11y-API does not have such an attribute -// possible solution: hard-coded, non localized (english) descriptions (better than nothing, and voiceover -// reads the text in english pronounciation anyway) -// Use: NSAccessibilityRoleDescription +(id)getRoleDescriptionFrom: (NSString *) role with: (NSString *) subRole { - id roleDescription = @""; - if ( [ role isEqualToString: NSAccessibilityUnknownRole ] ) { - roleDescription = @"unknown"; - } else if ( [ role isEqualToString: NSAccessibilityComboBoxRole ] ) { - roleDescription = @"combo box"; - } else if ( [ role isEqualToString: NSAccessibilityStaticTextRole ] ) { - roleDescription = @"text"; - } else if ( [ role isEqualToString: NSAccessibilityListRole ] ) { - roleDescription = @"list"; - } else if ( [ role isEqualToString: NSAccessibilityMenuRole ] ) { - roleDescription = @"menu"; - } else if ( [ role isEqualToString: NSAccessibilityMenuItemRole ] ) { - roleDescription = @"menu item"; - } else if ( [ role isEqualToString: NSAccessibilityButtonRole ] ) { - roleDescription = @"button"; - } else if ( [ role isEqualToString: NSAccessibilityScrollBarRole ] ) { - roleDescription = @"scroll bar"; - } else if ( [ role isEqualToString: NSAccessibilityScrollAreaRole ] ) { - roleDescription = @"scroll area"; - } else if ( [ role isEqualToString: NSAccessibilityGroupRole ] ) { - roleDescription = @"group"; - } else if ( [ role isEqualToString: NSAccessibilityTextAreaRole ] ) { - roleDescription = @"text entry area"; - } else if ( [ role isEqualToString: NSAccessibilityToolbarRole ] ) { - roleDescription = @"toolbar"; - } else if ( [ role isEqualToString: NSAccessibilityTableRole ] ) { - roleDescription = @"table"; - } else if ( [ role isEqualToString: NSAccessibilityTabGroupRole ] ) { - roleDescription = @"tab group"; - } else if ( [ role isEqualToString: NSAccessibilityCheckBoxRole ] ) { - roleDescription = @"check box"; - } else if ( [ role isEqualToString: NSAccessibilityRadioGroupRole ] ) { - roleDescription = @"radio group"; - } else if ( [ role isEqualToString: NSAccessibilityRadioButtonRole ] ) { - roleDescription = @"radio button"; - } else if ( [ role isEqualToString: NSAccessibilityRowRole ] ) { - if ( [ subRole isEqualToString: NSAccessibilityOutlineRowSubrole ] ) { - roleDescription = @"outline row"; - } else if ( [ subRole isEqualToString: NSAccessibilityTableRowSubrole ] ) { - roleDescription = @"table row"; - } - } else if ( [ role isEqualToString: NSAccessibilityMenuButtonRole ] ) { - roleDescription = @"menu button"; - } else if ( [ role isEqualToString: NSAccessibilityPopUpButtonRole ] ) { - roleDescription = @"popup menu button"; - } + id roleDescription; + if ( [ subRole length ] == 0 ) + roleDescription = NSAccessibilityRoleDescription( role, nil ); + else + roleDescription = NSAccessibilityRoleDescription( role, subRole ); return roleDescription; } diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index a4827870efa9..929c8dd19c64 100755 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -35,6 +35,8 @@ #include "salatsuifontutils.hxx" #include "tools/debug.hxx" +#include <math.h> + // ======================================================================= class ATSLayout : public SalLayout @@ -86,6 +88,7 @@ private: // mutable members since these details are all lazy initialized mutable int mnGlyphCount; // glyph count mutable Fixed mnCachedWidth; // cached value of resulting typographical width + int mnTrailingSpaceWidth; // in Pixels mutable ATSGlyphRef* mpGlyphIds; // ATSU glyph ids mutable Fixed* mpCharWidths; // map relative charpos to charwidth @@ -104,8 +107,8 @@ private: mutable class FallbackInfo* mpFallbackInfo; // x-offset relative to layout origin - // currently always zero since we use native glyph fallback - static const Fixed mnBaseAdv = 0; + // currently only used in RTL-layouts + mutable Fixed mnBaseAdv; }; class FallbackInfo @@ -130,6 +133,7 @@ ATSLayout::ATSLayout( ATSUStyle& rATSUStyle, float fFontScale ) mfFontScale( fFontScale ), mnGlyphCount( -1 ), mnCachedWidth( 0 ), + mnTrailingSpaceWidth( 0 ), mpGlyphIds( NULL ), mpCharWidths( NULL ), mpChars2Glyphs( NULL ), @@ -138,7 +142,8 @@ ATSLayout::ATSLayout( ATSUStyle& rATSUStyle, float fFontScale ) mpGlyphAdvances( NULL ), mpGlyphOrigAdvs( NULL ), mpDeltaY( NULL ), - mpFallbackInfo( NULL ) + mpFallbackInfo( NULL ), + mnBaseAdv( 0 ) {} // ----------------------------------------------------------------------- @@ -240,20 +245,43 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs ) if( eStatus != noErr ) return false; - // enable "glyph fallback" - ATSUAttributeTag theTags[1]; - ByteCount theSizes[1]; - ATSUAttributeValuePtr theValues[1]; + // prepare setting of layout controls + static const int nMaxTagCount = 1; + ATSUAttributeTag aTagAttrs[ nMaxTagCount ]; + ByteCount aTagSizes[ nMaxTagCount ]; + ATSUAttributeValuePtr aTagValues[ nMaxTagCount ]; + + // prepare control of "glyph fallback" + const SalData* pSalData = GetSalData(); + ATSUFontFallbacks aFontFallbacks = pSalData->mpFontList->maFontFallbacks; + aTagAttrs[0] = kATSULineFontFallbacksTag; + aTagSizes[0] = sizeof( ATSUFontFallbacks ); + aTagValues[0] = &aFontFallbacks; - SalData* pSalData = GetSalData(); - ATSUFontFallbacks theFontFallbacks = pSalData->mpFontList->maFontFallbacks; - theTags[0] = kATSULineFontFallbacksTag; - theSizes[0] = sizeof( ATSUFontFallbacks ); - theValues[0] = &theFontFallbacks; + // set paragraph layout controls + ATSUSetLayoutControls( maATSULayout, 1, aTagAttrs, aTagSizes, aTagValues ); - ATSUSetLayoutControls( maATSULayout, 1, theTags, theSizes, theValues ); + // enable "glyph fallback" ATSUSetTransientFontMatching( maATSULayout, true ); + // control run-specific layout controls + if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_STRONG) != 0 ) + { + // control BiDi defaults + MacOSBOOL nLineDirTag = kATSULeftToRightBaseDirection; + if( (rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) != 0 ) + nLineDirTag = kATSURightToLeftBaseDirection; + aTagAttrs[0] = kATSULineDirectionTag; + aTagSizes[0] = sizeof( nLineDirTag ); + aTagValues[0] = &nLineDirTag; + // set run-specific layout controls +#if 0 // why don't line-controls work as reliably as layout-controls??? + ATSUSetLineControls( maATSULayout, rArgs.mnMinCharPos, 1, aTagAttrs, aTagSizes, aTagValues ); +#else + ATSUSetLayoutControls( maATSULayout, 1, aTagAttrs, aTagSizes, aTagValues ); +#endif + } + return true; } @@ -277,12 +305,16 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs ) nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ]; // workaround for ATSUI not using trailing spaces for justification - int nTrailingSpaceWidth = 0; + mnTrailingSpaceWidth = 0; int i = mnCharCount; while( (--i > 0) && IsSpacingGlyph( rArgs.mpStr[mnMinCharPos+i]|GF_ISCHAR ) ) - nTrailingSpaceWidth += rArgs.mpDXArray[i] - rArgs.mpDXArray[i-1]; - nOrigWidth -= nTrailingSpaceWidth; - nPixelWidth -= nTrailingSpaceWidth; + mnTrailingSpaceWidth += rArgs.mpDXArray[i] - rArgs.mpDXArray[i-1]; + nOrigWidth -= mnTrailingSpaceWidth; + nPixelWidth -= mnTrailingSpaceWidth; + // trailing spaces can be leftmost spaces in RTL-layouts + // TODO: use BiDi-algorithm to thoroughly check this assumption + if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) + mnBaseAdv = mnTrailingSpaceWidth; // TODO: use all mpDXArray elements for layouting } @@ -387,9 +419,19 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const for(; it != maSubPortions.end(); ++it ) { const SubPortion& rSubPortion = *it; + // calculate sub-portion offset for rotated text + Fixed nXOfsFixed = 0, nYOfsFixed = 0; + if( rAquaGraphics.mnATSUIRotation != 0 ) + { + const double fRadians = rAquaGraphics.mnATSUIRotation * (M_PI/0xB40000); + nXOfsFixed = +rSubPortion.mnXOffset * cos( fRadians ); + nYOfsFixed = +rSubPortion.mnXOffset * sin( fRadians ); + } + + // draw sub-portions ATSUDrawText( maATSULayout, rSubPortion.mnMinCharPos, rSubPortion.mnEndCharPos - rSubPortion.mnMinCharPos, - nFixedX + rSubPortion.mnXOffset, nFixedY ); + nFixedX + nXOfsFixed, nFixedY + nYOfsFixed ); } } @@ -564,7 +606,9 @@ long ATSLayout::GetTextWidth() const if( mnCharCount <= 0 ) return 0; - DBG_ASSERT( (maATSULayout != NULL), "ATSLayout::GetTextWidth() with maATSULayout==NULL !\n"); + DBG_ASSERT( (maATSULayout!=NULL), "ATSLayout::GetTextWidth() with maATSULayout==NULL !\n"); + if( !maATSULayout ) + return 0; if( !mnCachedWidth ) { @@ -604,9 +648,11 @@ long ATSLayout::GetTextWidth() const // measure the bound extremas mnCachedWidth = nRightBound - nLeftBound; + // adjust for eliminated trailing space widths } - const int nScaledWidth = Fixed2Vcl( mnCachedWidth ); + int nScaledWidth = Fixed2Vcl( mnCachedWidth ); + nScaledWidth += mnTrailingSpaceWidth; return nScaledWidth; } @@ -626,6 +672,9 @@ long ATSLayout::FillDXArray( long* pDXArray ) const if( !pDXArray ) return GetTextWidth(); + // check assumptions + DBG_ASSERT( !mnTrailingSpaceWidth, "ATSLayout::FillDXArray() with nTSW!=0" ); + // initialize details about the resulting layout InitGIA(); @@ -659,9 +708,16 @@ long ATSLayout::FillDXArray( long* pDXArray ) const **/ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const { + if( !maATSULayout ) + return STRING_LEN; + // get a quick overview on what could fit const long nPixelWidth = (nMaxWidth - (nCharExtra * mnCharCount)) / nFactor; + // check assumptions + DBG_ASSERT( !mnTrailingSpaceWidth, "ATSLayout::GetTextBreak() with nTSW!=0" ); + + // initial measurement of text break position UniCharArrayOffset nBreakPos = mnMinCharPos; const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); OSStatus nStatus = ATSUBreakLine( maATSULayout, mnMinCharPos, @@ -889,7 +945,8 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const if( pArgs && pArgs->mpDXArray ) { // TODO: non-strong-LTR case cases should be handled too - if( 0 == (~pArgs->mnFlags & (TEXT_LAYOUT_BIDI_STRONG|TEXT_LAYOUT_BIDI_LTR)) ) + if( (pArgs->mnFlags & TEXT_LAYOUT_BIDI_STRONG) + && !(pArgs->mnFlags & TEXT_LAYOUT_BIDI_RTL) ) { Fixed nSumCharWidths = 0; SubPortion aSubPortion = { mnMinCharPos, 0, 0 }; @@ -973,6 +1030,9 @@ bool ATSLayout::GetDeltaY() const return true; #if 1 + if( !maATSULayout ) + return false; + // get and keep the y-deltas in the mpDeltaY member variable // => release it in the destructor ItemCount nDeltaCount = 0; diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index bc7082c33d1c..c39dc26f370f 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -36,20 +36,22 @@ #include "salbmp.h" #include "salframe.h" #include "salcolorutils.hxx" +#include "list.h" +#include "sft.h" +#include "salatsuifontutils.hxx" + #include "vcl/impfont.hxx" -#include "psprint/list.h" -#include "psprint/sft.h" +#include "vcl/sysdata.hxx" +#include "vcl/sallayout.hxx" +#include "vcl/svapp.hxx" + #include "osl/file.hxx" -#include "vos/mutex.hxx" #include "osl/process.h" -#include "rtl/bootstrap.h" -#include "rtl/strbuf.hxx" -#include "vcl/sysdata.hxx" +#include "vos/mutex.hxx" -#include "vcl/sallayout.hxx" -#include "salatsuifontutils.hxx" -#include "vcl/svapp.hxx" +#include "rtl/bootstrap.h" +#include "rtl/strbuf.hxx" #include "basegfx/range/b2drectangle.hxx" #include "basegfx/polygon/b2dpolygon.hxx" @@ -916,12 +918,20 @@ bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPol const ::basegfx::B2DPolygon rPolygon = rPolyPoly.getB2DPolygon( nPolyIdx ); AddPolygonToPath( xPath, rPolygon, true, !getAntiAliasB2DDraw(), IsPenVisible() ); } + + // use the path to prepare the graphics context CGContextSaveGState( mrContext ); CGContextBeginPath( mrContext ); CGContextAddPath( mrContext, xPath ); const CGRect aRefreshRect = CGPathGetBoundingBox( xPath ); CGPathRelease( xPath ); +#ifndef NO_I97317_WORKAROUND + // #i97317# workaround for Quartz having problems with drawing small polygons + if( (aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125) ) + return true; +#endif + // draw path with antialiased polygon CGContextSetShouldAntialias( mrContext, true ); CGContextSetAlpha( mrContext, 1.0 - fTransparency ); @@ -961,11 +971,19 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, // setup poly-polygon path CGMutablePathRef xPath = CGPathCreateMutable(); AddPolygonToPath( xPath, rPolyLine, rPolyLine.isClosed(), !getAntiAliasB2DDraw(), true ); + + // use the path to prepare the graphics context CGContextSaveGState( mrContext ); CGContextAddPath( mrContext, xPath ); const CGRect aRefreshRect = CGPathGetBoundingBox( xPath ); CGPathRelease( xPath ); +#ifndef NO_I97317_WORKAROUND + // #i97317# workaround for Quartz having problems with drawing small polygons + if( (aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125) ) + return true; +#endif + // draw path with antialiased line CGContextSetShouldAntialias( mrContext, true ); CGContextSetLineJoin( mrContext, aCGLineJoin ); @@ -1227,7 +1245,37 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY SalColor AquaSalGraphics::getPixel( long nX, long nY ) { - SalColor nSalColor = 0; + // return default value on printers or when out of bounds + if( !mxLayer + || (nX < 0) || (nX >= mnWidth) + || (nY < 0) || (nY >= mnHeight)) + return COL_BLACK; + + // prepare creation of matching a CGBitmapContext + CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace; + CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big; +#if __BIG_ENDIAN__ + struct{ unsigned char b, g, r, a; } aPixel; +#else + struct{ unsigned char a, r, g, b; } aPixel; +#endif + + // create a one-pixel bitmap context + // TODO: is it worth to cache it? + CGContextRef xOnePixelContext = ::CGBitmapContextCreate( &aPixel, + 1, 1, 8, sizeof(aPixel), aCGColorSpace, aCGBmpInfo ); + + // update this graphics layer + ApplyXorContext(); + + // copy the requested pixel into the bitmap context + if( IsFlipped() ) + nY = mnHeight - nY; + const CGPoint aCGPoint = {-nX, -nY}; + CGContextDrawLayerAtPoint( xOnePixelContext, aCGPoint, mxLayer ); + CGContextRelease( xOnePixelContext ); + + SalColor nSalColor = MAKE_SALCOLOR( aPixel.r, aPixel.g, aPixel.b ); return nSalColor; } @@ -1699,19 +1747,39 @@ BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& r long AquaSalGraphics::GetGraphicsWidth() const { + long w = 0; if( mrContext && (mbWindow || mbVirDev) ) { - return mnWidth; //CGBitmapContextGetWidth( mrContext ); + w = mnWidth; } - else - return 0; + + if( w == 0 ) + { + if( mbWindow && mpFrame ) + w = mpFrame->maGeometry.nWidth; + } + + return w; } // ----------------------------------------------------------------------- -BOOL AquaSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& ) +BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect ) { - return sal_False; + ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback + GlyphID aGlyphId = nGlyphId; + ATSGlyphScreenMetrics aGlyphMetrics; + OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle, + 1, &aGlyphId, 0, FALSE, !mbNonAntialiasedText, &aGlyphMetrics ); + if( eStatus != noErr ) + return false; + + const long nMinX = (long)(+aGlyphMetrics.topLeft.x * mfFontScale - 0.5); + const long nMaxX = (long)(aGlyphMetrics.width * mfFontScale + 0.5) + nMinX; + const long nMinY = (long)(-aGlyphMetrics.topLeft.y * mfFontScale - 0.5); + const long nMaxY = (long)(aGlyphMetrics.height * mfFontScale + 0.5) + nMinY; + rRect = Rectangle( nMinX, nMinY, nMaxX, nMaxY ); + return true; } // ----------------------------------------------------------------------- @@ -1815,7 +1883,14 @@ USHORT AquaSalGraphics::SetFont( ImplFontSelectData* pReqFont, int nFallbackLeve static const int nTagCount = sizeof(aTag) / sizeof(*aTag); OSStatus eStatus = ATSUSetAttributes( maATSUStyle, nTagCount, aTag, aValueSize, aValue ); - DBG_ASSERT( (eStatus==noErr), "AquaSalGraphics::SetFont() : Could not set font attributes!\n"); + // reset ATSUstyle if there was an error + if( eStatus != noErr ) + { + DBG_WARNING( "AquaSalGraphics::SetFont() : Could not set font attributes!\n"); + ATSUClearStyle( maATSUStyle ); + mpMacFontData = NULL; + return 0; + } // prepare font stretching const ATSUAttributeTag aMatrixTag = kATSUFontMatrixTag; @@ -2454,3 +2529,4 @@ bool XorEmulation::UpdateTarget() } // ======================================================================= + diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index d57e42899a14..9f2c7c4fa3a7 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -290,8 +290,6 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n break; case CTRL_SPINBUTTONS: - if( nPart == PART_ENTIRE_CONTROL || - nPart == PART_ALL_BUTTONS ) return false; break; @@ -695,26 +693,58 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, case CTRL_LISTNODE: { - HIThemeButtonDrawInfo aInfo; - aInfo.version = 0; - aInfo.kind = kThemeDisclosureButton; - aInfo.state = getState( nState ); - - aInfo.adornment = kThemeAdornmentNone; - ButtonValue aButtonValue = aValue.getTristateVal(); - switch( aButtonValue ) { - case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded - break; - case BUTTONVALUE_OFF: aInfo.value = kThemeDisclosureRight;//collapsed - break; - case BUTTONVALUE_DONTKNOW: //what to do? - default: - break; + if( Application::GetSettings().GetLayoutRTL() && aButtonValue == BUTTONVALUE_OFF ) + { + // FIXME: a value of kThemeDisclosureLeft + // should draw a theme compliant left disclosure triangle + // sadly this does not seem to work, so we'll draw a left + // grey equilateral triangle here ourselves. + // Perhaps some other HIThemeButtonDrawInfo setting would do the trick ? + + CGContextSetShouldAntialias( mrContext, true ); + float aGrey[] = { 0.45, 0.45, 0.45, 1.0 }; + CGContextSetFillColor( mrContext, aGrey ); + CGContextBeginPath( mrContext ); + float x = rc.origin.x + rc.size.width; + float y = rc.origin.y; + CGContextMoveToPoint( mrContext, x, y ); + y += rc.size.height; + CGContextAddLineToPoint( mrContext, x, y ); + x -= rc.size.height * 0.866; // cos( 30 degree ) is approx. 0.866 + y -= rc.size.height/2; + CGContextAddLineToPoint( mrContext, x, y ); + CGContextDrawPath( mrContext, kCGPathEOFill ); } + else + { + HIThemeButtonDrawInfo aInfo; + aInfo.version = 0; + aInfo.kind = kThemeDisclosureTriangle; + aInfo.value = kThemeDisclosureRight; + aInfo.state = getState( nState ); + + aInfo.adornment = kThemeAdornmentNone; + + switch( aButtonValue ) { + case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded + break; + case BUTTONVALUE_OFF: + // FIXME: this should have drawn a theme compliant disclosure triangle + // (see above) + if( Application::GetSettings().GetLayoutRTL() ) + { + aInfo.value = kThemeDisclosureLeft;//collapsed, RTL + } + break; + case BUTTONVALUE_DONTKNOW: //what to do? + default: + break; + } - HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); + } bOK = true; } break; @@ -1041,7 +1071,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, HIRect buttonRc = ImplGetHIRectFromRectangle(aSpinRect); // FIXME: without this fuzz factor there is some unwanted clipping - buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ; + if( Application::GetSettings().GetLayoutRTL() ) + buttonRc.origin.x -= FOCUS_RING_WIDTH - CLIP_FUZZ; + else + buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ; switch( aValue.getTristateVal() ) { diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index aee1bd351839..b491318bbb0d 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -626,6 +626,121 @@ private: [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SALEVENT_MOUSEBUTTONUP]; } +- (void)magnifyWithEvent: (NSEvent*)pEvent +{ + YIELD_GUARD; + + // TODO: ?? -(float)magnification; + if( AquaSalFrame::isAlive( mpFrame ) ) + { + mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 ); + mpFrame->mnLastModifierFlags = [pEvent modifierFlags]; + + float dZ = 0.0; + for(;;) + { + dZ += [pEvent deltaZ]; + NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask + untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ]; + if( !pNextEvent ) + break; + pEvent = pNextEvent; + } + + NSPoint aPt = [NSEvent mouseLocation]; + mpFrame->CocoaToVCL( aPt ); + + SalWheelMouseEvent aEvent; + aEvent.mnTime = mpFrame->mnLastEventTime; + aEvent.mnX = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX; + aEvent.mnY = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY; + aEvent.mnCode = ImplGetModifierMask( mpFrame->mnLastModifierFlags ); + aEvent.mnCode |= KEY_MOD1; // we want zooming, no scrolling + + // --- RTL --- (mirror mouse pos) + if( Application::GetSettings().GetLayoutRTL() ) + aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX; + + if( dZ != 0.0 ) + { + aEvent.mnDelta = static_cast<long>(floor(dZ)); + aEvent.mnNotchDelta = aEvent.mnDelta / 8; + if( aEvent.mnNotchDelta == 0 ) + aEvent.mnNotchDelta = dZ < 0.0 ? -1 : 1; + aEvent.mbHorz = FALSE; + aEvent.mnScrollLines = aEvent.mnNotchDelta > 0 ? aEvent.mnNotchDelta : -aEvent.mnNotchDelta; + if( aEvent.mnScrollLines == 0 ) + aEvent.mnScrollLines = 1; + mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); + } + } +} + +- (void)rotateWithEvent: (NSEvent*)pEvent +{ + //Rotation : -(float)rotation; + // TODO: create new CommandType so rotation is available to the applications +} + +- (void)swipeWithEvent: (NSEvent*)pEvent +{ + YIELD_GUARD; + + if( AquaSalFrame::isAlive( mpFrame ) ) + { + mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 ); + mpFrame->mnLastModifierFlags = [pEvent modifierFlags]; + + // merge pending scroll wheel events + float dX = 0.0; + float dY = 0.0; + for(;;) + { + dX += [pEvent deltaX]; + dY += [pEvent deltaY]; + NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask + untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ]; + if( !pNextEvent ) + break; + pEvent = pNextEvent; + } + + NSPoint aPt = [NSEvent mouseLocation]; + mpFrame->CocoaToVCL( aPt ); + + SalWheelMouseEvent aEvent; + aEvent.mnTime = mpFrame->mnLastEventTime; + aEvent.mnX = static_cast<long>(aPt.x) - mpFrame->maGeometry.nX; + aEvent.mnY = static_cast<long>(aPt.y) - mpFrame->maGeometry.nY; + aEvent.mnCode = ImplGetModifierMask( mpFrame->mnLastModifierFlags ); + + // --- RTL --- (mirror mouse pos) + if( Application::GetSettings().GetLayoutRTL() ) + aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX; + + if( dX != 0.0 ) + { + aEvent.mnDelta = static_cast<long>(floor(dX)); + aEvent.mnNotchDelta = aEvent.mnDelta / 8; + if( aEvent.mnNotchDelta == 0 ) + aEvent.mnNotchDelta = dX < 0.0 ? -1 : 1; + aEvent.mbHorz = TRUE; + aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL; + mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); + } + if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame )) + { + aEvent.mnDelta = static_cast<long>(floor(dY)); + aEvent.mnNotchDelta = aEvent.mnDelta / 8; + if( aEvent.mnNotchDelta == 0 ) + aEvent.mnNotchDelta = dY < 0.0 ? -1 : 1; + aEvent.mbHorz = FALSE; + aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL; + mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent ); + } + } +} + -(void)scrollWheel: (NSEvent*)pEvent { YIELD_GUARD; @@ -694,6 +809,7 @@ private: } } + -(void)keyDown: (NSEvent*)pEvent { YIELD_GUARD; @@ -773,18 +889,45 @@ private: if( pInsert && ( nLen = [pInsert length] ) > 0 ) { OUString aInsertString( GetOUString( pInsert ) ); - USHORT nKeyCode = 0; // aCharCode initializer is safe since aInsertString will at least contain '\0' sal_Unicode aCharCode = *aInsertString.getStr(); - // FIXME: will probably break somehow in less than trivial text input mode + if( nLen == 1 && aCharCode < 0x80 && aCharCode > 0x1f && - ( nKeyCode = ImplMapCharCode( aCharCode ) ) != 0 - && ! [self hasMarkedText ] + ! [self hasMarkedText ] ) { - [self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode]; + USHORT nKeyCode = ImplMapCharCode( aCharCode ); + unsigned int nLastModifiers = mpFrame->mnLastModifierFlags; + + // #i99567# + // find out the unmodified key code + + // sanity check + if( mpLastEvent && ( [mpLastEvent type] == NSKeyDown || [mpLastEvent type] == NSKeyUp ) ) + { + // get unmodified string + NSString* pUnmodifiedString = [mpLastEvent charactersIgnoringModifiers]; + if( pUnmodifiedString && [pUnmodifiedString length] == 1 ) + { + // map the unmodified key code + unichar keyChar = [pUnmodifiedString characterAtIndex: 0]; + nKeyCode = ImplMapCharCode( keyChar ); + } + nLastModifiers = [mpLastEvent modifierFlags]; + + } + // #i99567# + // applications and vcl's edit fields ignore key events with ALT + // however we're at a place where we know text should be inserted + // so it seems we need to strip the Alt modifier here + if( (nLastModifiers & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)) + == NSAlternateKeyMask ) + { + nLastModifiers = 0; + } + [self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode modifiers: nLastModifiers]; } else { diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index 8128f9171ce1..9b4499cc1233 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -346,7 +346,6 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR // set offsets for positioning const float offset = 9.0; - const float lineHeight = 17.0; // get the pointers AquaSalFrame * pParentAquaSalFrame = (AquaSalFrame *) pWin->ImplGetWindowImpl()->mpRealParent->ImplGetFrame(); @@ -360,21 +359,19 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR NSMenu* pCopyMenu = [mpMenu copy]; // filter disabled elements - sal_Int32 drawnItems = removeUnusedItemsRunner( pCopyMenu ); + removeUnusedItemsRunner( pCopyMenu ); // create frame rect NSRect displayPopupFrame = NSMakeRect( rRect.nLeft+(offset-1), rRect.nTop+(offset+1), popupFrame.size.width, 0 ); pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false); - // adjust frame rect when necessary + // do the same strange semantics as vcl popup windows to arrive at a frame geometry + // in mirrored UI case; best done by actually executing the same code USHORT nArrangeIndex; - Point position = pWin->ImplCalcPos( pWin, rRect, nFlags, nArrangeIndex ); - if( position.Y() < rRect.nTop ) { - displayPopupFrame.origin.y += ( lineHeight*drawnItems ); - } - if( position.X() < rRect.nLeft ) { - displayPopupFrame.origin.x -= popupFrame.size.width; - } + pWin->SetPosPixel( pWin->ImplCalcPos( pWin, rRect, nFlags, nArrangeIndex ) ); + displayPopupFrame.origin.x = pWin->ImplGetFrame()->maGeometry.nX - pParentAquaSalFrame->maGeometry.nX + offset; + displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.nY - pParentAquaSalFrame->maGeometry.nY + offset; + pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false); // open popup menu NSPopUpButtonCell * pPopUpButtonCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]; diff --git a/psprint/inc/cupsmgr.hxx b/vcl/inc/cupsmgr.hxx index 803d440ad3fd..9caec2d30031 100644 --- a/psprint/inc/cupsmgr.hxx +++ b/vcl/inc/cupsmgr.hxx @@ -31,10 +31,10 @@ #ifndef _PSPRINT_CUPSMGR_HXX_ #define _PSPRINT_CUPSMGR_HXX_ -#include <psprint/printerinfomanager.hxx> -#include <osl/module.h> -#include <osl/thread.h> -#include <osl/mutex.hxx> +#include "vcl/printerinfomanager.hxx" +#include "osl/module.h" +#include "osl/thread.h" +#include "osl/mutex.hxx" namespace psp { diff --git a/psprint/source/fontsubset/list.h b/vcl/inc/list.h index b86521a1f666..b86521a1f666 100644 --- a/psprint/source/fontsubset/list.h +++ b/vcl/inc/list.h diff --git a/psprint/source/fontsubset/sft.h b/vcl/inc/sft.h index efda0903afc5..efda0903afc5 100644 --- a/psprint/source/fontsubset/sft.h +++ b/vcl/inc/sft.h diff --git a/psprint/inc/psprint/fontcache.hxx b/vcl/inc/vcl/fontcache.hxx index 60521e175905..acc2e1c10092 100644 --- a/psprint/inc/psprint/fontcache.hxx +++ b/vcl/inc/vcl/fontcache.hxx @@ -31,15 +31,17 @@ #ifndef _PSPRINT_FONTCACHE_HXX #define _PSPRINT_FONTCACHE_HXX -#include <psprint/fontmanager.hxx> -#include <tools/string.hxx> +#include "vcl/dllapi.h" +#include "vcl/fontmanager.hxx" + +#include "tools/string.hxx" #include <hash_map> namespace psp { -class FontCache +class VCL_DLLPUBLIC FontCache { struct FontDir; friend class FontDir; diff --git a/psprint/inc/psprint/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx index 51f0a066afac..bdfd30d12f7f 100644 --- a/psprint/inc/psprint/fontmanager.hxx +++ b/vcl/inc/vcl/fontmanager.hxx @@ -32,17 +32,14 @@ #define _PSPRINT_FONTMANAGER_HXX_ #include <hash_map> -#ifndef __SGI_STL_MAP #include <map> -#endif -#ifndef __SGI_STL_LIST #include <list> -#endif -#ifndef __SGI_STL_SET #include <set> -#endif -#include <psprint/helper.hxx> -#include <com/sun/star/lang/Locale.hpp> + +#include "vcl/dllapi.h" +#include "vcl/helper.hxx" + +#include "com/sun/star/lang/Locale.hpp" #define ATOM_FAMILYNAME 2 #define ATOM_PSNAME 3 @@ -228,7 +225,7 @@ class FontCache; class FontCache; -class PrintFontManager +class VCL_DLLPUBLIC PrintFontManager { struct PrintFont; struct TrueTypeFontFile; @@ -437,8 +434,6 @@ class PrintFontManager const rtl::OString& getDirectory( int nAtom ) const; int getDirectoryAtom( const rtl::OString& rDirectory, bool bCreate = false ); - void getServerDirectories(); // get font server directories on e.g. redhat - /* try to initialize fonts from libfontconfig called from <code>initialize()</code> @@ -478,10 +473,7 @@ public: int addFontFile( const rtl::OString& rFileName, int nFaceNum ); - // initialize takes an X Display* - // if NULL then an XOpenDisplay( NULL ) is performed - // the Display connection is used to get the font path - void initialize( void* pDisplay = NULL ); + void initialize(); // returns the number of managed fonts int getFontCount() const { return m_aFonts.size(); } diff --git a/psprint/inc/psprint/helper.hxx b/vcl/inc/vcl/helper.hxx index 427836201735..04576e30b516 100644 --- a/psprint/inc/psprint/helper.hxx +++ b/vcl/inc/vcl/helper.hxx @@ -32,8 +32,10 @@ #define _PSPRINT_HELPER_HXX_ #include <list> -#include <hash_map> -#include <rtl/ustring.hxx> + +#include "vcl/dllapi.h" + +#include "rtl/ustring.hxx" // forwards @@ -42,20 +44,25 @@ namespace osl { class File; } namespace psp { typedef int fontID; -void getPrinterPathList( std::list< rtl::OUString >& rPathList, const char* pSubDir ); -const rtl::OUString& getFontPath(); +void VCL_DLLPUBLIC getPrinterPathList( std::list< rtl::OUString >& rPathList, const char* pSubDir ); + +// note: gcc 3.4.1 warns about visibility if we retunr a const rtl::OUString& here +// seems to be a bug in gcc, now we return an object instead of a reference +rtl::OUString VCL_DLLPUBLIC getFontPath(); -bool convertPfbToPfa( osl::File& rInFile, osl::File& rOutFile ); +bool VCL_DLLPUBLIC convertPfbToPfa( osl::File& rInFile, osl::File& rOutFile ); // normalized path (equivalent to realpath) -void normPath( rtl::OString& rPath ); +void VCL_DLLPUBLIC normPath( rtl::OString& rPath ); // splits rOrgPath into dirname and basename // rOrgPath will be subject to normPath -void splitPath( rtl::OString& rOrgPath, rtl::OString& rDir, rtl::OString& rBase ); +void VCL_DLLPUBLIC splitPath( rtl::OString& rOrgPath, rtl::OString& rDir, rtl::OString& rBase ); enum whichOfficePath { NetPath, UserPath, ConfigPath }; -const rtl::OUString& getOfficePath( enum whichOfficePath ePath ); +// note: gcc 3.4.1 warns about visibility if we retunr a const rtl::OUString& here +// seems to be a bug in gcc, now we return an object instead of a reference +rtl::OUString VCL_DLLPUBLIC getOfficePath( enum whichOfficePath ePath ); } // namespace #endif // _PSPRINT_HELPER_HXX_ diff --git a/vcl/inc/vcl/i18nhelp.hxx b/vcl/inc/vcl/i18nhelp.hxx index 82f9d74b7ad2..e50ddecaa947 100644 --- a/vcl/inc/vcl/i18nhelp.hxx +++ b/vcl/inc/vcl/i18nhelp.hxx @@ -90,6 +90,8 @@ public: String GetDate( const Date& rDate ) const; String GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep = TRUE, BOOL bTrailingZeros = TRUE ) const; + + static String filterFormattingChars( const String& ); }; } // namespace vcl diff --git a/vcl/inc/vcl/impimagetree.hxx b/vcl/inc/vcl/impimagetree.hxx index 1b86751ce5cc..dfbcb366fe6a 100644 --- a/vcl/inc/vcl/impimagetree.hxx +++ b/vcl/inc/vcl/impimagetree.hxx @@ -1,116 +1,92 @@ /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: impimagetree.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SV_IMPIMAGETREE_HXX -#define _SV_IMPIMAGETREE_HXX - -#include <memory> - -#ifndef _COMPHELPER_SINGLETONREF_HXX_ -#include <salhelper/singletonref.hxx> -#endif -#include <com/sun/star/uno/Reference.hxx> - -// ---------------- -// -ImplImageTree - -// ---------------- - +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2008 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef INCLUDED_VCL_IMPIMAGETREE_HXX +#define INCLUDED_VCL_IMPIMAGETREE_HXX + +#include "sal/config.h" + +#include <list> +#include <utility> +#include <vector> + +#include <hash_map> + +#include "boost/noncopyable.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "rtl/ustring.hxx" +#include "salhelper/singletonref.hxx" + +namespace com { namespace sun { namespace star { namespace container { + class XNameAccess; +} } } } class BitmapEx; -namespace com { namespace sun { namespace star { namespace packages { namespace zip { class XZipFileAccess; } } } } } -namespace com { namespace sun { namespace star { namespace container { class XNameAccess; } } } } -namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } } -namespace com { namespace sun { namespace star { namespace ucb { class XSimpleFileAccess; } } } } -namespace com { namespace sun { namespace star { namespace io { class XInputStream; } } } } - -// ------------------- -// - ImplZipAccessor - -// ------------------- - -class ImplZipAccessor -{ -private: - - ::std::vector< ::rtl::OUString > maURLVector; - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > mxFileAccess; - ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::packages::zip::XZipFileAccess > > maZipAccVector; - ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > > maNameAccVector; +class ImplImageTree: private boost::noncopyable { public: + ImplImageTree(); - ImplZipAccessor(); - ~ImplZipAccessor(); + ~ImplImageTree(); - void Update( const ::rtl::OUString& rSymbolsStyle ); - void Clear(); - bool HasEntries() const; + bool loadImage( + rtl::OUString const & name, rtl::OUString const & style, + BitmapEx & bitmap, bool localized = false); - ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetByName( const ::rtl::OUString& rName ) const; -}; + void shutDown(); + // a crude form of life cycle control (called from DeInitVCL; otherwise, + // if the ImplImageTree singleton were destroyed during exit that would + // be too late for the destructors of the bitmaps in m_cache) -// ----------------- -// - ImplImageTree - -// ----------------- +private: + typedef std::list< + std::pair< + rtl::OUString, + com::sun::star::uno::Reference< + com::sun::star::container::XNameAccess > > > Zips; -class ImplImageTree -{ -public: + typedef std::hash_map< + rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > Cache; - ImplImageTree(); - ~ImplImageTree(); + rtl::OUString m_style; + Zips m_zips; + Cache m_cache; - bool loadImage( const ::rtl::OUString& rName, - const ::rtl::OUString& rSymbolsStyle, - BitmapEx& rReturn, - bool bSearchLanguageDependent = false ); - void addUserImage( const ::rtl::OUString& rName, const BitmapEx& rReturn ); + void setStyle(rtl::OUString const & style); - static void cleanup(); + void resetZips(); -private: + bool cacheLookup( + rtl::OUString const & name, bool localized, BitmapEx & bitmap); - ImplZipAccessor maZipAcc; - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxPathSettings; - ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > mxFileAccess; - bool mbInit; - ::rtl::OUString maSymbolsStyle; - - bool implInit(); - const ::rtl::OUString& implGetUserDirURL() const; - ::rtl::OUString implGetUserFileURL( const ::rtl::OUString& rName ) const; - void implCheckUserCache(); - bool implLoadFromStream( SvStream& rIStm, const ::rtl::OUString& rFileName, BitmapEx& rReturn ); - ::std::auto_ptr< SvStream > implGetStream( const ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream >& rxIStm ) const; - void implUpdateSymbolsStyle( const ::rtl::OUString& rSymbolsStyle ); + bool find(std::vector< rtl::OUString > const & paths, BitmapEx & bitmap); }; -typedef ::salhelper::SingletonRef< ImplImageTree > ImplImageTreeSingletonRef; +typedef salhelper::SingletonRef< ImplImageTree > ImplImageTreeSingletonRef; -#endif // _SV_IMPIMAGETREE_HXX +#endif diff --git a/psprint/inc/psprint/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx index 08d8e0057083..4451c566b5bf 100644 --- a/psprint/inc/psprint/jobdata.hxx +++ b/vcl/inc/vcl/jobdata.hxx @@ -31,7 +31,7 @@ #ifndef _PSPRINT_JOBDATA_HXX_ #define _PSPRINT_JOBDATA_HXX_ -#include <psprint/ppdparser.hxx> +#include "vcl/ppdparser.hxx" namespace psp { diff --git a/vcl/inc/vcl/lazydelete.hxx b/vcl/inc/vcl/lazydelete.hxx index fa442c99e212..a0acba21fefa 100644 --- a/vcl/inc/vcl/lazydelete.hxx +++ b/vcl/inc/vcl/lazydelete.hxx @@ -205,6 +205,60 @@ namespace vcl } } }; + + /* + class DeleteOnDeinit matches a similar need as LazyDelete for static objects: + you may not access vcl objects after DeInitVCL has been called this includes their destruction + therefore disallowing the existance of static vcl object like e.g. a static BitmapEx + To work around this use DeleteOnDeinit<BitmapEx> which will allow you to have a static object container, + that will have its contents destroyed on DeinitVCL. The single drawback is that you need to check on the + container object whether it still contains content before actually accessing it. + + caveat: when constructing a vcl object, you certainly want to ensure that InitVCL has run already. + However this is not necessarily the case when using a class static member or a file level static variable. + In these cases make judicious use of the set() method of DeleteOnDeinit, but beware of the changing + ownership. + + example use case: use a lazy initialized on call BitmapEx in a paint method. Of course a paint method + would not normally be called after DeInitVCL anyway, so the check might not be necessary in a + Window::Paint implementation, but always checking is a good idea. + + SomeWindow::Paint() + { + static vcl::DeleteOnDeinitBase< BitmapEx > aBmp( new BitmapEx( ResId( 1000, myResMgr ) ) ); + + if( aBmp.get() ) // check whether DeInitVCL has been called already + DrawBitmapEx( Point( 10, 10 ), *aBmp.get() ); + } + */ + + class VCL_DLLPUBLIC DeleteOnDeinitBase + { + public: + static void SAL_DLLPRIVATE ImplDeleteOnDeInit(); + virtual ~DeleteOnDeinitBase(); + protected: + static void addDeinitContainer( DeleteOnDeinitBase* i_pContainer ); + + virtual void doCleanup() = 0; + }; + + template < typename T > + class VCL_DLLPUBLIC DeleteOnDeinit : public DeleteOnDeinitBase + { + T* m_pT; + virtual void doCleanup() { delete m_pT; m_pT = NULL; } + public: + DeleteOnDeinit( T* i_pT ) : m_pT( i_pT ) { addDeinitContainer( this ); } + virtual ~DeleteOnDeinit() {} + + // get contents + T* get() { return m_pT; } + + // set contents, returning old contents + // ownership is transfered ! + T* set( T* i_pNew ) { T* pOld = m_pT; m_pT = i_pNew; return pOld; } + }; } #endif diff --git a/vcl/inc/vcl/opengl.hxx b/vcl/inc/vcl/opengl.hxx new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/vcl/inc/vcl/opengl.hxx diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index 0736a83d2c72..c0bcfa35fae5 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -252,6 +252,7 @@ struct KerningPair // Antialiasing #define ANTIALIASING_DISABLE_TEXT ((USHORT)0x0001) #define ANTIALIASING_ENABLE_B2DDRAW ((USHORT)0x0002) +#define ANTIALIASING_PIXELSNAPHAIRLINE ((USHORT)0x0004) // AddFontSubstitute #define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001) diff --git a/vcl/inc/vcl/outdev3d.hxx b/vcl/inc/vcl/outdev3d.hxx new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/vcl/inc/vcl/outdev3d.hxx diff --git a/psprint/inc/psprint/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index baea44ebaf25..5fa47d412f26 100644 --- a/psprint/inc/psprint/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -32,9 +32,10 @@ #include <list> #include <vector> -#include <psprint/helper.hxx> // hash_map and OUString hash -#include <tools/string.hxx> -#include <tools/stream.hxx> +#include <hash_map> + +#include "tools/string.hxx" +#include "tools/stream.hxx" #define PRINTER_PPDDIR "driver" diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 5f53dd6e4a28..cf491dc1b4f6 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -404,8 +404,11 @@ public: * on JobSetup will be preferred. However if no "IsQuickJob" value is set, * setting SetNextJobIsQuick will cause the following StartJob to set this value * to "true" in the current JobSetup. + * + * the paramter can be set to "false" again in case a job was not started and the + * printer is to be reused. */ - void SetNextJobIsQuick(); + void SetNextJobIsQuick( bool bQuick = true ); /** checks the printer list and updates it necessary * diff --git a/psprint/inc/psprint/printergfx.hxx b/vcl/inc/vcl/printergfx.hxx index 55816330fa48..3bb242c802dd 100644 --- a/psprint/inc/psprint/printergfx.hxx +++ b/vcl/inc/vcl/printergfx.hxx @@ -31,12 +31,11 @@ #ifndef _PSPRINT_PRINTERGFX_HXX_ #define _PSPRINT_PRINTERGFX_HXX_ -#include <psprint/helper.hxx> -#include <osl/file.hxx> -#include <tools/gen.hxx> -#ifndef __SGI_STL_LIST +#include "vcl/helper.hxx" +#include "osl/file.hxx" +#include "tools/gen.hxx" + #include <list> -#endif #include <hash_map> namespace psp { diff --git a/psprint/inc/psprint/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx index 3a64a998db93..810ad428c9db 100644 --- a/psprint/inc/psprint/printerinfomanager.hxx +++ b/vcl/inc/vcl/printerinfomanager.hxx @@ -32,13 +32,14 @@ #define _PSPRINT_PRINTERINFOMANAGER_HXX_ #include <hash_map> -#ifndef __SGI_STL_LIST #include <list> -#endif -#include <psprint/helper.hxx> -#include <psprint/jobdata.hxx> -#include <osl/file.hxx> -#include <psprint/helper.hxx> + +#include "vcl/dllapi.h" +#include "vcl/helper.hxx" +#include "vcl/jobdata.hxx" +#include "vcl/helper.hxx" +#include "osl/file.hxx" + #include <cstdio> namespace psp @@ -82,7 +83,7 @@ struct PrinterInfo : JobData {} }; -class PrinterInfoManager +class VCL_DLLPUBLIC PrinterInfoManager { public: enum Type { Default = 0, CUPS = 1 }; diff --git a/psprint/inc/psprint/printerjob.hxx b/vcl/inc/vcl/printerjob.hxx index 25c69f20a1c3..9880700d4008 100644 --- a/psprint/inc/psprint/printerjob.hxx +++ b/vcl/inc/vcl/printerjob.hxx @@ -31,12 +31,11 @@ #ifndef _PSPRINT_PRINTERJOB_HXX_ #define _PSPRINT_PRINTERJOB_HXX_ -#ifndef __SGI_STL_LIST +#include "vcl/jobdata.hxx" +#include "osl/file.hxx" +#include "rtl/string.hxx" + #include <list> -#endif -#include <psprint/jobdata.hxx> -#include <osl/file.hxx> -#include <rtl/string.hxx> namespace psp { diff --git a/vcl/inc/vcl/regband.hxx b/vcl/inc/vcl/regband.hxx index f9045e874a5b..418fe46e1cc4 100644 --- a/vcl/inc/vcl/regband.hxx +++ b/vcl/inc/vcl/regband.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: regband.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.158.1 $ * * This file is part of OpenOffice.org. * @@ -92,8 +92,21 @@ public: // create y-band with boundaries ImplRegionBand( long nYTop, long nYBottom ); - // copy y-band with with all data - ImplRegionBand( const ImplRegionBand & theSourceBand ); + /** copy y-band with with all data + @param theSourceBand + The new ImplRegionBand object will + be a copy of this band. + @param bIgnorePoints + When <TRUE/> (the default) the + band points pointed to by + mpFirstBandPoint are not copied. + When <FALSE/> they are copied. + You need the points when you are + planning to call ProcessPoints() + later on. + */ + ImplRegionBand( const ImplRegionBand & theSourceBand, + const bool bIgnorePoints = true); ~ImplRegionBand(); long GetXLeftBoundary() const; @@ -124,6 +137,17 @@ public: BOOL IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); } BOOL operator==( const ImplRegionBand& rRegionBand ) const; + + /** Split the called band at the given vertical coordinate. After the + split the called band will cover the upper part not including nY. + The new band will cover the lower part including nY. + @param nY + The band is split at this y coordinate. The new, lower band + will include this very value. + @return + Returns the new, lower band. + */ + ImplRegionBand* SplitBand (const sal_Int32 nY); }; #endif // _SV_REGBAND_HXX diff --git a/vcl/inc/vcl/region.h b/vcl/inc/vcl/region.h index cdef83195c0e..10331e0f1527 100644 --- a/vcl/inc/vcl/region.h +++ b/vcl/inc/vcl/region.h @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: region.h,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.128.1 $ * * This file is part of OpenOffice.org. * @@ -110,6 +110,19 @@ public: long nLineID, BOOL bEndPoint, LineType eLineType ); + /** Insert one band either after another band or as the first or only + band. Both the forward as well as the backward links are updated. + @param pPreviousBand + When <NULL/> then pBandToInsert is inserted as first band or as + only band when there are no other bands. + When not <NULL/> then pBandToInsert is inserted directly after + pPreviousBand. + @param pBandToInsert + The band to insert. + */ + void InsertBand (ImplRegionBand* pPreviousBand, + ImplRegionBand* pBandToInsert); + void Union( long nLeft, long nTop, long nRight, long nBottom ); void Exclude( long nLeft, long nTop, long nRight, long nBottom ); void XOr( long nLeft, long nTop, long nRight, long nBottom ); diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx index cf88b7813ec8..221c9e370ea6 100644 --- a/vcl/inc/vcl/salinst.hxx +++ b/vcl/inc/vcl/salinst.hxx @@ -31,14 +31,14 @@ #ifndef _SV_SALINST_HXX #define _SV_SALINST_HXX -#ifdef __cplusplus +#include "vcl/sv.h" +#include "vcl/dllapi.h" -#include <tools/string.hxx> -#endif // __cplusplus -#include <vcl/sv.h> -#include <vcl/dllapi.h> +#include "tools/string.hxx" -#ifdef __cplusplus +#include "rtl/string.hxx" + +#include <list> struct SystemParentData; struct SalPrinterQueueInfo; @@ -171,6 +171,11 @@ public: enum ConnectionIdentifierType { AsciiCString, Blob }; virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0; + + // this is a vehicle for PrintFontManager to bridge the gap between vcl and libvclplug_* + // this is only necessary because PrintFontManager is an exported vcl API and therefore + // needs to be in libvcl while libvclplug_* do not contain exported C++ API + virtual void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); }; // called from SVMain @@ -185,8 +190,6 @@ void SalAbort( const XubString& rErrorText ); VCL_DLLPUBLIC const ::rtl::OUString& SalGetDesktopEnvironment(); -#endif // __cplusplus - // ----------- // - SalData - // ----------- diff --git a/vcl/inc/vcl/sallayout.hxx b/vcl/inc/vcl/sallayout.hxx index d40dde9014bc..3141381041c8 100755 --- a/vcl/inc/vcl/sallayout.hxx +++ b/vcl/inc/vcl/sallayout.hxx @@ -145,6 +145,7 @@ protected: }; // helper functions often used with ImplLayoutArgs +bool IsDiacritic( sal_UCS4 ); int GetVerticalFlags( sal_UCS4 ); sal_UCS4 GetVerticalChar( sal_UCS4 ); // #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx @@ -329,10 +330,11 @@ public: mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos) {} - enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200 }; + enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200, IS_DIACRITIC=0x400 }; - bool IsClusterStart() const { return !(mnFlags & IS_IN_CLUSTER); } - bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); } + bool IsClusterStart() const { return ((mnFlags & IS_IN_CLUSTER) == 0); } + bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); } + bool IsDiacritic() const { return ((mnFlags & IS_DIACRITIC) != 0); } }; // --------------- diff --git a/vcl/inc/vcl/salogl.hxx b/vcl/inc/vcl/salogl.hxx new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/vcl/inc/vcl/salogl.hxx diff --git a/vcl/inc/vcl/salotype.hxx b/vcl/inc/vcl/salotype.hxx new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/vcl/inc/vcl/salotype.hxx diff --git a/psprint/inc/psprint/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 5160d31a205f..b3548a07680b 100644 --- a/psprint/inc/psprint/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -30,24 +30,27 @@ #ifndef _PSPRINT_STRHELPER_HXX_ #define _PSPRINT_STRHELPER_HXX_ +#include "vcl/dllapi.h" + #include <tools/string.hxx> #include <rtl/math.hxx> + #include <cstring> namespace psp { -String GetCommandLineToken( int, const String& ); -ByteString GetCommandLineToken( int, const ByteString& ); +String VCL_DLLPUBLIC GetCommandLineToken( int, const String& ); +ByteString VCL_DLLPUBLIC GetCommandLineToken( int, const ByteString& ); // gets one token of a unix command line style string // doublequote, singlequote and singleleftquote protect their respective // contents -int GetCommandLineTokenCount( const String& ); -int GetCommandLineTokenCount( const ByteString& ); +int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& ); +int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& ); // returns number of tokens (zero if empty or whitespace only) -String WhitespaceToSpace( const String&, BOOL bProtect = TRUE ); -ByteString WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE ); +String VCL_DLLPUBLIC WhitespaceToSpace( const String&, BOOL bProtect = TRUE ); +ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE ); // returns a string with multiple adjacent occurences of whitespace // converted to a single space. if bProtect is TRUE (nonzero), then // doublequote, singlequote and singleleftquote protect their respective @@ -55,13 +58,13 @@ ByteString WhitespaceToSpace( const ByteString&, BOOL bProtect = TRUE ); // parses the first double in the string; decimal is '.' only -inline double StringToDouble( const String& rStr ) +inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) { rtl_math_ConversionStatus eStatus; return rtl::math::stringToDouble( rStr, sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); } -inline double StringToDouble( const ByteString& rStr ) +inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) { rtl_math_ConversionStatus eStatus; return rtl::math::stringToDouble( rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); @@ -70,7 +73,7 @@ inline double StringToDouble( const ByteString& rStr ) // fills a character buffer with the string representation of a double // the buffer has to be long enough (e.g. 128 bytes) // returns the string len -inline int getValueOfDouble( char* pBuffer, double f, int nPrecision = 0) +inline int VCL_DLLPUBLIC getValueOfDouble( char* pBuffer, double f, int nPrecision = 0) { rtl::OString aStr( rtl::math::doubleToString( f, rtl_math_StringFormat_G, nPrecision, '.', true ) ); int nLen = aStr.getLength(); diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx index 455c68b90ab0..e3072a4bc250 100644 --- a/vcl/inc/vcl/svdata.hxx +++ b/vcl/inc/vcl/svdata.hxx @@ -113,7 +113,7 @@ class DockingManager; namespace vos { class OMutex; } namespace vos { class OCondition; } -namespace vcl { class DisplayConnection; class FontSubstConfiguration; class SettingsConfigItem; class DefaultFontConfiguration; } +namespace vcl { class DisplayConnection; class FontSubstConfiguration; class SettingsConfigItem; class DefaultFontConfiguration; class DeleteOnDeinitBase; } // ----------------- // - ImplSVAppData - @@ -346,6 +346,7 @@ struct ImplSVData ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge; com::sun::star::uno::Reference< com::sun::star::frame::XSessionManagerClient > xSMClient; ::vcl::SettingsConfigItem* mpSettingsConfigItem; + std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList; }; void ImplInitSVData(); diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx index d97135a99bd5..f5869eca55e4 100644 --- a/vcl/inc/vcl/wintypes.hxx +++ b/vcl/inc/vcl/wintypes.hxx @@ -185,6 +185,7 @@ typedef sal_Int64 WinBits; #define WB_DOCKABLE ((WinBits)SAL_CONST_INT64(0x20000000)) #define WB_AUTOVSCROLL ((WinBits)SAL_CONST_INT64(0x40000000)) #define WB_HYPHENATION (((WinBits)SAL_CONST_INT64(0x80000000)) | WB_WORDBREAK) +#define WB_CHILDDLGCTRL ((WinBits)SAL_CONST_INT64(0x100000000000)) // system floating window #define WB_SYSTEMFLOATWIN ((WinBits)SAL_CONST_INT64(0x100000000)) diff --git a/vcl/os2/source/app/salinfo.cxx b/vcl/os2/source/app/salinfo.cxx index f1f3ce5822fb..39700fc26a75 100644 --- a/vcl/os2/source/app/salinfo.cxx +++ b/vcl/os2/source/app/salinfo.cxx @@ -37,14 +37,18 @@ #include <salsys.h> #include <salframe.h> #include <salinst.h> +#include "saldata.hxx" #include <tools/debug.hxx> #include <vcl/svdata.hxx> #include <rtl/ustrbuf.hxx> +#include "vcl/window.hxx" #ifndef _SV_SALGTYPE_HXX //#include <salgtype.hxx> #endif +#define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer + class Os2SalSystem : public SalSystem { public: @@ -145,16 +149,14 @@ int Os2SalSystem::ShowNativeMessageBox(const String& rTitle, const String& rMess nFlags |= DEFAULT_BTN_MAPPING_TABLE[nButtonCombination][nDefaultButton]; //#107209 hide the splash screen if active -#if 0 ImplSVData* pSVData = ImplGetSVData(); if (pSVData->mpIntroWindow) pSVData->mpIntroWindow->Hide(); -#endif return WinMessageBox( HWND_DESKTOP, HWND_DESKTOP, - (PSZ)rMessage.GetBuffer(), - (PSZ)rTitle.GetBuffer(), + (PSZ)CHAR_POINTER(rMessage), + (PSZ)CHAR_POINTER(rTitle), 0, nFlags); } diff --git a/vcl/os2/source/app/sallang.cxx b/vcl/os2/source/app/sallang.cxx index c15a61332aa4..fab9328464f2 100644 --- a/vcl/os2/source/app/sallang.cxx +++ b/vcl/os2/source/app/sallang.cxx @@ -1,120 +1,120 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: sallang.cxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SALLANG_HXX
-#include <sallang.hxx>
-#endif
-
-// =======================================================================
-
-// -----------------------------------------------------------------------
-// English (US/UK/AUS/CAN/NZ/EIRE/SAFRICA/JAMAICA/CARRIBEAN)
-static const wchar_t* aImplLangEnglishTab[LSTR_COUNT] =
-{
- L"Shift", // LSTR_KEY_SHIFT
- L"Ctrl", // LSTR_KEY_CTRL
- L"Alt", // LSTR_KEY_ALT
- L"Up", // LSTR_KEY_UP
- L"Down", // LSTR_KEY_DOWN
- L"Left", // LSTR_KEY_LEFT
- L"Right", // LSTR_KEY_RIGHT
- L"Home", // LSTR_KEY_HOME
- L"End", // LSTR_KEY_END
- L"PageUp", // LSTR_KEY_PAGEUP
- L"PageDown", // LSTR_KEY_PAGEDOWN
- L"Enter", // LSTR_KEY_RETURN
- L"Esc", // LSTR_KEY_ESC
- L"Tab", // LSTR_KEY_TAB
- L"Backspace", // LSTR_KEY_BACKSPACE
- L"Space", // LSTR_KEY_SPACE
- L"Insert", // LSTR_KEY_INSERT
- L"Del", // LSTR_KEY_DELETE
-};
-
-// =======================================================================
-
-const sal_Unicode** ImplGetLangTab( LanguageType eLang )
-{
- // Sprachtabelle ermitteln
- const wchar_t** pLangTab;
- //switch ( International::GetNeutralLanguage( eLang ) )
- switch ( eLang )
- {
-#if 0
- case LANGUAGE_DANISH:
- pLangTab = aImplLangDanishTab;
- break;
-
- case LANGUAGE_DUTCH:
- case LANGUAGE_DUTCH_BELGIAN:
- pLangTab = aImplLangDutchTab;
- break;
-
- case LANGUAGE_FINNISH:
- pLangTab = aImplLangFinnishTab;
- break;
-
- case LANGUAGE_FRENCH:
- pLangTab = aImplLangFrenchTab;
- break;
-
- case LANGUAGE_GERMAN:
- pLangTab = aImplLangGermanTab;
- break;
-
- case LANGUAGE_ITALIAN:
- pLangTab = aImplLangItalianTab;
- break;
-
- case LANGUAGE_NORWEGIAN:
- case LANGUAGE_NORWEGIAN_BOKMAL:
- pLangTab = aImplLangNorwegianTab;
- break;
-
- case LANGUAGE_PORTUGUESE:
- case LANGUAGE_PORTUGUESE_BRAZILIAN:
- pLangTab = aImplLangPortugueseTab;
- break;
-
- case LANGUAGE_SPANISH:
- pLangTab = aImplLangSpanishTab;
- break;
-
- case LANGUAGE_SWEDISH:
- pLangTab = aImplLangSwedishTab;
- break;
-#endif
- default:
- pLangTab = aImplLangEnglishTab;
- break;
- }
-
- return (const sal_Unicode**)pLangTab;
-}
+/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sallang.cxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SALLANG_HXX +#include <sallang.hxx> +#endif + +// ======================================================================= + +// ----------------------------------------------------------------------- +// English (US/UK/AUS/CAN/NZ/EIRE/SAFRICA/JAMAICA/CARRIBEAN) +static const wchar_t* aImplLangEnglishTab[LSTR_COUNT] = +{ + L"Shift", // LSTR_KEY_SHIFT + L"Ctrl", // LSTR_KEY_CTRL + L"Alt", // LSTR_KEY_ALT + L"Up", // LSTR_KEY_UP + L"Down", // LSTR_KEY_DOWN + L"Left", // LSTR_KEY_LEFT + L"Right", // LSTR_KEY_RIGHT + L"Home", // LSTR_KEY_HOME + L"End", // LSTR_KEY_END + L"PageUp", // LSTR_KEY_PAGEUP + L"PageDown", // LSTR_KEY_PAGEDOWN + L"Enter", // LSTR_KEY_RETURN + L"Esc", // LSTR_KEY_ESC + L"Tab", // LSTR_KEY_TAB + L"Backspace", // LSTR_KEY_BACKSPACE + L"Space", // LSTR_KEY_SPACE + L"Insert", // LSTR_KEY_INSERT + L"Del", // LSTR_KEY_DELETE +}; + +// ======================================================================= + +const sal_Unicode** ImplGetLangTab( LanguageType eLang ) +{ + // Sprachtabelle ermitteln + const wchar_t** pLangTab; + //switch ( International::GetNeutralLanguage( eLang ) ) + switch ( eLang ) + { +#if 0 + case LANGUAGE_DANISH: + pLangTab = aImplLangDanishTab; + break; + + case LANGUAGE_DUTCH: + case LANGUAGE_DUTCH_BELGIAN: + pLangTab = aImplLangDutchTab; + break; + + case LANGUAGE_FINNISH: + pLangTab = aImplLangFinnishTab; + break; + + case LANGUAGE_FRENCH: + pLangTab = aImplLangFrenchTab; + break; + + case LANGUAGE_GERMAN: + pLangTab = aImplLangGermanTab; + break; + + case LANGUAGE_ITALIAN: + pLangTab = aImplLangItalianTab; + break; + + case LANGUAGE_NORWEGIAN: + case LANGUAGE_NORWEGIAN_BOKMAL: + pLangTab = aImplLangNorwegianTab; + break; + + case LANGUAGE_PORTUGUESE: + case LANGUAGE_PORTUGUESE_BRAZILIAN: + pLangTab = aImplLangPortugueseTab; + break; + + case LANGUAGE_SPANISH: + pLangTab = aImplLangSpanishTab; + break; + + case LANGUAGE_SWEDISH: + pLangTab = aImplLangSwedishTab; + break; +#endif + default: + pLangTab = aImplLangEnglishTab; + break; + } + + return (const sal_Unicode**)pLangTab; +} diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx index e6a5788b401c..15034168269e 100644 --- a/vcl/os2/source/gdi/salgdi3.cxx +++ b/vcl/os2/source/gdi/salgdi3.cxx @@ -75,8 +75,8 @@ #endif #ifndef __SUBFONT_H -#include <psprint/list.h> -#include <psprint/sft.h> +#include <list.h> +#include <sft.h> #endif #ifdef GCP_KERN_HACK diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index eeda7e620d9d..ac93ae71bdd2 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : apple_remote BOOST:boost psprint rsc sot ucbhelper unotools ICU:icu i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc NULL +vc vcl : apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc NULL vc vcl usr1 - all vc_mkout NULL vc vcl\inc nmake - all vc_inc NULL vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL @@ -8,6 +8,7 @@ vc vcl\source\window nmake - all vc_win vc_inc NULL vc vcl\source\control nmake - all vc_ctrl vc_inc NULL vc vcl\source\src nmake - all vc_src vc_inc NULL vc vcl\source\helper nmake - all vc_hlp vc_inc NULL +vc vcl\source\fontsubset nmake - all vc_fts vc_inc NULL vc vcl\source\salmain nmake - all vc_salmain vc_inc NULL vc vcl\os2\source\app nmake - p vc__appp vc_inc NULL vc vcl\os2\source\gdi nmake - p vc__gdip vc_inc NULL @@ -20,7 +21,10 @@ vc vcl\win\source\window nmake - w vc__winw vc_inc NULL vc vcl\win\source\src nmake - w vc__srcw vc_inc NULL vc vcl\unx\source\plugadapt nmake - u vc__plug vc_inc NULL vc vcl\unx\source\app nmake - u vc__appu vc_inc NULL +vc vcl\unx\source\fontmanager nmake - u vc__ftmu vc_inc NULL vc vcl\unx\source\gdi nmake - u vc__gdiu vc_inc NULL +vc vcl\unx\source\printer nmake - u vc__prnu vc_inc NULL +vc vcl\unx\source\printergfx nmake - u vc__prgu vc_inc NULL vc vcl\unx\source\window nmake - u vc__winu vc_inc NULL vc vcl\unx\gtk\a11y nmake - u vc__gtky vc_inc NULL vc vcl\unx\gtk\app nmake - u vc__gtka vc_inc NULL @@ -37,6 +41,6 @@ vc vcl\mac\source\app nmake - m vc__appm vc_inc NULL vc vcl\mac\source\gdi nmake - m vc__gdim vc_inc NULL vc vcl\mac\source\window nmake - m vc__winm vc_inc NULL vc vcl\mac\source\src nmake - m vc__srcm vc_inc NULL -vc vcl\util nmake - all vc_util vc__plug.u vc__aquy.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__hl.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_components NULL +vc vcl\util nmake - all vc_util vc__plug.u vc__aquy.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__hl.u vc__ftmu.u vc__prgu.u vc__prnu.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_fts vc_components NULL vc vcl\util\linksvp nmake - u vc_lsvp vc_util NULL vc vcl\workben nmake - all vc_wrkb vc_util vc_salmain NULL diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index 159236dc4f21..c0b2675036b7 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -145,5 +145,10 @@ mkdir: %_DEST%\inc%_EXT%\vcl\plug\vcl ..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx ..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx ..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx +..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx +..\inc\vcl\printerinfomanager.hxx %_DEST%\inc%_EXT%\vcl\printerinfomanager.hxx +..\inc\vcl\jobdata.hxx %_DEST%\inc%_EXT%\vcl\jobdata.hxx +..\inc\vcl\ppdparser.hxx %_DEST%\inc%_EXT%\vcl\ppdparser.hxx +..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx +..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx -..\%__SRC%\misc\macosxrc.txt %_DEST%\bin%_EXT%\macosxrc.txt diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index 5b0d45773512..1622fe3e5bea 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -31,25 +31,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include "vcl/i18nhelp.hxx" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/i18n/TransliterationModules.hpp" +#include "unotools/localedatawrapper.hxx" +#include "unotools/transliterationwrapper.hxx" +#include "i18npool/mslangid.hxx" -#include <vcl/i18nhelp.hxx> - -/* -#include <com/sun/star/lang/XSingleServiceFactory.hpp> - - -#include <comphelper/processfactory.hxx> -*/ - -// #include <cppuhelper/servicefactory.hxx> - - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/i18n/TransliterationModules.hpp> -#include <unotools/localedatawrapper.hxx> -#include <unotools/transliterationwrapper.hxx> -#include <i18npool/mslangid.hxx> +#include "rtl/ustrbuf.hxx" using namespace ::com::sun::star; @@ -104,6 +94,37 @@ const ::com::sun::star::lang::Locale& vcl::I18nHelper::getLocale() const return maLocale; } +inline bool is_formatting_mark( sal_Unicode c ) +{ + if( (c >= 0x200B) && (c <= 0x200F) ) // BiDi and zero-width-markers + return true; + if( (c >= 0x2028) && (c <= 0x202E) ) // BiDi and paragraph-markers + return true; + return false; +} + +/* #i100057# filter formatting marks out of strings before passing them to + the transliteration. The real solution would have been an additional TransliterationModule + to ignore these marks during transliteration; however changin the code in i18npool that actually + implements this could produce unwanted side effects. + + Of course this copying around is not really good, but looking at i18npool, one more time + will not hurt. +*/ +String vcl::I18nHelper::filterFormattingChars( const String& rStr ) +{ + sal_Int32 nUnicodes = rStr.Len(); + rtl::OUStringBuffer aBuf( nUnicodes ); + const sal_Unicode* pStr = rStr.GetBuffer(); + while( nUnicodes-- ) + { + if( ! is_formatting_mark( *pStr ) ) + aBuf.append( *pStr ); + pStr++; + } + return aBuf.makeStringAndClear(); +} + sal_Int32 vcl::I18nHelper::CompareString( const String& rStr1, const String& rStr2 ) const { ::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex ); @@ -117,7 +138,10 @@ sal_Int32 vcl::I18nHelper::CompareString( const String& rStr1, const String& rSt ((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL; } - return ImplGetTransliterationWrapper().compareString( rStr1, rStr2 ); + + String aStr1( filterFormattingChars(rStr1) ); + String aStr2( filterFormattingChars(rStr2) ); + return ImplGetTransliterationWrapper().compareString( aStr1, aStr2 ); } sal_Bool vcl::I18nHelper::MatchString( const String& rStr1, const String& rStr2 ) const @@ -133,7 +157,9 @@ sal_Bool vcl::I18nHelper::MatchString( const String& rStr1, const String& rStr2 ((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL; } - return ImplGetTransliterationWrapper().isMatch( rStr1, rStr2 ); + String aStr1( filterFormattingChars(rStr1) ); + String aStr2( filterFormattingChars(rStr2) ); + return ImplGetTransliterationWrapper().isMatch( aStr1, aStr2 ); } sal_Bool vcl::I18nHelper::MatchMnemonic( const String& rString, sal_Unicode cMnemonicChar ) const diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 113953753601..fe1ef6e7b992 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -65,6 +65,11 @@ SalInstance::~SalInstance() { } +void SalInstance::FillFontPathList( std::list< rtl::OString >& ) +{ + // do nothing +} + SalTimer::~SalTimer() { } diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index e9dbe16f1fcf..6c09978e37b1 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -43,67 +43,59 @@ // building X11 graphics layers. #if defined UNX && ! defined QUARTZ -#include <svunx.h> +#include "svunx.h" #endif -#ifndef _SV_SVSYS_HXX -#include <svsys.h> -#endif -#include <vcl/salinst.hxx> -#include <vcl/salwtype.hxx> -#ifndef _VOS_SIGNAL_HXX -#include <vos/signal.hxx> -#endif -#ifndef _VOS_SOCKET_HXX -#include <vos/socket.hxx> -#endif -#include <tools/tools.h> -#include <tools/debug.hxx> -#ifndef _UNIQID_HXX -#include <tools/unqid.hxx> -#endif -#include <vcl/svdata.hxx> -#include <vcl/dbggui.hxx> -#include <vcl/svapp.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/cvtgrf.hxx> -#include <vcl/image.hxx> -#ifndef _SV_RESMGR_HXX -#include <tools/resmgr.hxx> -#endif -#include <vcl/accmgr.hxx> -#include <vcl/idlemgr.hxx> -#include <vcl/outdev.h> -#include <vcl/outfont.hxx> -#include <vcl/print.h> -#include <vcl/settings.hxx> -#include <vcl/unowrap.hxx> -#include <vcl/salsys.hxx> -#include <vcl/saltimer.hxx> -#include <vcl/salimestatus.hxx> -#include <vcl/impimagetree.hxx> -#include <vcl/xconnection.hxx> - -#include <vos/process.hxx> -#include <osl/file.hxx> -#include <comphelper/processfactory.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <rtl/logfile.hxx> +#include "svsys.h" +#include "vcl/salinst.hxx" +#include "vcl/salwtype.hxx" +#include "vos/signal.hxx" +#include "tools/tools.h" +#include "tools/debug.hxx" +#include "tools/unqid.hxx" +#include "vcl/svdata.hxx" +#include "vcl/dbggui.hxx" +#include "vcl/svapp.hxx" +#include "vcl/wrkwin.hxx" +#include "vcl/cvtgrf.hxx" +#include "vcl/image.hxx" +#include "tools/resmgr.hxx" +#include "vcl/accmgr.hxx" +#include "vcl/idlemgr.hxx" +#include "vcl/outdev.h" +#include "vcl/outfont.hxx" +#include "vcl/print.h" +#include "vcl/settings.hxx" +#include "vcl/unowrap.hxx" +#include "vcl/salsys.hxx" +#include "vcl/saltimer.hxx" +#include "vcl/salimestatus.hxx" +#include "vcl/impimagetree.hxx" +#include "vcl/xconnection.hxx" + +#include "vos/process.hxx" +#include "osl/file.hxx" +#include "comphelper/processfactory.hxx" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/lang/XComponent.hpp" +#include "rtl/logfile.hxx" + +#include "vcl/fontcfg.hxx" +#include "vcl/configsettings.hxx" +#include "vcl/lazydelete.hxx" + +#include "cppuhelper/implbase1.hxx" +#include "uno/current_context.hxx" #if OSL_DEBUG_LEVEL > 0 #include <typeinfo> -#include <rtl/strbuf.hxx> +#include "rtl/strbuf.hxx" #endif using namespace ::rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -#include <vcl/fontcfg.hxx> -#include <vcl/configsettings.hxx> -#include <cppuhelper/implbase1.hxx> -#include <uno/current_context.hxx> // ======================================================================= @@ -355,6 +347,8 @@ void DeInitVCL() ImplSVData* pSVData = ImplGetSVData(); pSVData->mbDeInit = TRUE; + vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit(); + // give ime status a chance to destroy its own windows delete pSVData->mpImeStatus; pSVData->mpImeStatus = NULL; @@ -383,7 +377,7 @@ void DeInitVCL() DBG_ASSERT( nBadTopWindows==0, aBuf.getStr() ); #endif - ImplImageTree::cleanup(); + ImplImageTreeSingletonRef()->shutDown(); delete pExceptionHandler; pExceptionHandler = NULL; diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 57d67de19c76..c717e491d7b2 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -275,7 +275,8 @@ USHORT ImplEntryList::FindEntry( const XubString& rString, BOOL bSearchMRUArea ) for ( USHORT n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ ) { ImplEntryType* pImplEntry = GetEntry( n ); - if ( pImplEntry->maStr == rString ) + String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) ); + if ( aComp == rString ) return n; } return LISTBOX_ENTRY_NOTFOUND; @@ -782,6 +783,7 @@ void ImplListBoxWindow::ImplCallSelect() ImplEntryType* pNewEntry = new ImplEntryType( aSelected ); pNewEntry->mbIsSelected = bSelectNewEntry; GetEntryList()->InsertEntry( 0, pNewEntry, FALSE ); + ImplUpdateEntryMetrics( *pNewEntry ); GetEntryList()->SetMRUCount( ++nMRUCount ); SetSeparatorPos( nMRUCount ? nMRUCount-1 : 0 ); maMRUChangedHdl.Call( NULL ); @@ -893,9 +895,13 @@ USHORT ImplListBoxWindow::GetLastVisibleEntry() const USHORT nPos = mnTop; long nWindowHeight = GetSizePixel().Height(); USHORT nCount = mpEntryList->GetEntryCount(); - for( long nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) ) + long nDiff; + for( nDiff = 0; nDiff < nWindowHeight && nPos < nCount; nDiff = mpEntryList->GetAddedHeight( nPos, mnTop ) ) nPos++; + if( nDiff > nWindowHeight && nPos > mnTop ) + nPos--; + if( nPos >= nCount ) nPos = nCount-1; @@ -1531,7 +1537,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) else if ( (mnCurrentPos+1) < mpEntryList->GetEntryCount() ) { USHORT nCount = mpEntryList->GetEntryCount(); - USHORT nCurVis = GetLastVisibleEntry() - mnTop +1; + USHORT nCurVis = GetLastVisibleEntry() - mnTop; USHORT nTmp = Min( nCurVis, nCount ); nTmp += mnTop - 1; if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 ) diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 25a086060fcf..561d550b1168 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1230,55 +1230,58 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) } } - // Some native toolkits (GTK+) draw tabs right-to-left, with an - // overlap between adjacent tabs - bool bDrawTabsRTL = IsNativeControlSupported( CTRL_TAB_ITEM, PART_TABS_DRAW_RTL ); - ImplTabItem * pFirstTab = NULL; - ImplTabItem * pLastTab = NULL; - size_t idx; - - // Event though there is a tab overlap with GTK+, the first tab is not - // overlapped on the left side. Other tookits ignore this option. - if ( bDrawTabsRTL ) - { - pFirstTab = &mpTabCtrlData->maItemList.front(); - pLastTab = &mpTabCtrlData->maItemList.back(); - idx = mpTabCtrlData->maItemList.size()-1; - } - else + if ( !mpTabCtrlData->maItemList.empty() ) { - pLastTab = &mpTabCtrlData->maItemList.back(); - pFirstTab = &mpTabCtrlData->maItemList.front(); - idx = 0; - } + // Some native toolkits (GTK+) draw tabs right-to-left, with an + // overlap between adjacent tabs + bool bDrawTabsRTL = IsNativeControlSupported( CTRL_TAB_ITEM, PART_TABS_DRAW_RTL ); + ImplTabItem * pFirstTab = NULL; + ImplTabItem * pLastTab = NULL; + size_t idx; - while ( idx < mpTabCtrlData->maItemList.size() ) - { - ImplTabItem* pItem = &mpTabCtrlData->maItemList[idx]; - if ( pItem != pCurItem ) + // Event though there is a tab overlap with GTK+, the first tab is not + // overlapped on the left side. Other tookits ignore this option. + if ( bDrawTabsRTL ) + { + pFirstTab = &mpTabCtrlData->maItemList.front(); + pLastTab = &mpTabCtrlData->maItemList.back(); + idx = mpTabCtrlData->maItemList.size()-1; + } + else + { + pLastTab = &mpTabCtrlData->maItemList.back(); + pFirstTab = &mpTabCtrlData->maItemList.front(); + idx = 0; + } + + while ( idx < mpTabCtrlData->maItemList.size() ) + { + ImplTabItem* pItem = &mpTabCtrlData->maItemList[idx]; + if ( pItem != pCurItem ) + { + Region aClipRgn( GetActiveClipRegion() ); + aClipRgn.Intersect( pItem->maRect ); + if( !rRect.IsEmpty() ) + aClipRgn.Intersect( rRect ); + if( bLayout || !aClipRgn.IsEmpty() ) + ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), FALSE ); + } + + if ( bDrawTabsRTL ) + idx--; + else + idx++; + } + + if ( pCurItem ) { Region aClipRgn( GetActiveClipRegion() ); - aClipRgn.Intersect( pItem->maRect ); + aClipRgn.Intersect( pCurItem->maRect ); if( !rRect.IsEmpty() ) aClipRgn.Intersect( rRect ); if( bLayout || !aClipRgn.IsEmpty() ) - ImplDrawItem( pItem, aCurRect, bLayout, (pItem==pFirstTab), (pItem==pLastTab), FALSE ); + ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), TRUE ); } - - if ( bDrawTabsRTL ) - idx--; - else - idx++; - } - - if ( pCurItem ) - { - Region aClipRgn( GetActiveClipRegion() ); - aClipRgn.Intersect( pCurItem->maRect ); - if( !rRect.IsEmpty() ) - aClipRgn.Intersect( rRect ); - if( bLayout || !aClipRgn.IsEmpty() ) - ImplDrawItem( pCurItem, aCurRect, bLayout, (pCurItem==pFirstTab), (pCurItem==pLastTab), TRUE ); } if ( !bLayout && HasFocus() ) diff --git a/psprint/source/fontsubset/crc32.c b/vcl/source/fontsubset/crc32.c index 386b873a011c..386b873a011c 100644 --- a/psprint/source/fontsubset/crc32.c +++ b/vcl/source/fontsubset/crc32.c diff --git a/psprint/source/fontsubset/crc32.h b/vcl/source/fontsubset/crc32.h index fa9ef71a1432..fa9ef71a1432 100644 --- a/psprint/source/fontsubset/crc32.h +++ b/vcl/source/fontsubset/crc32.h diff --git a/psprint/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index f49eb54c575a..e73ccccc12a4 100644 --- a/psprint/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -29,7 +29,7 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" #include "sft.h" #undef true @@ -180,11 +180,16 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, const ULONG nTag = NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/... const USHORT nOffset= NEXT_UShort( pFeatureHeader ); - // feature (required && (requested || available))? - if( (aFeatureIndexList[0] != nFeatureIndex) - && (!std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag)) - || (!std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex) ) ) - continue; + // ignore unneeded feature lookups + if( aFeatureIndexList[0] != nFeatureIndex ) // do not ignore the required feature + { + const int nRequested = std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex); + if( !nRequested ) // ignore features that are not requested + continue; + const int nAvailable = std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag); + if( !nAvailable ) // some fonts don't provide features they request! + continue; + } const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset; if( pGsubLimit < pFeatureTable + 2 ) diff --git a/psprint/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h index c64b2abb7e00..c64b2abb7e00 100644 --- a/psprint/source/fontsubset/gsub.h +++ b/vcl/source/fontsubset/gsub.h diff --git a/psprint/source/fontsubset/list.c b/vcl/source/fontsubset/list.c index 83ebe8595a46..83ebe8595a46 100644 --- a/psprint/source/fontsubset/list.c +++ b/vcl/source/fontsubset/list.c diff --git a/psprint/source/fontsubset/makefile.mk b/vcl/source/fontsubset/makefile.mk index e6c22bbcac17..b1d2552752a8 100644 --- a/psprint/source/fontsubset/makefile.mk +++ b/vcl/source/fontsubset/makefile.mk @@ -31,7 +31,7 @@ PRJ=..$/.. -PRJNAME=psprint +PRJNAME=vcl TARGET=fontsubset # --- Settings ----------------------------------------------------- diff --git a/psprint/source/fontsubset/sft.c b/vcl/source/fontsubset/sft.c index c3a8ce377282..be54a872fd7f 100644 --- a/psprint/source/fontsubset/sft.c +++ b/vcl/source/fontsubset/sft.c @@ -1683,12 +1683,6 @@ int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf ) * Size will be 0, but fonts smaller than 4 bytes would be broken anyway. */ if ((*ttf)->fsize == 0) { -#ifdef MACOSX - fprintf( stderr, "WARNING: Font file %s\nhad a data-fork size of 0, it is either:\n", (*ttf)->fname ); - fprintf( stderr, " 1) A Resource-Based font that has a .ttf at the end of its name\n" ); - fprintf( stderr, " (in which case '/usr/local/bin/fondu <font-file-name>' should be run to convert it instead)\n" ); - fprintf( stderr, " 2) A bad font\n\n" ); -#endif ret = SF_BADFILE; goto cleanup; } diff --git a/psprint/source/fontsubset/ttcr.c b/vcl/source/fontsubset/ttcr.c index e8c9d8cf74e0..e8c9d8cf74e0 100644 --- a/psprint/source/fontsubset/ttcr.c +++ b/vcl/source/fontsubset/ttcr.c diff --git a/psprint/source/fontsubset/ttcr.h b/vcl/source/fontsubset/ttcr.h index 95aa1a6c9e99..95aa1a6c9e99 100644 --- a/psprint/source/fontsubset/ttcr.h +++ b/vcl/source/fontsubset/ttcr.h diff --git a/psprint/source/fontsubset/u2big5.inc b/vcl/source/fontsubset/u2big5.inc index 2883e9d99094..2883e9d99094 100644 --- a/psprint/source/fontsubset/u2big5.inc +++ b/vcl/source/fontsubset/u2big5.inc diff --git a/psprint/source/fontsubset/u2johab.inc b/vcl/source/fontsubset/u2johab.inc index ae07cc571fb8..ae07cc571fb8 100644 --- a/psprint/source/fontsubset/u2johab.inc +++ b/vcl/source/fontsubset/u2johab.inc diff --git a/psprint/source/fontsubset/u2prc.inc b/vcl/source/fontsubset/u2prc.inc index 2479d23ebe6f..2479d23ebe6f 100644 --- a/psprint/source/fontsubset/u2prc.inc +++ b/vcl/source/fontsubset/u2prc.inc diff --git a/psprint/source/fontsubset/u2shiftjis.inc b/vcl/source/fontsubset/u2shiftjis.inc index fb130feaebe2..fb130feaebe2 100644 --- a/psprint/source/fontsubset/u2shiftjis.inc +++ b/vcl/source/fontsubset/u2shiftjis.inc diff --git a/psprint/source/fontsubset/u2wansung.inc b/vcl/source/fontsubset/u2wansung.inc index 0cb8867f1c2a..0cb8867f1c2a 100644 --- a/psprint/source/fontsubset/u2wansung.inc +++ b/vcl/source/fontsubset/u2wansung.inc diff --git a/psprint/source/fontsubset/xlat.c b/vcl/source/fontsubset/xlat.c index 840850a020da..840850a020da 100644 --- a/psprint/source/fontsubset/xlat.c +++ b/vcl/source/fontsubset/xlat.c diff --git a/psprint/source/fontsubset/xlat.h b/vcl/source/fontsubset/xlat.h index 86eca1691574..86eca1691574 100644 --- a/psprint/source/fontsubset/xlat.h +++ b/vcl/source/fontsubset/xlat.h diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index 3e2ab3205d9c..36a4fc5f5f24 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -265,20 +265,23 @@ void BitmapReadAccess::ImplZeroInitUnusedBits() DBG_ASSERT( 8*nScanSize >= nBits, "BitmapWriteAccess::ZeroInitUnusedBits: span size smaller than width?!"); const sal_uInt32 nLeftOverBits = 8*sizeof(sal_uInt8)*nScanSize - nBits; - const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; - sal_uInt8 nMask; - - if( bMsb ) - nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); - else - nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); - - BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes ); - for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) + if( nLeftOverBits != 0 ) // else there is really nothing to do { - *pLastBytes &= nMask; - for( sal_uInt32 j = 1; j < nBytes; j++ ) - pLastBytes[j] = 0; + const sal_uInt32 nBytes = (nLeftOverBits + 7U) >> 3U; + sal_uInt8 nMask; + + if( bMsb ) + nMask = static_cast<sal_uInt8>(0xffU << (nLeftOverBits & 3UL)); + else + nMask = static_cast<sal_uInt8>(0xffU >> (nLeftOverBits & 3UL)); + + BYTE* pLastBytes = (BYTE*)GetBuffer() + ( nScanSize - nBytes ); + for( sal_uInt32 i = 0; i < nHeight; i++, pLastBytes += nScanSize ) + { + *pLastBytes &= nMask; + for( sal_uInt32 j = 1; j < nBytes; j++ ) + pLastBytes[j] = 0; + } } } else if( nBits & 0x1f ) diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 14c211e4e045..c1c02b673658 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -397,13 +397,8 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, ULONG nConvertMod void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { - LineInfo aLineInfo( LINE_NONE, 0 ); - Stack aLIStack; - ULONG nPos = rIStm.Tell(); + const ULONG nPos = rIStm.Tell(); const USHORT nOldFormat = rIStm.GetNumberFormatInt(); - rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); - BOOL bFatLine = FALSE; - VirtualDevice aFontVDev; rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); @@ -412,14 +407,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) INT16 nSize; INT16 nVersion; - // Header lesen + // read header rIStm.Read( (char*) &aCode, sizeof( aCode ) ); // Kennung rIStm >> nSize; // Size rIStm >> nVersion; // Version rIStm >> aPrefSz.Width(); // PrefSize.Width() rIStm >> aPrefSz.Height(); // PrefSize.Height() - // Header-Kennung und Versionsnummer pruefen + // check header-magic and version if( rIStm.GetError() || ( memcmp( aCode, "SVGDI", sizeof( aCode ) ) != 0 ) || ( nVersion != 200 ) ) @@ -427,9 +422,16 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR ); rIStm.SetNumberFormatInt( nOldFormat ); rIStm.Seek( nPos ); + return; } - else - { + + LineInfo aLineInfo( LINE_NONE, 0 ); + Stack aLIStack; + VirtualDevice aFontVDev; + rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding(); + BOOL bFatLine = FALSE; + + // TODO: fix reindentation below if you can accept being blamed by the SCM MapMode aMapMode; Polygon aActionPoly; Rectangle aRect; @@ -1157,7 +1159,6 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) // cleanup push-pop stack if neccessary for( void* pLineInfo = aLIStack.Pop(); pLineInfo; pLineInfo = aLIStack.Pop() ) delete (LineInfo*) pLineInfo; - } rIStm.SetNumberFormatInt( nOldFormat ); } diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index 5c228072eb65..820b053a4211 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -30,16 +30,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <tools/stream.hxx> -#include <tools/vcompat.hxx> -#include <tools/debug.hxx> -#include <psprint/sft.h> -#include <vcl/font.hxx> -#include <vcl/impfont.hxx> -#include <vcl/fontcfg.hxx> -#ifndef _VCL_OUTDEV_H -#include <vcl/outdev.h> // just for ImplGetEnglishSearchFontName! TODO: move it -#endif + +#include "sft.h" + +#include "tools/stream.hxx" +#include "tools/vcompat.hxx" +#include "tools/debug.hxx" +#include "vcl/font.hxx" +#include "vcl/impfont.hxx" +#include "vcl/fontcfg.hxx" +#include "vcl/outdev.h" // just for ImplGetEnglishSearchFontName! TODO: move it #include <algorithm> diff --git a/vcl/source/gdi/imagerepository.cxx b/vcl/source/gdi/imagerepository.cxx index ae3d97b78aa4..1bd3395e0826 100644 --- a/vcl/source/gdi/imagerepository.cxx +++ b/vcl/source/gdi/imagerepository.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include <vcl/bitmapex.hxx> #include <vcl/imagerepository.hxx> #include <vcl/svapp.hxx> #ifndef _SV_IMPIMAGETREE_H diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index 00cba849de43..64cddece1199 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -1,696 +1,294 @@ /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: impimagetree.cxx,v $ - * $Revision: 1.19 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2008 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include "sal/config.h" -#include <cstdio> -#include <ctype.h> -#include <tools/debug.hxx> -#include <tools/datetime.hxx> -#include <tools/urlobj.hxx> -#include <vcl/svapp.hxx> -#include <vcl/bitmapex.hxx> -#include <vcl/pngread.hxx> -#include <unotools/ucbstreamhelper.hxx> -#ifndef _UNTOOLS_LOCALFILEHELPER_HXX -#include <unotools/localfilehelper.hxx> -#endif -#include <unotools/datetime.hxx> -#include <comphelper/processfactory.hxx> -#include <rtl/bootstrap.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/packages/zip/XZipFileAccess.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> - -#include "vcl/impimagetree.hxx" - +#include <list> +#include <memory> +#include <utility> #include <vector> -#include <hash_map> -#define DEFAULT_PROJECTNAME "res" -#define IMAGES_ZIPFILENAME_PREFIX "images" -#define IMAGES_ZIPFILENAME_BRAND "_brand" -#define IMAGES_ZIPFILENAME_SUFFIX ".zip" -#define IMAGES_CACHEDIR "imagecache" - -using namespace ::com::sun::star; +#include <hash_map> -ImplZipAccessor::ImplZipAccessor() -{ - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/io/XInputStream.hpp" +#include "com/sun/star/lang/Locale.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "comphelper/processfactory.hxx" +#include "osl/diagnose.h" +#include "rtl/bootstrap.hxx" +#include "rtl/string.h" +#include "rtl/textenc.h" +#include "rtl/ustrbuf.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "tools/stream.hxx" +#include "tools/urlobj.hxx" +#include "vcl/bitmapex.hxx" +#include "vcl/impimagetree.hxx" +#include "vcl/pngread.hxx" +#include "vcl/settings.hxx" +#include "vcl/svapp.hxx" - if( xFactory.is() ) - { - mxFileAccess.set( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), - uno::UNO_QUERY ); - } -} +namespace { -// ----------------------------------------------------------------------- +namespace css = com::sun::star; -ImplZipAccessor::~ImplZipAccessor() +rtl::OUString createPath( + rtl::OUString const & name, sal_Int32 pos, rtl::OUString const & locale) { - Clear(); + rtl::OUStringBuffer b(name.copy(0, pos + 1)); + b.append(locale); + b.append(name.copy(pos)); + return b.makeStringAndClear(); } -// ----------------------------------------------------------------------- - -void ImplZipAccessor::Update( const ::rtl::OUString& rSymbolsStyle ) +std::auto_ptr< SvStream > wrapStream( + css::uno::Reference< css::io::XInputStream > const & stream) { -#ifdef DEBUG - std::fprintf( stderr, "\nUpdating symbols for style: %s\n", ByteString( String( rSymbolsStyle ), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); -#endif - - Clear(); - - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - const ::rtl::OUString aZipFileName( ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_PREFIX ) ); - rtl::OUString aBrandPath( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/share/config" ) ); - rtl::OUString aOOOPath( RTL_CONSTASCII_USTRINGPARAM( "$OOO_BASE_DIR/share/config" ) ); - ::std::vector< ::rtl::OUString > aTmpURLVector; - - rtl::Bootstrap::expandMacros( aBrandPath ); - rtl::Bootstrap::expandMacros( aOOOPath ); - - // Theme Branding Zip - if( rSymbolsStyle.getLength() ) - { - INetURLObject aThemeBrandURL( aBrandPath ); - ::rtl::OUString aThemeBrandZip( aZipFileName ); - - ( aThemeBrandZip += ::rtl::OUString::createFromAscii( "_" ) ) += rSymbolsStyle; - aThemeBrandZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_BRAND ); - aThemeBrandZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_SUFFIX ); - aThemeBrandURL.Append( aThemeBrandZip ); - - if( mxFileAccess->exists( aThemeBrandURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) - aTmpURLVector.push_back( aThemeBrandURL.GetMainURL( INetURLObject::NO_DECODE ) ); - } - - // Branding Zip - INetURLObject aBrandURL( aBrandPath ); - ::rtl::OUString aBrandZip( aZipFileName ); - - aBrandZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_BRAND ); - aBrandZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_SUFFIX ); - aBrandURL.Append( aBrandZip ); - - if( mxFileAccess->exists( aBrandURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) - aTmpURLVector.push_back( aBrandURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - // Theme Zip - if( rSymbolsStyle.getLength() ) - { - INetURLObject aThemeURL( aOOOPath ); - ::rtl::OUString aThemeZip( aZipFileName ); - - ( aThemeZip += ::rtl::OUString::createFromAscii( "_" ) ) += rSymbolsStyle; - aThemeZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_SUFFIX ); - aThemeURL.Append( aThemeZip ); - - if( mxFileAccess->exists( aThemeURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) - aTmpURLVector.push_back( aThemeURL.GetMainURL( INetURLObject::NO_DECODE ) ); - } - - // Default Zip - if( rSymbolsStyle.getLength() ) - { - INetURLObject aDefaultURL( aOOOPath ); - ::rtl::OUString aDefaultZip( aZipFileName ); - - aDefaultZip += ::rtl::OUString::createFromAscii( IMAGES_ZIPFILENAME_SUFFIX ); - aDefaultURL.Append( aDefaultZip ); - - if( mxFileAccess->exists( aDefaultURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) - aTmpURLVector.push_back( aDefaultURL.GetMainURL( INetURLObject::NO_DECODE ) ); - } - - if( xFactory.is() ) - { - for( unsigned int i = 0; i < aTmpURLVector.size(); ++i ) - { - try - { - uno::Reference< packages::zip::XZipFileAccess > xZipAcc( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.packages.zip.ZipFileAccess" ) ), - uno::UNO_QUERY ); - - if( xZipAcc.is() ) - { - uno::Reference< lang::XInitialization > xInit( xZipAcc, uno::UNO_QUERY ); - - if( xInit.is() ) - { - uno::Sequence< uno::Any > aInitSeq( 1 ); - const ::rtl::OUString& rZipURL = aTmpURLVector[ i ]; - - if( rZipURL.getLength() ) - { - uno::Reference< container::XNameAccess > xNameAcc; - - aInitSeq[ 0 ] <<= rZipURL; - xInit->initialize( aInitSeq ); - xNameAcc.set( xZipAcc, uno::UNO_QUERY ); - - if( xNameAcc.is() && xNameAcc->getElementNames().getLength() ) - { - maURLVector.push_back( rZipURL ); - maZipAccVector.push_back( xZipAcc ); - maNameAccVector.push_back( xNameAcc ); -#ifdef DEBUG - std::fprintf( stderr, "Current set has symbols from archive: %s\n", ByteString( String( rZipURL ), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); -#endif - } - } - } - } - } - catch( const uno::Exception& ) - { - } + // This could use SvInputStream instead if that did not have a broken + // SeekPos implementation for an XInputStream that is not also XSeekable + // (cf. "@@@" at tags/DEV300_m37/svtools/source/misc1/strmadpt.cxx@264807 + // l. 593): + OSL_ASSERT(stream.is()); + std::auto_ptr< SvStream > s(new SvMemoryStream); + for (;;) { + css::uno::Sequence< sal_Int8 > data; + sal_Int32 const size = 30000; + sal_Int32 n = stream->readBytes(data, size); + s->Write(data.getConstArray(), n); + if (n < size) { + break; } } + s->Seek(0); + return s; } -// ----------------------------------------------------------------------- - -void ImplZipAccessor::Clear() -{ - maURLVector.clear(); - maZipAccVector.clear(); - maNameAccVector.clear(); -} - -// ----------------------------------------------------------------------- - -bool ImplZipAccessor::HasEntries() const +void loadFromStream( + css::uno::Reference< css::io::XInputStream > const & stream, + rtl::OUString const & path, BitmapEx & bitmap) { - return( maNameAccVector.size() > 0 ); -} - -// ----------------------------------------------------------------------- - -uno::Reference< io::XInputStream > ImplZipAccessor::GetByName( const ::rtl::OUString& rName ) const -{ - uno::Reference< io::XInputStream > xRet; - -#ifdef DEBUG - std::fprintf( stderr, "Looking for file: %s\n", ByteString( String( rName ), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); -#endif - - for( unsigned int i = 0; ( i < maNameAccVector.size() ) && !xRet.is(); ++i ) - { - if( maNameAccVector[ i ]->hasByName( rName ) ) - { - try - { - if( maNameAccVector[ i ]->getByName( rName ) >>= xRet ) - { -#ifdef DEBUG - std::fprintf( stderr, "Found in archive: %s\n\n", ByteString( String( maURLVector[ i ] ), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); -#endif - - - break; - } - } - catch( const uno::Exception & ) - { - } - } + std::auto_ptr< SvStream > s(wrapStream(stream)); + if (path.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM(".png"))) { + bitmap = vcl::PNGReader(*s).Read(); + } else { + *s >> bitmap; } - - return( xRet ); -} - - -// ----------------- -// - ImplImageTree - -// ----------------- - -typedef ::std::hash_map< ::rtl::OUString, BitmapEx, ::rtl::OUStringHash > BmpExHashMap; -static BmpExHashMap aBmpExHashMap; - -// ----------------------------------------------------------------------- - -ImplImageTree::ImplImageTree() : - mbInit( false ), - maSymbolsStyle( Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName() ) -{ } -// ----------------------------------------------------------------------- - -ImplImageTree::~ImplImageTree() -{ } -// ----------------------------------------------------------------------- - -void ImplImageTree::cleanup() -{ - ImplImageTreeSingletonRef aCleaner; - - aCleaner->maZipAcc.Clear(); - aCleaner->mxFileAccess.clear(); - aCleaner->mxPathSettings.clear(); - - BmpExHashMap aTmp; - aBmpExHashMap.swap( aTmp ); -} +ImplImageTree::ImplImageTree() {} -// ----------------------------------------------------------------------- +ImplImageTree::~ImplImageTree() {} -bool ImplImageTree::implInit() +bool ImplImageTree::loadImage( + rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap, + bool localized) { - if( !mbInit ) - { - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - if( xFactory.is() ) - { - // #137795# protect against exceptions in service instantiation - try - { - mxPathSettings.set( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.util.PathSettings" ) ), - uno::UNO_QUERY ); - mxFileAccess.set( xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), - uno::UNO_QUERY ); - - if( mxPathSettings.is() && mxFileAccess.is() ) - { - maZipAcc.Update( maSymbolsStyle ); - // implCheckUserCache(); + setStyle(style); + if (cacheLookup(name, localized, bitmap)) { + return true; + } + if (!bitmap.IsEmpty()) { + bitmap.SetEmpty(); + } + std::vector< rtl::OUString > paths; + paths.push_back(name); + if (localized) { + sal_Int32 pos = name.lastIndexOf('/'); + if (pos != -1) { + css::lang::Locale const & loc = + Application::GetSettings().GetUILocale(); + paths.push_back(createPath(name, pos, loc.Language)); + if (loc.Country.getLength() != 0) { + rtl::OUStringBuffer b(loc.Language); + b.append(sal_Unicode('-')); + b.append(loc.Country); + rtl::OUString p(createPath(name, pos, b.makeStringAndClear())); + paths.push_back(p); + if (loc.Variant.getLength() != 0) { + b.append(p); + b.append(sal_Unicode('-')); + b.append(loc.Variant); + paths.push_back( + createPath(name, pos, b.makeStringAndClear())); } } - catch( const uno::Exception& ) - { - maZipAcc.Clear(); - mxPathSettings.clear(); - mxFileAccess.clear(); - } } } - - return( mbInit = maZipAcc.HasEntries() ); -} - -// ----------------------------------------------------------------------- - -const ::rtl::OUString& ImplImageTree::implGetUserDirURL() const -{ - static ::rtl::OUString aRet; - - if( !aRet.getLength() && mxPathSettings.is() && mxFileAccess.is() ) - { - const ::rtl::OUString aImagesCacheDir( ::rtl::OUString::createFromAscii( IMAGES_CACHEDIR ) ); - uno::Any aAny( mxPathSettings->getPropertyValue( ::rtl::OUString::createFromAscii( "UserConfig" ) ) ); - - if( ( aAny >>= aRet ) && aRet.getLength() ) - { - INetURLObject aCacheURL( aRet ); - - aCacheURL.Append( aImagesCacheDir ); - - try - { - mxFileAccess->createFolder( aRet = aCacheURL.GetMainURL( INetURLObject::NO_DECODE ) ); - } - catch( const ucb::CommandAbortedException& ) - { - } - catch( const uno::Exception& ) - { - } - } + bool found = false; + try { + found = find(paths, bitmap); + } catch (css::uno::RuntimeException &) { + throw; + } catch (css::uno::Exception & e) { + OSL_TRACE( + "ImplImageTree::loadImage exception \"%s\"", + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } - - return aRet; + if (found) { + m_cache[name.intern()] = std::make_pair(localized, bitmap); + } + return found; } -// ----------------------------------------------------------------------- - -::rtl::OUString ImplImageTree::implGetUserFileURL( const ::rtl::OUString& rName ) const -{ - INetURLObject aFileURL( implGetUserDirURL() ); - - aFileURL.Append( rName ); - - return( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ); +void ImplImageTree::shutDown() { + m_style = rtl::OUString(); + // for safety; empty m_style means "not initialized" + m_zips.clear(); + m_cache.clear(); } -// ----------------------------------------------------------------------- - -void ImplImageTree::implCheckUserCache() -{ -/* - const ::rtl::OUString& rZipURL = implGetZipFileURL(); - const ::rtl::OUString& rUserDirURL = implGetUserDirURL(); - - if( rZipURL.getLength() && rUserDirURL.getLength() ) - { - try - { - ::DateTime aZipDateTime, aCacheFileDateTime; - const uno::Sequence< ::rtl::OUString > aCacheFiles( mxFileAccess->getFolderContents( rUserDirURL, false ) ); - - ::utl::typeConvert( mxFileAccess->getDateTimeModified( rZipURL ), aZipDateTime ); - - for( sal_Int32 i = 0; i < aCacheFiles.getLength(); ++i ) - { - const ::rtl::OUString aCacheFile( aCacheFiles[ i ] ); - - try - { - ::utl::typeConvert( mxFileAccess->getDateTimeModified( aCacheFile ), aCacheFileDateTime ); - - if( aZipDateTime > aCacheFileDateTime ) - mxFileAccess->kill( aCacheFile ); - } - catch( const ucb::CommandAbortedException& ) - { - } - catch( const uno::Exception& ) - { - } - } - } - catch( const ucb::CommandAbortedException& ) - { - } - catch( const uno::Exception& ) - { - } +void ImplImageTree::setStyle(rtl::OUString const & style) { + OSL_ASSERT(style.getLength() != 0); // empty m_style means "not initialized" + if (style != m_style) { + m_style = style; + resetZips(); + m_cache.clear(); } -*/ } -// ------------------------------------------------------------------------------ - -bool ImplImageTree::implLoadFromStream( SvStream& rIStm, - const ::rtl::OUString& rFileName, - BitmapEx& rReturn ) -{ - static const ::rtl::OUString aPNGExtension( ::rtl::OUString::createFromAscii( "png" ) ); - const sal_Int32 nDotPos = rFileName.lastIndexOf( '.' ); - const sal_uInt32 nStmPos = rIStm.Tell(); - - if( ( -1 != nDotPos ) && ( rFileName.lastIndexOf( aPNGExtension ) == ( nDotPos + 1 ) ) ) +void ImplImageTree::resetZips() { + m_zips.clear(); { - ::vcl::PNGReader aPNGReader( rIStm ); - rReturn = aPNGReader.Read(); + rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/share/config")); + rtl::Bootstrap::expandMacros(url); + INetURLObject u(url); + OSL_ASSERT(!u.HasError()); + rtl::OUStringBuffer b; + b.appendAscii(RTL_CONSTASCII_STRINGPARAM("images_")); + b.append(m_style); + b.appendAscii(RTL_CONSTASCII_STRINGPARAM("_brand.zip")); + bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL); + OSL_ASSERT(ok); (void) ok; + m_zips.push_back( + std::make_pair( + u.GetMainURL(INetURLObject::NO_DECODE), + css::uno::Reference< css::container::XNameAccess >())); } - - if( rReturn.IsEmpty() ) { - rIStm.Seek( nStmPos ); - rIStm.ResetError(); - rIStm >> rReturn; + rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM( + "$BRAND_BASE_DIR/share/config/images_brand.zip")); + rtl::Bootstrap::expandMacros(url); + m_zips.push_back( + std::make_pair( + url, css::uno::Reference< css::container::XNameAccess >())); } - - return( !rReturn.IsEmpty() ); -} - -// ------------------------------------------------------------------------------ - -::std::auto_ptr< SvStream > ImplImageTree::implGetStream( const uno::Reference< io::XInputStream >& rxIStm ) const -{ - ::std::auto_ptr< SvStream > apRet; - - // create a seekable memory stream from the non-seekable XInputStream - if( rxIStm.is() ) { - const sal_Int32 nBufferSize = 32768; - sal_Int32 nRead; - uno::Sequence < sal_Int8 > aReadSeq( nBufferSize ); - - apRet.reset( new SvMemoryStream( nBufferSize, nBufferSize ) ); - - do - { - nRead = rxIStm->readBytes ( aReadSeq, nBufferSize ); - apRet->Write( aReadSeq.getConstArray(), nRead ); - } - while ( nRead == nBufferSize ); - - if( apRet->Tell() > 0 ) - apRet->Seek( 0 ); - else - apRet.reset(); + rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/config")); + rtl::Bootstrap::expandMacros(url); + INetURLObject u(url); + OSL_ASSERT(!u.HasError()); + rtl::OUStringBuffer b; + b.appendAscii(RTL_CONSTASCII_STRINGPARAM("images_")); + b.append(m_style); + b.appendAscii(RTL_CONSTASCII_STRINGPARAM(".zip")); + bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL); + OSL_ASSERT(ok); (void) ok; + m_zips.push_back( + std::make_pair( + u.GetMainURL(INetURLObject::NO_DECODE), + css::uno::Reference< css::container::XNameAccess >())); + } + { + rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM( + "$OOO_BASE_DIR/share/config/images.zip")); + rtl::Bootstrap::expandMacros(url); + m_zips.push_back( + std::make_pair( + url, css::uno::Reference< css::container::XNameAccess >())); } - - return apRet; } -// ------------------------------------------------------------------------------ - -void ImplImageTree::implUpdateSymbolsStyle( const ::rtl::OUString& rSymbolsStyle ) +bool ImplImageTree::cacheLookup( + rtl::OUString const & name, bool localized, BitmapEx & bitmap) { - if ( rSymbolsStyle != maSymbolsStyle ) - { - maSymbolsStyle = rSymbolsStyle; - if ( mbInit ) - { - maZipAcc.Clear(); - mxFileAccess.clear(); - mxPathSettings.clear(); - - BmpExHashMap aTmp; - aBmpExHashMap.swap( aTmp ); - - mbInit = false; - } + Cache::iterator i(m_cache.find(name)); + if (i != m_cache.end() && i->second.first == localized) { + bitmap = i->second.second; + return true; + } else { + return false; } } -// ------------------------------------------------------------------------------ - -bool ImplImageTree::loadImage( const ::rtl::OUString& rName, - const ::rtl::OUString& rSymbolsStyle, - BitmapEx& rReturn, - bool bSearchLanguageDependent ) +bool ImplImageTree::find( + std::vector< rtl::OUString > const & paths, BitmapEx & bitmap) { - implUpdateSymbolsStyle( rSymbolsStyle ); - - const BmpExHashMap::const_iterator aBmpExFindIter( aBmpExHashMap.find( rName ) ); - - if( aBmpExFindIter != aBmpExHashMap.end() ) - rReturn = (*aBmpExFindIter).second; - else - { - if( !rReturn.IsEmpty() ) - rReturn.SetEmpty(); - - if( maZipAcc.HasEntries() || ( implInit() && maZipAcc.HasEntries() ) ) - { - if( bSearchLanguageDependent ) - { - // try to get image from local subdirectory - const ::rtl::OUString aDash( ::rtl::OUString::createFromAscii( "-" ) ); - const lang::Locale& rLocale = Application::GetSettings().GetUILocale(); - ::rtl::OUString aSubDir[3]; // array must be expanded if more locale variants are checked! - int nSubDirs=0; - ::rtl::OUString aLocaleStr( rLocale.Language ); - - aSubDir[nSubDirs++] = aLocaleStr; - if( rLocale.Country.getLength() ) - { - ( aLocaleStr += aDash ) += rLocale.Country; - aSubDir[nSubDirs++] = aLocaleStr; - - if( rLocale.Variant.getLength() ) - { - ( aLocaleStr += aDash ) += rLocale.Variant; - aSubDir[nSubDirs++] = aLocaleStr; - } - } - - for( --nSubDirs; nSubDirs >= 0; nSubDirs-- ) - { - // check all locale variants, starting with the most detailed one - if( aSubDir[nSubDirs].getLength() ) - { - const sal_Int32 nPos = rName.lastIndexOf( '/' ); - - if( -1 != nPos ) - { - ::rtl::OUString aLocaleName( rName.copy( 0, nPos + 1 ) ); - - aLocaleName += aSubDir[nSubDirs]; - aLocaleName += ::rtl::OUString::createFromAscii( "/" ); - aLocaleName += rName.copy( nPos + 1 ); - - try - { - uno::Reference< io::XInputStream > xIStm( maZipAcc.GetByName( aLocaleName ) ); - - if( xIStm.is() ) - { - ::std::auto_ptr< SvStream > apRet( implGetStream( xIStm ) ); - - if( apRet.get() ) - implLoadFromStream( *apRet, aLocaleName, rReturn ); - } - } - catch( const uno::Exception & ) - { - } - } - } - } - } - - if( rReturn.IsEmpty() ) - { - try - { - uno::Reference< io::XInputStream > xIStm( maZipAcc.GetByName( rName ) ); - - if( xIStm.is() ) - { - ::std::auto_ptr< SvStream > apRet( implGetStream( xIStm ) ); - - if( apRet.get() ) - implLoadFromStream( *apRet, rName, rReturn ); - } - } - catch( const uno::Exception & ) - { - } - } - - if( rReturn.IsEmpty() ) - { - ::std::auto_ptr< SvStream > apIStm( ::utl::UcbStreamHelper::CreateStream( implGetUserFileURL( rName ), STREAM_READ )); - - if( apIStm.get() ) - *apIStm >> rReturn; + for (Zips::iterator i(m_zips.begin()); i != m_zips.end();) { + if (!i->second.is()) { + css::uno::Sequence< css::uno::Any > args(1); + args[0] <<= i->first; + try { + i->second.set( + comphelper::createProcessComponentWithArguments( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.packages.zip.ZipFileAccess")), + args), + css::uno::UNO_QUERY_THROW); + } catch (css::uno::RuntimeException &) { + throw; + } catch (css::uno::Exception & e) { + OSL_TRACE( + "ImplImageTree::find exception \"%s\"", + rtl::OUStringToOString( + e.Message, RTL_TEXTENCODING_UTF8).getStr()); + i = m_zips.erase(i); + continue; } } - else + for (std::vector< rtl::OUString >::const_reverse_iterator j( + paths.rbegin()); + j != paths.rend(); ++j) { - // HACK for old setup!!! search in filesystem relative to application root - ::rtl::OUString aAppDir( Application::GetAppFileName() ); - sal_Int32 nPos = aAppDir.lastIndexOf( '/' ); - - if( -1 == nPos ) - nPos = aAppDir.lastIndexOf( '\\' ); - - if( -1 != nPos ) - { - String aURLStr; - - aAppDir = aAppDir.copy( 0, nPos ); - - if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aAppDir, aURLStr ) ) - { - INetURLObject aURL( aURLStr ); - sal_Int32 nIndex = 0; - - do - { - aURL.Append( rName.getToken( 0, '/', nIndex ) ); - } - while( nIndex >= 0 ); - - aURLStr = aURL.GetMainURL( INetURLObject::NO_DECODE ); - - ::std::auto_ptr< SvStream > apIStm( ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_READ ) ); - - if( apIStm.get() ) - { - implLoadFromStream( *apIStm, aURLStr, rReturn ); - apIStm.reset(); - } - - if( rReturn.IsEmpty() ) - { - // HACK for old setup!!! try to look in ../share/config - nPos = aAppDir.lastIndexOf( '/' ); - - if( -1 == nPos ) - nPos = aAppDir.lastIndexOf( '\\' ); - - aAppDir = aAppDir.copy( 0, nPos ); - - if( ( -1 != nPos ) && ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aAppDir, aURLStr ) ) - { - aURL = INetURLObject( aURLStr ); - aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( "share" ) ) ); - aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( "config" ) ) ); - nIndex = 0; - - do - { - aURL.Append( rName.getToken( 0, '/', nIndex ) ); - } - while( nIndex >= 0 ); - - aURLStr = aURL.GetMainURL( INetURLObject::NO_DECODE ); - - apIStm.reset( ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_READ ) ); - - if( apIStm.get() ) - implLoadFromStream( *apIStm, aURLStr, rReturn ); - } - } - } + if (i->second->hasByName(*j)) { + css::uno::Reference< css::io::XInputStream > s; + bool ok = i->second->getByName(*j) >>= s; + OSL_ASSERT(ok); (void) ok; + loadFromStream(s, *j, bitmap); + return true; } } + ++i; } - - if( !rReturn.IsEmpty() ) - aBmpExHashMap[ rName.intern() ] = rReturn; - - return( !rReturn.IsEmpty() ); -} - -// ------------------------------------------------------------------------------ - -void ImplImageTree::addUserImage( const ::rtl::OUString& rName, const BitmapEx& rBmpEx ) -{ - const ::rtl::OUString aFileName( implGetUserFileURL( rName ) ); - - if( aFileName.getLength() ) - { - ::std::auto_ptr< SvStream > apOStm( ::utl::UcbStreamHelper::CreateStream( aFileName, STREAM_WRITE | STREAM_TRUNC ) ); - - if( apOStm.get() ) - *apOStm << rBmpEx; - } + return false; } diff --git a/vcl/source/gdi/implncvt.cxx b/vcl/source/gdi/implncvt.cxx index 9b570b539221..e59fde15b5be 100644 --- a/vcl/source/gdi/implncvt.cxx +++ b/vcl/source/gdi/implncvt.cxx @@ -367,7 +367,7 @@ const Polygon* ImplLineConverter::ImplGetNext() { // Spitzer Winkel : mnFloat0Points = 6; - mpFloat0[ 4 + nFirst ^ 1 ] = aDestPoint; + mpFloat0[ (4 + nFirst) ^ 1 ] = aDestPoint; aDestPoint -= aN2Vec; mpFloat0[ 4 + nFirst ] = aDestPoint; mpFloat0[ 1 + nFirst ] += aN1Vec; diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index 4f8003722f15..0e9da9f81136 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -67,6 +67,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> #include <com/sun/star/awt/XGraphics.hpp> #include <com/sun/star/uno/Sequence.hxx> @@ -2444,13 +2445,19 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) ImplInitLineColor(); // use b2dpolygon drawing if possible - if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0 - && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) ) + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { ::basegfx::B2DPolygon aB2DPolyLine = rPoly.getB2DPolygon(); const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); aB2DPolyLine.transform( aTransform ); const ::basegfx::B2DVector aB2DLineWidth( 1.0, 1.0 ); + + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE)) + { + // #i98289# + aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine); + } + if( mpGraphics->DrawPolyLine( aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_ROUND, this ) ) return; } @@ -2591,8 +2598,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) ImplInitFillColor(); // use b2dpolygon drawing if possible - if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0 - && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) ) + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { ::basegfx::B2DPolyPolygon aB2DPolyPolygon( rPoly.getB2DPolygon() ); const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); @@ -2655,8 +2661,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) ImplInitFillColor(); // use b2dpolygon drawing if possible - if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0 - && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) ) + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { ::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPoly.getB2DPolyPolygon(); const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); @@ -2743,8 +2748,7 @@ void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly if( mbInitFillColor ) ImplInitFillColor(); - if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0 - && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) ) + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); ::basegfx::B2DPolyPolygon aB2DPP = rB2DPolyPoly; @@ -2804,23 +2808,29 @@ void OutputDevice::DrawPolyLine( if( mbInitLineColor ) ImplInitLineColor(); - if(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) + // #i98289# use b2dpolygon drawing if possible + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { -#ifdef UNX // b2dpolygon support not implemented yet on non-UNX platforms const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); - // transform the line width - ::basegfx::B2DVector aB2DLineWidth; - if( fLineWidth == 0.0 ) // hairline? - aB2DLineWidth = ::basegfx::B2DVector( 1.0, 1.0 ); - else + ::basegfx::B2DVector aB2DLineWidth(1.0, 1.0); + + // transform the line width if used + if( fLineWidth != 0.0 ) aB2DLineWidth = aTransform * ::basegfx::B2DVector( fLineWidth, fLineWidth ); + // transform the polygon ::basegfx::B2DPolygon aB2DPL = rB2DPolygon; aB2DPL.transform( aTransform ); + + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && (mnAntialiasing & ANTIALIASING_PIXELSNAPHAIRLINE)) + { + // #i98289# + aB2DPL = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPL); + } + // draw the polyline if( mpGraphics->DrawPolyLine( aB2DPL, aB2DLineWidth, eLineJoin, this ) ) return; -#endif } // fallback to old polygon drawing if needed diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index bfe0751545c7..521e56da207e 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -2972,17 +2972,24 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, } } + // check if the current font name token or its substitute is valid + ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName ); + if( pFoundData ) + return pFoundData; + // some systems provide special customization // e.g. they suggest "serif" as UI-font, but this name cannot be used directly // because the system wants to map it to another font first, e.g. "Helvetica" if( mpPreMatchHook ) + { if( mpPreMatchHook->FindFontSubstitute( rFSD ) ) + { ImplGetEnglishSearchFontName( aSearchName ); - - // check if the current font name token or its substitute is valid - ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName ); - if( pFoundData ) - return pFoundData; + pFoundData = ImplFindBySearchName( aSearchName ); + if( pFoundData ) + return pFoundData; + } + } // break after last font name token was checked unsuccessfully if( nTokenPos == STRING_NOTFOUND) @@ -5241,15 +5248,15 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, if ( xBI.is() ) { - static const com::sun::star::lang::Locale aDefLocale(Application::GetSettings().GetUILocale()); + const com::sun::star::lang::Locale& rDefLocale(Application::GetSettings().GetUILocale()); xub_StrLen nSoftBreak = GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos ); DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" ); //aHyphOptions.hyphenIndex = nSoftBreak; - i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, aDefLocale, nPos, aHyphOptions, aUserOptions ); + i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions ); nBreakPos = (xub_StrLen)aLBR.breakIndex; if ( nBreakPos <= nPos ) nBreakPos = nSoftBreak; - if ( nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION ) + if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) { // Egal ob Trenner oder nicht: Das Wort nach dem Trenner durch // die Silbentrennung jagen... @@ -5261,7 +5268,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { sal_Unicode cAlternateReplChar = 0; sal_Unicode cAlternateExtraChar = 0; - i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, aDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); + i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); // sal_uInt16 nWordStart = nBreakPos; // sal_uInt16 nBreakPos_OLD = nBreakPos; sal_uInt16 nWordStart = nPos; @@ -5277,7 +5284,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, sal_uInt16 nMinTrail = static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben uno::Reference< linguistic2::XHyphenatedWord > xHyphWord; if (xHyph.is()) - xHyphWord = xHyph->hyphenate( aWord, aDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() ); + xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() ); if (xHyphWord.is()) { sal_Bool bAlternate = xHyphWord->isAlternativeSpelling(); @@ -5344,7 +5351,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, } // if (xHyphWord.is()) } // if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) ) } // if ( xHyph.is() ) - } // if ( nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION ) + } // if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) } nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos ); } @@ -6384,10 +6391,12 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr, // check string index and length String aStr = rOrigStr; if( (ULONG)nMinIndex + nLen >= aStr.Len() ) + { if( nMinIndex < aStr.Len() ) nLen = aStr.Len() - nMinIndex; else return NULL; + } // filter out special markers if( bFilter ) @@ -6406,7 +6415,10 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr, sal_Int32* pAry = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen); if( nCutStart > nMinIndex ) memcpy( pAry, pDXArray, sizeof(sal_Int32)*(nCutStart-nMinIndex) ); - memcpy( pAry+nCutStart-nMinIndex, pDXArray + nOrgLen - (nCutStop-nMinIndex), nLen - (nCutStop-nMinIndex) ); + // note: nCutStart will never be smaller than nMinIndex + memcpy( pAry+nCutStart-nMinIndex, + pDXArray + nOrgLen - (nCutStop-nMinIndex), + sizeof(sal_Int32)*(nLen - (nCutStart-nMinIndex)) ); pDXArray = pAry; } } @@ -6519,6 +6531,11 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay for( int nFallbackLevel = 1; nFallbackLevel < MAX_FALLBACK; ++nFallbackLevel ) { // find a font family suited for glyph fallback +#ifndef FONTFALLBACK_HOOKS_DISABLED + // GetGlyphFallbackFont() needs a valid aFontSelData.mpFontEntry + // if the system-specific glyph fallback is active + aFontSelData.mpFontEntry = mpFontEntry; // reset the fontentry to base-level +#endif ImplFontEntry* pFallbackFont = mpFontCache->GetGlyphFallbackFont( mpFontList, aFontSelData, nFallbackLevel-nDevSpecificFallback, aMissingCodes ); if( !pFallbackFont ) @@ -6564,7 +6581,10 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay pMultiSalLayout->SetInComplete(); } else + { + // there is no need for a font that couldn't resolve anything pFallback->Release(); + } } mpFontCache->Release( pFallbackFont ); diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index d4c24ff44e20..cee4f475a577 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -166,7 +166,6 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, DBG_TRACE( "OutputDevice::DrawTransparent(B2D&,transparency)" ); DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); -fprintf(stderr,"OD::DT( fT=%f, bAA=%d)\n",fTransparency,mnAntialiasing);//############## // AW: Do NOT paint empty PolyPolygons if(!rB2DPolyPoly.count()) return; @@ -186,8 +185,7 @@ fprintf(stderr,"OD::DT( fT=%f, bAA=%d)\n",fTransparency,mnAntialiasing);//###### if( mbInitFillColor ) ImplInitFillColor(); - if( (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) != 0 - && mpGraphics->supportsOperation( OutDevSupport_B2DDraw ) ) + if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw)) { // b2dpolygon support not implemented yet on non-UNX platforms const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); @@ -408,10 +406,17 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, Rectangle aPixelRect( ImplLogicToDevicePixel( aLogicPolyRect ) ); if( !mbOutputClipped ) - bDrawn = mpGraphics->DrawAlphaRect( aPixelRect.Left(), aPixelRect.Top(), - aPixelRect.GetWidth(), aPixelRect.GetHeight(), - sal::static_int_cast<sal_uInt8>(nTransparencePercent), - this ); + { + bDrawn = mpGraphics->DrawAlphaRect( + aPixelRect.Left(), aPixelRect.Top(), + // #i98405# use methods with small g, else one pixel too much will be painted. + // This is because the source is a polygon which when painted would not paint + // the rightmost and lowest pixel line(s), so use one pixel less for the + // rectangle, too. + aPixelRect.getWidth(), aPixelRect.getHeight(), + sal::static_int_cast<sal_uInt8>(nTransparencePercent), + this ); + } else bDrawn = true; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 69f4674cae9c..0754f5c5b3dc 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6845,11 +6845,12 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric(); // collect the glyphs into a single array + const int nTmpMaxGlyphs = rLayout.GetOrientation() ? 1 : nMaxGlyphs; // #i97991# temporary workaround for #i87686# std::vector< PDFGlyph > aGlyphs; - aGlyphs.reserve( nMaxGlyphs ); + aGlyphs.reserve( nTmpMaxGlyphs ); // first get all the glyphs and register them; coordinates still in Pixel Point aGNGlyphPos; - while( (nGlyphs = rLayout.GetNextGlyphs( nMaxGlyphs, pGlyphs, aGNGlyphPos, nIndex, nAdvanceWidths, pCharPosAry )) != 0 ) + while( (nGlyphs = rLayout.GetNextGlyphs( nTmpMaxGlyphs, pGlyphs, aGNGlyphPos, nIndex, nAdvanceWidths, pCharPosAry )) != 0 ) { for( int i = 0; i < nGlyphs; i++ ) { @@ -8299,18 +8300,18 @@ void PDFWriterImpl::drawArc( const Rectangle& rRect, const Point& rStart, const return; // calculate start and stop angles - double fStartAngle = calcAngle( rRect, rStart ); + const double fStartAngle = calcAngle( rRect, rStart ); double fStopAngle = calcAngle( rRect, rStop ); while( fStopAngle < fStartAngle ) fStopAngle += 2.0*M_PI; - int nFragments = (int)((fStopAngle-fStartAngle)/(M_PI/2.0))+1; - double fFragmentDelta = (fStopAngle-fStartAngle)/(double)nFragments; - double kappa = fabs( 4.0 * (1.0-cos(fFragmentDelta/2.0))/sin(fFragmentDelta/2.0) / 3.0); - double halfWidth = (double)rRect.GetWidth()/2.0; - double halfHeight = (double)rRect.GetHeight()/2.0; + const int nFragments = (int)((fStopAngle-fStartAngle)/(M_PI/2.0))+1; + const double fFragmentDelta = (fStopAngle-fStartAngle)/(double)nFragments; + const double kappa = fabs( 4.0 * (1.0-cos(fFragmentDelta/2.0))/sin(fFragmentDelta/2.0) / 3.0); + const double halfWidth = (double)rRect.GetWidth()/2.0; + const double halfHeight = (double)rRect.GetHeight()/2.0; - Point aCenter( (rRect.Left()+rRect.Right()+1)/2, - (rRect.Top()+rRect.Bottom()+1)/2 ); + const Point aCenter( (rRect.Left()+rRect.Right()+1)/2, + (rRect.Top()+rRect.Bottom()+1)/2 ); OStringBuffer aLine( 30*nFragments ); Point aPoint( (int)(halfWidth * cos(fStartAngle) ), @@ -8318,27 +8319,30 @@ void PDFWriterImpl::drawArc( const Rectangle& rRect, const Point& rStart, const aPoint += aCenter; m_aPages.back().appendPoint( aPoint, aLine ); aLine.append( " m " ); - for( int i = 0; i < nFragments; i++ ) - { - double fStartFragment = fStartAngle + (double)i*fFragmentDelta; - double fStopFragment = fStartFragment + fFragmentDelta; - aPoint = Point( (int)(halfWidth * (cos(fStartFragment) - kappa*sin(fStartFragment) ) ), - -(int)(halfHeight * (sin(fStartFragment) + kappa*cos(fStartFragment) ) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( ' ' ); + if( !basegfx::fTools::equal(fStartAngle, fStopAngle) ) + { + for( int i = 0; i < nFragments; i++ ) + { + const double fStartFragment = fStartAngle + (double)i*fFragmentDelta; + const double fStopFragment = fStartFragment + fFragmentDelta; + aPoint = Point( (int)(halfWidth * (cos(fStartFragment) - kappa*sin(fStartFragment) ) ), + -(int)(halfHeight * (sin(fStartFragment) + kappa*cos(fStartFragment) ) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( ' ' ); - aPoint = Point( (int)(halfWidth * (cos(fStopFragment) + kappa*sin(fStopFragment) ) ), - -(int)(halfHeight * (sin(fStopFragment) - kappa*cos(fStopFragment) ) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( ' ' ); + aPoint = Point( (int)(halfWidth * (cos(fStopFragment) + kappa*sin(fStopFragment) ) ), + -(int)(halfHeight * (sin(fStopFragment) - kappa*cos(fStopFragment) ) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( ' ' ); - aPoint = Point( (int)(halfWidth * cos(fStopFragment) ), - -(int)(halfHeight * sin(fStopFragment) ) ); - aPoint += aCenter; - m_aPages.back().appendPoint( aPoint, aLine ); - aLine.append( " c\n" ); + aPoint = Point( (int)(halfWidth * cos(fStopFragment) ), + -(int)(halfHeight * sin(fStopFragment) ) ); + aPoint += aCenter; + m_aPages.back().appendPoint( aPoint, aLine ); + aLine.append( " c\n" ); + } } if( bWithChord || bWithPie ) { diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 45f6a5c7d0c2..e8a1f5b32213 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -674,11 +674,11 @@ Printer::~Printer() } // ----------------------------------------------------------------------- -void Printer::SetNextJobIsQuick() +void Printer::SetNextJobIsQuick( bool bQuick ) { - mpPrinterData->mbNextJobIsQuick = true; + mpPrinterData->mbNextJobIsQuick = bQuick; if( mpQPrinter ) - mpQPrinter->SetNextJobIsQuick(); + mpQPrinter->SetNextJobIsQuick( bQuick ); } // ----------------------------------------------------------------------- diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx index 64ff7c46597c..938a30351f9a 100644 --- a/vcl/source/gdi/regband.cxx +++ b/vcl/source/gdi/regband.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: regband.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.158.1 $ * * This file is part of OpenOffice.org. * @@ -71,7 +71,9 @@ ImplRegionBand::ImplRegionBand( long nTop, long nBottom ) // ----------------------------------------------------------------------- -ImplRegionBand::ImplRegionBand( const ImplRegionBand& rRegionBand ) +ImplRegionBand::ImplRegionBand( + const ImplRegionBand& rRegionBand, + const bool bIgnorePoints) { // copy boundaries mnYTop = rRegionBand.mnYTop; @@ -104,6 +106,29 @@ ImplRegionBand::ImplRegionBand( const ImplRegionBand& rRegionBand ) pPrevSep = pNewSep; pSep = pSep->mpNextSep; } + + if ( ! bIgnorePoints) + { + // Copy points. + ImplRegionBandPoint* pPoint = mpFirstBandPoint; + ImplRegionBandPoint* pPrevPointCopy = NULL; + while (pPoint != NULL) + { + ImplRegionBandPoint* pPointCopy = new ImplRegionBandPoint(); + pPointCopy->mnX = pPoint->mnX; + pPointCopy->mnLineId = pPoint->mnLineId; + pPointCopy->mbEndPoint = pPoint->mbEndPoint; + pPointCopy->meLineType = pPoint->meLineType; + + if (pPrevPointCopy != NULL) + pPrevPointCopy->mpNextBandPoint = pPointCopy; + else + mpFirstBandPoint = pPointCopy; + + pPrevPointCopy = pPointCopy; + pPoint = pPoint->mpNextBandPoint; + } + } } // ----------------------------------------------------------------------- @@ -920,3 +945,28 @@ BOOL ImplRegionBand::operator==( const ImplRegionBand& rRegionBand ) const return TRUE; } + +// ----------------------------------------------------------------------- + +ImplRegionBand* ImplRegionBand::SplitBand (const sal_Int32 nY) +{ + OSL_ASSERT(nY>mnYTop); + OSL_ASSERT(nY<=mnYBottom); + + // Create a copy of the given band (we tell the constructor to copy the points together + // with the seps.) + ImplRegionBand* pLowerBand = new ImplRegionBand(*this, false); + + // Adapt vertical coordinates. + mnYBottom = nY-1; + pLowerBand->mnYTop = nY; + + // Insert new band into list of bands. + pLowerBand->mpNextBand = mpNextBand; + mpNextBand = pLowerBand; + pLowerBand->mpPrevBand = this; + if (pLowerBand->mpNextBand != NULL) + pLowerBand->mpNextBand->mpPrevBand = pLowerBand; + + return pLowerBand; +} diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index fd14b5224206..b98712419cf1 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: region.cxx,v $ - * $Revision: 1.18 $ + * $Revision: 1.18.36.1 $ * * This file is part of OpenOffice.org. * @@ -77,6 +77,247 @@ DBG_NAME( Region ) DBG_NAMEEX( Polygon ) DBG_NAMEEX( PolyPolygon ) +namespace { + +/** Return <TRUE/> when the given polygon is rectiliner and oriented so that + all sides are either horizontal or vertical. +*/ +bool ImplIsPolygonRectilinear (const PolyPolygon& rPolyPoly) +{ + // Iterate over all polygons. + const USHORT nPolyCount = rPolyPoly.Count(); + for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly) + { + const Polygon& aPoly = rPolyPoly.GetObject(nPoly); + + // Iterate over all edges of the current polygon. + const USHORT nSize = aPoly.GetSize(); + + if (nSize < 2) + continue; + Point aPoint (aPoly.GetPoint(0)); + const Point aLastPoint (aPoint); + for (USHORT nPoint = 1; nPoint < nSize; ++nPoint) + { + const Point aNextPoint (aPoly.GetPoint(nPoint)); + // When there is at least one edge that is neither vertical nor + // horizontal then the entire polygon is not rectilinear (and + // oriented along primary axes.) + if (aPoint.X() != aNextPoint.X() && aPoint.Y() != aNextPoint.Y()) + return false; + + aPoint = aNextPoint; + } + // Compare closing edge. + if (aLastPoint.X() != aPoint.X() && aLastPoint.Y() != aPoint.Y()) + return false; + } + return true; +} + + + +/** This function is similar to the ImplRegion::InsertBands() method. + It creates a minimal set of missing bands so that the entire vertical + interval from nTop to nBottom is covered by bands. +*/ +void ImplAddMissingBands ( + ImplRegion* pImplRegion, + const long nTop, + const long nBottom) +{ + // Iterate over already existing bands and add missing bands atop the + // first and between two bands. + ImplRegionBand* pPreviousBand = NULL; + ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand(); + long nCurrentTop (nTop); + while (pBand != NULL && nCurrentTop<nBottom) + { + if (nCurrentTop < pBand->mnYTop) + { + // Create new band above the current band. + ImplRegionBand* pAboveBand = new ImplRegionBand( + nCurrentTop, + ::std::min(nBottom,pBand->mnYTop-1)); + pImplRegion->InsertBand(pPreviousBand, pAboveBand); + } + + // Adapt the top of the interval to prevent overlapping bands. + nCurrentTop = ::std::max(nTop, pBand->mnYBottom+1); + + // Advance to next band. + pPreviousBand = pBand; + pBand = pBand->mpNextBand; + } + + // We still have to cover two cases: + // 1. The region does not yet contain any bands. + // 2. The intervall nTop->nBottom extends past the bottom most band. + if (nCurrentTop < nBottom && (pBand==NULL || nBottom>pBand->mnYBottom)) + { + // When there is no previous band then the new one will be the + // first. Otherwise the new band is inserted behind the last band. + pImplRegion->InsertBand( + pPreviousBand, + new ImplRegionBand( + nCurrentTop, + nBottom)); + } +} + + + +/** Convert a rectilinear polygon (that is oriented along the primary axes) + to a list of bands. For this special form of polygon we can use an + optimization that prevents the creation of one band per y value. + However, it still is possible that some temporary bands are created that + later can be optimized away. + @param rPolyPolygon + A set of zero, one, or more polygons, nested or not, that are + converted into a list of bands. + @return + A new ImplRegion object is returned that contains the bands that + represent the given poly-polygon. +*/ +ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly) +{ + OSL_ASSERT(ImplIsPolygonRectilinear (rPolyPoly)); + + // Create a new ImplRegion object as container of the bands. + ImplRegion* pImplRegion = new ImplRegion(); + long nLineId = 0L; + + // Iterate over all polygons. + const USHORT nPolyCount = rPolyPoly.Count(); + for (USHORT nPoly = 0; nPoly < nPolyCount; ++nPoly) + { + const Polygon& aPoly = rPolyPoly.GetObject(nPoly); + + // Iterate over all edges of the current polygon. + const USHORT nSize = aPoly.GetSize(); + if (nSize < 2) + continue; + // Avoid fetching every point twice (each point is the start point + // of one and the end point of another edge.) + Point aStart (aPoly.GetPoint(0)); + Point aEnd; + for (USHORT nPoint = 1; nPoint <= nSize; ++nPoint, aStart=aEnd) + { + // We take the implicit closing edge into account by mapping + // index nSize to 0. + aEnd = aPoly.GetPoint(nPoint%nSize); + if (aStart.Y() == aEnd.Y()) + { + // Horizontal lines are ignored. + continue; + } + + // At this point the line has to be vertical. + OSL_ASSERT(aStart.X() == aEnd.X()); + + // Sort y-coordinates to simplify the algorithm and store the + // direction seperately. The direction is calculated as it is + // in other places (but seems to be the wrong way.) + const long nTop (::std::min(aStart.Y(), aEnd.Y())); + const long nBottom (::std::max(aStart.Y(), aEnd.Y())); + const LineType eLineType (aStart.Y() > aEnd.Y() ? LINE_DESCENDING : LINE_ASCENDING); + + // Make sure that the current line is covered by bands. + ImplAddMissingBands(pImplRegion, nTop,nBottom); + + // Find top-most band that may contain nTop. + ImplRegionBand* pBand = pImplRegion->ImplGetFirstRegionBand(); + while (pBand!=NULL && pBand->mnYBottom < nTop) + pBand = pBand->mpNextBand; + ImplRegionBand* pTopBand = pBand; + // If necessary split the band at nTop so that nTop is contained + // in the lower band. + if ( // Prevent the current band from becoming 0 pixel high + pBand->mnYTop<nTop + // this allows the lowest pixel of the band to be split off + && pBand->mnYBottom>=nTop + // do not split a band that is just one pixel high + && pBand->mnYTop<pBand->mnYBottom) + { + // Split the top band. + pTopBand = pBand->SplitBand(nTop); + } + + // Advance to band that may contain nBottom. + while (pBand!=NULL && pBand->mnYBottom < nBottom) + pBand = pBand->mpNextBand; + // The lowest band may have to be split at nBottom so that + // nBottom itself remains in the upper band. + if ( // allow the current band becoming 1 pixel high + pBand->mnYTop<=nBottom + // prevent splitting off a band that is 0 pixel high + && pBand->mnYBottom>nBottom + // do not split a band that is just one pixel high + && pBand->mnYTop<pBand->mnYBottom) + { + // Split the bottom band. + pBand->SplitBand(nBottom+1); + } + + // Note that we remember the top band (in pTopBand) but not the + // bottom band. The later can be determined by comparing y + // coordinates. + + // Add the x-value as point to all bands in the nTop->nBottom range. + for (pBand=pTopBand; pBand!=NULL&&pBand->mnYTop<=nBottom; pBand=pBand->mpNextBand) + pBand->InsertPoint(aStart.X(), nLineId++, TRUE, eLineType); + } + } + + return pImplRegion; +} + + + + +/** Convert a general polygon (one for which ImplIsPolygonRectilinear() + returns <FALSE/>) to bands. +*/ +ImplRegion* ImplGeneralPolygonToBands ( + const PolyPolygon& rPolyPoly, + const Rectangle& rPolygonBoundingBox) +{ + long nLineID = 0L; + + // initialisation and creation of Bands + ImplRegion* pImplRegion = new ImplRegion(); + pImplRegion->CreateBandRange( rPolygonBoundingBox.Top(), rPolygonBoundingBox.Bottom() ); + + // insert polygons + const USHORT nPolyCount = rPolyPoly.Count(); + for ( USHORT nPoly = 0; nPoly < nPolyCount; nPoly++ ) + { + // get reference to current polygon + const Polygon& aPoly = rPolyPoly.GetObject( nPoly ); + const USHORT nSize = aPoly.GetSize(); + + // not enough points ( <= 2 )? -> nothing to do! + if ( nSize <= 2 ) + continue; + + // band the polygon + for ( USHORT nPoint = 1; nPoint < nSize; nPoint++ ) + pImplRegion->InsertLine( aPoly.GetPoint(nPoint-1), aPoly.GetPoint(nPoint), nLineID++ ); + + // close polygon with line from first point to last point, if neccesary + const Point rLastPoint = aPoly.GetPoint(nSize-1); + const Point rFirstPoint = aPoly.GetPoint(0); + if ( rLastPoint != rFirstPoint ) + pImplRegion->InsertLine( rLastPoint, rFirstPoint, nLineID++ ); + } + + return pImplRegion; +} + + +} // end of anonymous namespace + + // ----------------------------------------------------------------------- #ifdef DBG_UTIL @@ -140,6 +381,35 @@ const char* ImplDbgTestRegion( const void* pObj ) return NULL; } + +void TraceBands (const ImplRegionBand* pFirstBand) +{ + int nBandIndex (0); + const ImplRegionBand* pBand = pFirstBand; + while (pBand != NULL) + { + OSL_TRACE(" band %d %d->%d : ", nBandIndex++, + pBand->mnYTop, pBand->mnYBottom); + + ImplRegionBandPoint* pPoint = pBand->mpFirstBandPoint; + while (pPoint != NULL) + { + OSL_TRACE(" %d ", pPoint->mnX); + pPoint = pPoint->mpNextBandPoint; + } + OSL_TRACE(" | "); + + ImplRegionBandSep* pSep = pBand->mpFirstSep; + while (pSep != NULL) + { + OSL_TRACE(" %d->%d ", pSep->mnXLeft, pSep->mnXRight); + pSep = pSep->mpNextSep; + } + OSL_TRACE("\n"); + + pBand = pBand->mpNextBand; + } +} #endif // ======================================================================= @@ -577,6 +847,29 @@ BOOL ImplRegion::InsertSingleBand( ImplRegionBand* pBand, // ------------------------------------------------------------------------ +void ImplRegion::InsertBand (ImplRegionBand* pPreviousBand, ImplRegionBand* pBandToInsert) +{ + OSL_ASSERT(pBandToInsert!=NULL); + + if (pPreviousBand == NULL) + { + // Insert band before all others. + if (mpFirstBand != NULL) + mpFirstBand->mpPrevBand = pBandToInsert; + pBandToInsert->mpNextBand = mpFirstBand; + mpFirstBand = pBandToInsert; + } + else + { + // Insert band directly after pPreviousBand. + pBandToInsert->mpNextBand = pPreviousBand->mpNextBand; + pPreviousBand->mpNextBand = pBandToInsert; + pBandToInsert->mpPrevBand = pPreviousBand; + } +} + +// ------------------------------------------------------------------------ + void ImplRegion::Union( long nLeft, long nTop, long nRight, long nBottom ) { DBG_ASSERT( nLeft <= nRight, "ImplRegion::Union() - nLeft > nRight" ); @@ -918,8 +1211,12 @@ void Region::ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly ) if ( !aRect.IsEmpty() ) { // width OR height == 1 ? => Rectangular region - if ( (aRect.GetWidth() == 1) || (aRect.GetHeight() == 1) ) + if ( (aRect.GetWidth() == 1) + || (aRect.GetHeight() == 1) + || rPolyPoly.IsRect() ) + { ImplCreateRectRegion( aRect ); + } else mpImplRegion = new ImplRegion( rPolyPoly ); } @@ -944,43 +1241,24 @@ void Region::ImplPolyPolyRegionToBandRegionFunc() else delete mpImplRegion; - const USHORT nPolyCount = aPolyPoly.Count(); - if ( nPolyCount ) + if ( aPolyPoly.Count() ) { // polypolygon empty? -> empty region const Rectangle aRect( aPolyPoly.GetBoundRect() ); if ( !aRect.IsEmpty() ) { - long nLineID = 0L; - - // initialisation and creation of Bands - mpImplRegion = new ImplRegion(); - mpImplRegion->CreateBandRange( aRect.Top(), aRect.Bottom() ); - - // insert polygons - for ( USHORT nPoly = 0; nPoly < nPolyCount; nPoly++ ) + if (ImplIsPolygonRectilinear(aPolyPoly)) + { + // For rectilinear polygons there is an optimized band conversion. + mpImplRegion = ImplRectilinearPolygonToBands(aPolyPoly); + } + else { - // get reference to current polygon - const Polygon& aPoly = aPolyPoly.GetObject( nPoly ); - const USHORT nSize = aPoly.GetSize(); - - // not enough points ( <= 2 )? -> nothing to do! - if ( nSize <= 2 ) - continue; - - // band the polygon - for ( USHORT nPoint = 1; nPoint < nSize; nPoint++ ) - mpImplRegion->InsertLine( aPoly.GetPoint(nPoint-1), aPoly.GetPoint(nPoint), nLineID++ ); - - // close polygon with line from first point to last point, if neccesary - const Point rLastPoint = aPoly.GetPoint(nSize-1); - const Point rFirstPoint = aPoly.GetPoint(0); - if ( rLastPoint != rFirstPoint ) - mpImplRegion->InsertLine( rLastPoint, rFirstPoint, nLineID++ ); + mpImplRegion = ImplGeneralPolygonToBands(aPolyPoly, aRect); } - // process bands with lines + // Convert points into seps. ImplRegionBand* pRegionBand = mpImplRegion->mpFirstBand; while ( pRegionBand ) { @@ -989,7 +1267,8 @@ void Region::ImplPolyPolyRegionToBandRegionFunc() pRegionBand = pRegionBand->mpNextBand; } - // cleanup + // Optimize list of bands. Adjacent bands with identical lists + // of seps are joined. if ( !mpImplRegion->OptimizeBandList() ) { delete mpImplRegion; diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 509ad4f725ce..1e9572887e0b 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -574,7 +574,7 @@ void SalGraphics::CopyBits( const SalTwoRect* pPosAry, (pSrcGraphics && ( (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) ) { SalTwoRect pPosAry2 = *pPosAry; - if( pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) + if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) mirror( pPosAry2.mnSrcX, pPosAry2.mnSrcWidth, pSrcOutDev ); if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) ) mirror( pPosAry2.mnDestX, pPosAry2.mnDestWidth, pOutDev ); diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 6b695b8a22f6..0358b25ca153 100755 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -65,6 +65,43 @@ // ======================================================================= +// TODO: ask the glyph directly, for now we need this method because of #i99367# +// true if a codepoint doesn't influence the logical text width +bool IsDiacritic( sal_UCS4 nChar ) +{ + // shortcut abvious non-diacritics + if( nChar < 0x0300 ) + return false; + if( nChar >= 0x2100 ) + return false; + + struct DiaRange { sal_UCS4 mnMin, mnEnd;}; + static const DiaRange aRanges[] = { + {0x0300, 0x0370}, + {0x0590, 0x05C0}, {0x05C1, 0x05C3}, {0x05C3, 0x05C6}, {0x05C7, 0x05C8}, + {0x0610, 0x061B}, {0x064B, 0x0660}, {0x0670, 0x0671}, {0x06D6, 0x06DC}, {0x06DF, 0x06EE}, + {0x0730, 0x074D}, {0x07A6, 0x07B1}, {0x07EB, 0x07F4}, +#if 0 // all known fonts have zero-width diacritics already, so no need to query it + {0x0900, 0x0904}, {0x093C, 0x093D}, {0x0941, 0x0948}, {0x094D, 0x0950}, {0x0951, 0x0958}, + {0x0980, 0x0985}, {0x09BC, 0x09BD}, {0x09C1, 0x09C7}, {0x09CD, 0x09CE}, {0x09E2, 0x09E6}, + {0x0A00, 0x0A05}, {0x0A3C, 0x0A59}, //... +#endif + {0x1DC0, 0x1E00}, + {0x205F, 0x2070}, {0x20D0, 0x2100} + }; + + // TODO: almost anything is faster than an O(n) search + static const int nCount = sizeof(aRanges) / sizeof(*aRanges); + const DiaRange* pRange = &aRanges[0]; + for( int i = nCount; --i >= 0; ++pRange ) + if( (pRange->mnMin <= nChar) && (nChar < pRange->mnEnd) ) + return true; + + return false; +} + +// ======================================================================= + int GetVerticalFlags( sal_UCS4 nChar ) { if( (nChar >= 0x1100 && nChar <= 0x11f9) // Hangul Jamo @@ -254,6 +291,7 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) case LANGUAGE_ARABIC_SAUDI_ARABIA & LANGUAGE_MASK_PRIMARY: nOffset = 0x0660 - '0'; // arabic-indic digits break; + case LANGUAGE_FARSI & LANGUAGE_MASK_PRIMARY: case LANGUAGE_URDU & LANGUAGE_MASK_PRIMARY: case LANGUAGE_PUNJABI & LANGUAGE_MASK_PRIMARY: //??? case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY: @@ -548,7 +586,7 @@ ImplLayoutArgs::ImplLayoutArgs( const xub_Unicode* pStr, int nLen, UBiDiLevel nLevel = UBIDI_DEFAULT_LTR; if( mnFlags & SAL_LAYOUT_BIDI_RTL ) - nLevel = UBIDI_RTL; + nLevel = UBIDI_DEFAULT_RTL; // prepare substring for BiDi analysis // TODO: reuse allocated pParaBidi @@ -567,20 +605,16 @@ ImplLayoutArgs::ImplLayoutArgs( const xub_Unicode* pStr, int nLen, } // run BiDi algorithm - int nRunCount = ubidi_countRuns( pLineBidi, &rcI18n); + const int nRunCount = ubidi_countRuns( pLineBidi, &rcI18n ); //maRuns.resize( 2 * nRunCount ); - // TODO: see comment about #110273# below, remove when external issue fixed - const UBiDiLevel* pParaLevels = ubidi_getLevels( pParaBidi, &rcI18n); for( int i = 0; i < nRunCount; ++i ) { int32_t nMinPos, nLength; - ubidi_getVisualRun( pLineBidi, i, &nMinPos, &nLength ); - int nPos0 = nMinPos + mnMinCharPos; - int nPos1 = nPos0 + nLength; + const UBiDiDirection nDir = ubidi_getVisualRun( pLineBidi, i, &nMinPos, &nLength ); + const int nPos0 = nMinPos + mnMinCharPos; + const int nPos1 = nPos0 + nLength; - // bool bRTL = (nDir == UBIDI_RTL); - // workaround for #110273# (probably ICU problem TODO: analyze there) - bool bRTL = ((pParaLevels[ nPos0 ] & 1) != 0); + const bool bRTL = (nDir == UBIDI_RTL); AddRun( nPos0, nPos1, bRTL ); } @@ -953,8 +987,8 @@ bool GenericSalLayout::GetCharWidths( sal_Int32* pCharWidths ) const pCharWidths[n] = 0; // determine cluster extents - const GlyphItem* pG = mpGlyphItems; - for( int i = mnGlyphCount; --i >= 0; ++pG ) + const GlyphItem* const pEnd = mpGlyphItems + mnGlyphCount; + for( const GlyphItem* pG = mpGlyphItems; pG < pEnd; ++pG ) { // use cluster start to get char index if( !pG->IsClusterStart() ) @@ -974,11 +1008,13 @@ bool GenericSalLayout::GetCharWidths( sal_Int32* pCharWidths ) const // calculate right x-position for this glyph cluster // break if no more glyphs in layout // break at next glyph cluster start - for(; (i > 0) && !pG[1].IsClusterStart(); --i ) + while( (pG+1 < pEnd) && !pG[1].IsClusterStart() ) { // advance to next glyph in cluster ++pG; + if( pG->IsDiacritic() ) + continue; // ignore diacritics // get leftmost x-extent of this glyph long nXPos = pG->maLinearPos.X(); if( nXPosMin > nXPos ) @@ -992,8 +1028,19 @@ bool GenericSalLayout::GetCharWidths( sal_Int32* pCharWidths ) const // when the current cluster overlaps with the next one assume // rightmost cluster edge is the leftmost edge of next cluster - if( (i > 0) && (nXPosMax > pG[1].maLinearPos.X()) ) - nXPosMax = pG[1].maLinearPos.X(); + // for clusters that do not have x-sorted glyphs + // TODO: avoid recalculation of left bound in next cluster iteration + for( const GlyphItem* pN = pG; ++pN < pEnd; ) + { + if( pN->IsClusterStart() ) + break; + if( pN->IsDiacritic() ) + continue; // ignore diacritics + if( nXPosMax > pN->maLinearPos.X() ) + nXPosMax = pN->maLinearPos.X(); + } + if( nXPosMax < nXPosMin ) + nXPosMin = nXPosMax = 0; // character width is sum of glyph cluster widths pCharWidths[n] += nXPosMax - nXPosMin; @@ -1067,7 +1114,7 @@ void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) return; // determine cluster boundaries and x base offset - int nCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos; + const int nCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos; int* pLogCluster = (int*)alloca( nCharCount * sizeof(int) ); int i, n; long nBasePointX = -1; @@ -1086,6 +1133,20 @@ void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) if( nBasePointX < 0 ) nBasePointX = pG->maLinearPos.X(); } + // retarget unresolved pLogCluster[n] to a glyph inside the cluster + // TODO: better do it while the deleted-glyph markers are still there + for( n = 0; n < nCharCount; ++n ) + if( (i = pLogCluster[0]) >= 0 ) + break; + if( n >= nCharCount ) + return; + for( n = 0; n < nCharCount; ++n ) + { + if( pLogCluster[ n ] < 0 ) + pLogCluster[ n ] = i; + else + i = pLogCluster[ n ]; + } // calculate adjusted cluster widths sal_Int32* pNewGlyphWidths = (sal_Int32*)alloca( mnGlyphCount * sizeof(long) ); @@ -1096,15 +1157,11 @@ void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) for( int nCharPos = i = -1; rArgs.GetNextPos( &nCharPos, &bRTL ); ) { n = nCharPos - rArgs.mnMinCharPos; - if( pLogCluster[ n ] >= 0 ) - i = pLogCluster[ n ]; - if( i >= 0 ) - { - long nDelta = rArgs.mpDXArray[ n ] ; - if( n > 0 ) - nDelta -= rArgs.mpDXArray[ n-1 ]; - pNewGlyphWidths[ i ] += nDelta * mnUnitsPerPixel; - } + i = pLogCluster[ n ]; + long nDelta = rArgs.mpDXArray[ n ] ; + if( n > 0 ) + nDelta -= rArgs.mpDXArray[ n-1 ]; + pNewGlyphWidths[ i ] += nDelta * mnUnitsPerPixel; } // move cluster positions using the adjusted widths @@ -1123,22 +1180,22 @@ void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) { if( pClusterG->IsClusterStart() ) break; - nOldClusterWidth += pClusterG->mnNewWidth; + if( !pClusterG->IsDiacritic() ) // #i99367# ignore diacritics + nOldClusterWidth += pClusterG->mnNewWidth; nNewClusterWidth += pNewGlyphWidths[j]; } - int nDiff = nNewClusterWidth - nOldClusterWidth; + const int nDiff = nNewClusterWidth - nOldClusterWidth; // adjust cluster glyph widths and positions nDelta = nBasePointX + (nNewPos - pG->maLinearPos.X()); - if( !pG->IsRTLGlyph() - || (rArgs.mnFlags & SAL_LAYOUT_KASHIDA_JUSTIFICATON) ) + if( !pG->IsRTLGlyph() ) { - // for (LTR || KASHIDA) case extend rightmost glyph in cluster + // for LTR case extend rightmost glyph in cluster pClusterG[-1].mnNewWidth += nDiff; } else { - // right align cluster in new space for (RTL && !KASHIDA) case + // right align cluster in new space for RTL case pG->mnNewWidth += nDiff; nDelta += nDiff; } @@ -1168,15 +1225,15 @@ void GenericSalLayout::Justify( long nNewWidth ) int nMaxGlyphWidth = 0; for( pG = mpGlyphItems; pG < pGRight; ++pG ) { - if( pG->mnOrigWidth > 0 ) + if( !pG->IsDiacritic() ) ++nStretchable; - if( nMaxGlyphWidth < pG->mnOrigWidth) - nMaxGlyphWidth = pG->mnOrigWidth; + if( nMaxGlyphWidth < pG->mnOrigWidth ) + nMaxGlyphWidth = pG->mnOrigWidth; } // move rightmost glyph to requested position nOldWidth -= pGRight->mnOrigWidth; - if( nOldWidth <= 0) + if( nOldWidth <= 0 ) return; if( nNewWidth < nMaxGlyphWidth) nNewWidth = nMaxGlyphWidth; @@ -1195,7 +1252,7 @@ void GenericSalLayout::Justify( long nNewWidth ) pG->maLinearPos.X() += nDeltaSum; // do not stretch non-stretchable glyphs - if( (pG->mnOrigWidth <= 0) || (nStretchable <= 0) ) + if( pG->IsDiacritic() || (nStretchable <= 0) ) continue; // distribute extra space equally to stretchable glyphs @@ -1279,13 +1336,18 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) int nKashidaCount = 0, i; for( i = 0; i < mnGlyphCount; ++i, ++pG1 ) { + // only inject kashidas in RTL contexts if( !pG1->IsRTLGlyph() ) continue; + // no kashida-injection for blank justified expansion either + if( IsSpacingGlyph( pG1->mnGlyphIndex ) ) + continue; - int nDelta = pG1->mnNewWidth - pG1->mnOrigWidth; + // calculate gap, ignore if too small + const int nGapWidth = pG1->mnNewWidth - pG1->mnOrigWidth; // worst case is one kashida even for mini-gaps - if( nDelta > 0 ) - nKashidaCount += 1 + (nDelta / nKashidaWidth); + if( 3 * nGapWidth >= nKashidaWidth ) + nKashidaCount += 1 + (nGapWidth / nKashidaWidth); } if( !nKashidaCount ) @@ -1302,19 +1364,23 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) // default action is to copy array element *pG2 = *pG1; - // only apply kashida in a RTL context + // only inject kashida in RTL contexts if( !pG1->IsRTLGlyph() ) continue; + // no kashida-injection for blank justified expansion either + if( IsSpacingGlyph( pG1->mnGlyphIndex ) ) + continue; // calculate gap, skip if too small - int nDelta = pG1->mnNewWidth - pG1->mnOrigWidth; - if( 3*nDelta < nKashidaWidth ) + int nGapWidth = pG1->mnNewWidth - pG1->mnOrigWidth; + if( 3*nGapWidth < nKashidaWidth ) continue; // fill gap with kashidas nKashidaCount = 0; Point aPos = pG1->maLinearPos; - for(; nDelta > 0; nDelta -= nKashidaWidth, ++nKashidaCount ) + aPos.X() -= nGapWidth; // cluster is already right aligned + for(; nGapWidth > 0; nGapWidth -= nKashidaWidth, ++nKashidaCount ) { *(pG2++) = GlyphItem( pG1->mnCharPos, nKashidaIndex, aPos, GlyphItem::IS_IN_CLUSTER|GlyphItem::IS_RTL_GLYPH, nKashidaWidth ); @@ -1322,21 +1388,21 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) } // fixup rightmost kashida for gap remainder - if( nDelta < 0 ) + if( nGapWidth < 0 ) { - aPos.X() += nDelta; + aPos.X() += nGapWidth; if( nKashidaCount <= 1 ) - nDelta /= 2; // for small gap move kashida to middle - pG2[-1].mnNewWidth += nDelta; // adjust kashida width to gap width - pG2[-1].maLinearPos.X() += nDelta; + nGapWidth /= 2; // for small gap move kashida to middle + pG2[-1].mnNewWidth += nGapWidth; // adjust kashida width to gap width + pG2[-1].maLinearPos.X() += nGapWidth; } - // when kashidas were used move the original glyph + // when kashidas were inserted move the original cluster // to the right and shrink it to it's original width *pG2 = *pG1; pG2->maLinearPos.X() = aPos.X(); pG2->mnNewWidth = pG2->mnOrigWidth; - } + } // use the new glyph array DBG_ASSERT( mnGlyphCapacity >= pG2-pNewGlyphItems, "KashidaJustify overflow" ); @@ -1487,8 +1553,16 @@ void GenericSalLayout::MoveGlyph( int nStart, long nNewXPos ) { if( nStart >= mnGlyphCount ) return; + GlyphItem* pG = mpGlyphItems + nStart; + // the nNewXPos argument determines the new cell position + // as RTL-glyphs are right justified in their cell + // the cell position needs to be adjusted to the glyph position + if( pG->IsRTLGlyph() ) + nNewXPos += pG->mnNewWidth - pG->mnOrigWidth; + // calculate the x-offset to the old position long nXDelta = nNewXPos - pG->maLinearPos.X(); + // adjust all following glyph positions if needed if( nXDelta != 0 ) { GlyphItem* const pGEnd = mpGlyphItems + mnGlyphCount; @@ -1534,27 +1608,37 @@ void GenericSalLayout::Simplify( bool bIsBase ) // make sure GlyphItems are sorted left to right void GenericSalLayout::SortGlyphItems() { + // move cluster components behind their cluster start (especially for RTL) // using insertion sort because the glyph items are "almost sorted" - GlyphItem* pGL = mpGlyphItems; - const GlyphItem* pGEnd = mpGlyphItems + mnGlyphCount; - for( GlyphItem* pGR = pGL; ++pGR < pGEnd; pGL = pGR ) + const GlyphItem* const pGEnd = mpGlyphItems + mnGlyphCount; + for( GlyphItem* pG = mpGlyphItems; pG < pGEnd; ++pG ) { - // nothing to do when already in correct order - int nXPos = pGR->maLinearPos.X(); - if( pGL->maLinearPos.X() <= nXPos ) + // find a cluster starting with a diacritic + if( !pG->IsDiacritic() ) continue; - - // keep data of misplaced item - GlyphItem aGI = *pGR; - // make room for misplaced item - do { - pGL[1] = pGL[0]; - pGL[1].mnFlags |= GlyphItem::IS_IN_CLUSTER; - } while( (--pGL >= mpGlyphItems) && (nXPos < pGL->maLinearPos.X()) ); - // move misplaced item to proper slot - pGL[1] = aGI; - // TODO: fix glyph cluster start flags - pGL[1].mnFlags &= ~GlyphItem::IS_IN_CLUSTER; + if( !pG->IsClusterStart() ) + continue; + for( GlyphItem* pBaseGlyph = pG; ++pBaseGlyph < pGEnd; ) + { + // find the base glyph matching to the misplaced diacritic + if( pBaseGlyph->IsClusterStart() ) + break; + if( pBaseGlyph->IsDiacritic() ) + continue; + + // found the matching base glyph + // => this base glyph becomes the new cluster start + const GlyphItem aDiacritic = *pG; + *pG = *pBaseGlyph; + *pBaseGlyph = aDiacritic; + + // update glyph flags of swapped glyphitems + pG->mnFlags &= ~GlyphItem::IS_IN_CLUSTER; + pBaseGlyph->mnFlags |= GlyphItem::IS_IN_CLUSTER; + // prepare for checking next cluster + pG = pBaseGlyph; + break; + } } } @@ -1871,7 +1955,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) // the measured width is still in fallback font units // => convert it to base level font units if( n > 0 ) // optimization: because (fUnitMul==1.0) for (n==0) - nRunAdvance = static_cast<long>(nRunAdvance*fUnitMul + 0.5); + nRunAdvance = static_cast<long>(nRunAdvance*fUnitMul + 0.5); } // calculate new x position (in base level units) @@ -1914,11 +1998,12 @@ void MultiSalLayout::DrawText( SalGraphics& rGraphics ) const for( int i = mnLevel; --i >= 0; ) { SalLayout& rLayout = *mpLayouts[ i ]; - rLayout.DrawBase() = maDrawBase; + rLayout.DrawBase() += maDrawBase; rLayout.DrawOffset() += maDrawOffset; rLayout.InitFont(); rLayout.DrawText( rGraphics ); rLayout.DrawOffset() -= maDrawOffset; + rLayout.DrawBase() -= maDrawBase; } // NOTE: now the baselevel font is active again } diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 6bc5bb5b44c9..d149ee26284f 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -36,20 +36,20 @@ #undef CreateFont #endif -#include <gcach_ftyp.hxx> +#include "gcach_ftyp.hxx" -#include <vcl/svapp.hxx> -#include <vcl/outfont.hxx> -#include <vcl/impfont.hxx> -#include <vcl/bitmap.hxx> -#include <vcl/bmpacc.hxx> +#include "vcl/svapp.hxx" +#include "vcl/outfont.hxx" +#include "vcl/impfont.hxx" +#include "vcl/bitmap.hxx" +#include "vcl/bmpacc.hxx" -#include <tools/poly.hxx> -#include <basegfx/matrix/b2dhommatrix.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> +#include "tools/poly.hxx" +#include "basegfx/matrix/b2dhommatrix.hxx" +#include "basegfx/polygon/b2dpolypolygon.hxx" -#include <osl/file.hxx> -#include <osl/thread.hxx> +#include "osl/file.hxx" +#include "osl/thread.hxx" #include <ft2build.h> #include FT_FREETYPE_H @@ -62,7 +62,7 @@ #ifndef FT_RENDER_MODE_MONO // happens in the MACOSX build #define FT_RENDER_MODE_MONO ft_render_mode_mono #endif -#include <rtl/instance.hxx> +#include "rtl/instance.hxx" #ifndef FREETYPE_PATCH // VERSION_MINOR in freetype.h is too coarse @@ -89,15 +89,15 @@ typedef FT_Vector* FT_Vector_CPtr; #include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> - #include <psprint/fontmanager.hxx> + #include "vcl/fontmanager.hxx" #elif defined(WNT) #include <io.h> #define strncasecmp strnicmp #endif -#include <vcl/svapp.hxx> -#include <vcl/settings.hxx> -#include <i18npool/lang.h> +#include "vcl/svapp.hxx" +#include "vcl/settings.hxx" +#include "i18npool/lang.h" typedef const unsigned char* CPU8; inline sal_uInt16 NEXT_U16( CPU8& p ) { p+=2; return (p[-2]<<8)|p[-1]; } @@ -831,6 +831,10 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn // TODO: query GASP table for load flags mnLoadFlags = FT_LOAD_DEFAULT; +#if 1 // #i97326# cairo sometimes uses FT_Set_Transform() on our FT_FACE + // we are not using FT_Set_Transform() yet, so just ignore it for now + mnLoadFlags |= FT_LOAD_IGNORE_TRANSFORM; +#endif mbArtItalic = (rFSD.meItalic != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE); mbArtBold = (rFSD.meWeight > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM); @@ -1027,6 +1031,17 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor rTo.mnDescent += nOtherHalfTmpExtLeading; } } + + // initialize kashida width + // TODO: what if there are different versions of this glyph available + rTo.mnMinKashida = rTo.mnAscent / 4; // a reasonable default + const int nKashidaGlyphId = GetRawGlyphIndex( 0x0640 ); + if( nKashidaGlyphId ) + { + GlyphData aGlyphData; + InitGlyphData( nKashidaGlyphId, aGlyphData ); + rTo.mnMinKashida = aGlyphData.GetMetric().GetCharWidth(); + } } // ----------------------------------------------------------------------- @@ -1243,6 +1258,25 @@ int FreetypeServerFont::GetGlyphIndex( sal_UCS4 aChar ) const // ----------------------------------------------------------------------- +static int lcl_GetCharWidth( FT_FaceRec_* pFaceFT, double fStretch, int nGlyphFlags ) +{ + int nCharWidth = pFaceFT->glyph->metrics.horiAdvance; + + if( nGlyphFlags & GF_ROTMASK ) // for bVertical rotated glyphs + { + const FT_Size_Metrics& rMetrics = pFaceFT->size->metrics; +#if (FTVERSION < 2000) + nCharWidth = (int)((rMetrics.height - rMetrics.descender) * fStretch); +#else + nCharWidth = (int)((rMetrics.height + rMetrics.descender) * fStretch); +#endif + } + + return (nCharWidth + 32) >> 6; +} + +// ----------------------------------------------------------------------- + void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const { if( maSizeFT ) @@ -1282,20 +1316,12 @@ void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const return; } + const bool bOriginallyZeroWidth = (maFaceFT->glyph->metrics.horiAdvance == 0); if( mbArtBold && pFTEmbolden ) (*pFTEmbolden)( maFaceFT->glyph ); - int nCharWidth = maFaceFT->glyph->metrics.horiAdvance; - - if( nGlyphFlags & GF_ROTMASK ) { // for bVertical rotated glyphs - const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics; -#if (FTVERSION < 2000) - nCharWidth = (int)((rMetrics.height - rMetrics.descender) * mfStretch); -#else - nCharWidth = (int)((rMetrics.height + rMetrics.descender) * mfStretch); -#endif - } - rGD.SetCharWidth( (nCharWidth + 32) >> 6 ); + const int nCharWidth = bOriginallyZeroWidth ? 0 : lcl_GetCharWidth( maFaceFT, mfStretch, nGlyphFlags ); + rGD.SetCharWidth( nCharWidth ); FT_Glyph pGlyphFT; rc = FT_Get_Glyph( maFaceFT->glyph, &pGlyphFT ); @@ -2365,11 +2391,16 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) const USHORT nOffset= GetUShort( pFeatureHeader+4 ); pFeatureHeader += 6; - // feature (required && (requested || available))? - if( (aFeatureIndexList[0] != nFeatureIndex) - && (!std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag)) - || (!std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex) ) ) - continue; + // short circuit some feature lookups + if( aFeatureIndexList[0] != nFeatureIndex ) // required feature? + { + const int nRequested = std::count( aFeatureIndexList.begin(), aFeatureIndexList.end(), nFeatureIndex); + if( !nRequested ) // ignore features that are not requested + continue; + const int nAvailable = std::count( aReqFeatureTagList.begin(), aReqFeatureTagList.end(), nTag); + if( !nAvailable ) // some fonts don't provide features they request! + continue; + } const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset; const USHORT nCntLookups = GetUShort( pFeatureTable+0 ); diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx index a853e7008aa5..660f772d43ed 100644 --- a/vcl/source/glyphs/gcach_ftyp.hxx +++ b/vcl/source/glyphs/gcach_ftyp.hxx @@ -181,7 +181,7 @@ public: virtual int GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); } virtual bool TestFont() const; virtual void* GetFtFace() const; - virtual int GetLoadFlags() const { return mnLoadFlags; } + virtual int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); } virtual bool NeedsArtificialBold() const { return mbArtBold; } virtual bool NeedsArtificialItalic() const { return mbArtItalic; } diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx index bdd2444013c0..6bbf78f819b0 100755 --- a/vcl/source/glyphs/gcach_layout.cxx +++ b/vcl/source/glyphs/gcach_layout.cxx @@ -60,8 +60,6 @@ void ServerFontLayout::DrawText( SalGraphics& rSalGraphics ) const rSalGraphics.DrawServerFontLayout( *this ); } -//-------------------------------------------------------------------------- - // ----------------------------------------------------------------------- bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs ) @@ -481,6 +479,9 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr // layout bidi/script runs and export them to a ServerFontLayout // convert results to GlyphItems int nLastCharPos = -1; + int nClusterMinPos = -1; + int nClusterMaxPos = -1; + bool bClusterStart = true; int nFilteredRunGlyphCount = 0; const IcuPosition* pPos = pGlyphPositions; for( int i = 0; i < nRawRunGlyphCount; ++i, ++pPos ) @@ -518,15 +519,9 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr continue; } - // if ICU feeds us a character index sequence like [1,0,1] (which - // is completely valid), smooth out the sequence so that our cluster - // detection routines work better. The best knowledge where the - // cluster boundaries are should be provided by the layout engine... - if( nLastCharPos != -1 ) - if( (nCharPos < nLastCharPos) ^ bRightToLeft ) - nCharPos = nLastCharPos; // apply vertical flags, etc. + bool bDiacritic = false; if( nCharPos >= 0 ) { sal_UCS4 aChar = rArgs.mpStr[ nCharPos ]; @@ -542,32 +537,87 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr } #endif nGlyphIndex = rFont.FixupGlyphIndex( nGlyphIndex, aChar ); + + // #i99367# HACK: try to detect all diacritics + if( aChar>=0x0300 && aChar<0x2100 ) + bDiacritic = IsDiacritic( aChar ); } // get glyph position and its metrics aNewPos = Point( (int)(pPos->fX+0.5), (int)(pPos->fY+0.5) ); const GlyphMetric& rGM = rFont.GetGlyphMetric( nGlyphIndex ); int nGlyphWidth = rGM.GetCharWidth(); + if( nGlyphWidth <= 0 ) + bDiacritic |= true; + // #i99367# force all diacritics to zero width + // TODO: we need mnOrigWidth/mnLogicWidth/mnNewWidth + else if( bDiacritic ) + nGlyphWidth = 0; + + // heuristic to detect glyph clusters + bool bInCluster = true; + if( nLastCharPos == -1 ) + { + nClusterMinPos = nClusterMaxPos = nCharPos; + bInCluster = false; + } + else if( !bRightToLeft ) + { + // left-to-right case + if( nClusterMinPos > nCharPos ) + nClusterMinPos = nCharPos; // extend cluster + else if( nCharPos <= nClusterMaxPos ) + /*NOTHING*/; // inside cluster + else if( bDiacritic ) + nClusterMaxPos = nCharPos; // add diacritic to cluster + else { + nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster + bInCluster = false; + } + } + else + { + // right-to-left case + if( nClusterMaxPos < nCharPos ) + nClusterMaxPos = nCharPos; // extend cluster + else if( nCharPos >= nClusterMinPos ) + /*NOTHING*/; // inside cluster + else if( bDiacritic ) + { + nClusterMinPos = nCharPos; // ICU often has [diacritic* baseglyph*] + if( bClusterStart ) { + nClusterMaxPos = nCharPos; + bInCluster = false; + } + } + else + { + nClusterMinPos = nClusterMaxPos = nCharPos; // new cluster + bInCluster = !bClusterStart; + } + } - // heuristic to detect group clusters using "smoothed" char positions long nGlyphFlags = 0; - if( nLastCharPos != -1 ) - if( (nCharPos == nLastCharPos) || (nGlyphWidth <= 0) ) - nGlyphFlags = GlyphItem::IS_IN_CLUSTER; + if( bInCluster ) + nGlyphFlags |= GlyphItem::IS_IN_CLUSTER; if( bRightToLeft ) nGlyphFlags |= GlyphItem::IS_RTL_GLYPH; + if( bDiacritic ) + nGlyphFlags |= GlyphItem::IS_DIACRITIC; // add resulting glyph item to layout - GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth ); + const GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth ); rLayout.AppendGlyph( aGI ); ++nFilteredRunGlyphCount; nLastCharPos = nCharPos; + bClusterStart = !aGI.IsDiacritic(); // TODO: only needed in RTL-codepath } aNewPos = Point( (int)(pPos->fX+0.5), (int)(pPos->fY+0.5) ); nGlyphCount += nFilteredRunGlyphCount; } // sort glyphs in visual order + // and then in logical order (e.g. diacritics after cluster start) rLayout.SortGlyphItems(); // determine need for kashida justification @@ -594,3 +644,4 @@ ServerFontLayoutEngine* FreetypeServerFont::GetLayoutEngine() } // ======================================================================= + diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx index 9b439a6df9af..f5a8d8fbb14e 100644 --- a/vcl/source/helper/lazydelete.cxx +++ b/vcl/source/helper/lazydelete.cxx @@ -33,9 +33,10 @@ #ifndef LAZYDELETE_CXX #define LAZYDELETE_CXX -#include <vcl/window.hxx> -#include <vcl/menu.hxx> -#include <vcl/lazydelete.hxx> +#include "vcl/window.hxx" +#include "vcl/menu.hxx" +#include "vcl/lazydelete.hxx" +#include "vcl/svdata.hxx" namespace vcl { @@ -81,6 +82,44 @@ template<> bool LazyDeletor<Menu>::is_less( Menu* left, Menu* right ) return left != NULL; } +DeleteOnDeinitBase::~DeleteOnDeinitBase() +{ +} + +void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer ) +{ + ImplSVData* pSVData = ImplGetSVData(); + if( ! pSVData ) + { + ImplInitSVData(); + pSVData = ImplGetSVData(); + } + + DBG_ASSERT( ! pSVData->mbDeInit, "DeleteOnDeinit added after DeiInitVCL !" ); + if( pSVData->mbDeInit ) + return; + + if( pSVData->mpDeinitDeleteList == NULL ) + pSVData->mpDeinitDeleteList = new std::list< DeleteOnDeinitBase* >(); + pSVData->mpDeinitDeleteList->push_back( i_pContainer ); } +void DeleteOnDeinitBase::ImplDeleteOnDeInit() +{ + ImplSVData* pSVData = ImplGetSVData(); + if( pSVData->mpDeinitDeleteList ) + { + for( std::list< vcl::DeleteOnDeinitBase* >::iterator it = pSVData->mpDeinitDeleteList->begin(); + it != pSVData->mpDeinitDeleteList->end(); ++it ) + { + (*it)->doCleanup(); + } + delete pSVData->mpDeinitDeleteList; + pSVData->mpDeinitDeleteList = NULL; + } +} + +} // namespace vcl + #endif + diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk index 520ed6b3a17a..6f0d4959c9c4 100644 --- a/vcl/source/helper/makefile.mk +++ b/vcl/source/helper/makefile.mk @@ -44,6 +44,7 @@ TARGET=helper # --- Files -------------------------------------------------------- SLOFILES=\ + $(SLO)$/strhelper.obj \ $(SLO)$/evntpost.obj \ $(SLO)$/canvasbitmap.obj \ $(SLO)$/canvastools.obj \ diff --git a/psprint/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index 6dc3d0c3f1e7..5b503fa65c05 100644 --- a/psprint/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -29,9 +29,10 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <psprint/strhelper.hxx> -#include <sal/alloca.h> +#include "precompiled_vcl.hxx" + +#include "vcl/strhelper.hxx" +#include "sal/alloca.h" namespace psp { diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 5348d04c1a5d..1e9a3350c88e 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -44,9 +44,6 @@ using namespace ::com::sun::star; - - - // ======================================================================= static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex ) @@ -274,65 +271,6 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, // ----------------------------------------------------------------------- -static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode, - USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE ) -{ - DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd), - "Window::ImplFindAccelWindow() - rIndex not in Form" ); - - xub_Unicode cCompareChar; - USHORT nStart = rIndex; - USHORT i = rIndex; - int bSearch = TRUE; - Window* pWindow; - - // MT: Where can we keep the CharClass?! - static uno::Reference< i18n::XCharacterClassification > xCharClass; - if ( !xCharClass.is() ) - xCharClass = vcl::unohelper::CreateCharacterClassification(); - - const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); - cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; - - if ( i < nFormEnd ) - pWindow = ImplGetNextWindow( pParent, i, i, TRUE ); - else - pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE ); - while ( bSearch ) - { - const XubString aStr = pWindow->GetText(); - USHORT nPos = aStr.Search( '~' ); - while ( nPos != STRING_NOTFOUND ) - { - cCompareChar = aStr.GetChar( nPos+1 ); - cCompareChar = xCharClass->toUpper( String(cCompareChar), 0, 1, rLocale )[0]; - if ( cCompareChar == cCharCode ) - { - // Bei Static-Controls auf das naechste Controlm weiterschalten - if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || - (pWindow->GetType() == WINDOW_FIXEDLINE) || - (pWindow->GetType() == WINDOW_GROUPBOX) ) - pWindow = pParent->ImplGetDlgWindow( i, DLGWINDOW_NEXT ); - rIndex = i; - return pWindow; - } - nPos = aStr.Search( '~', nPos+1 ); - } - - if ( i == nStart ) - break; - - if ( i < nFormEnd ) - pWindow = ImplGetNextWindow( pParent, i, i, bCheckEnable ); - else - pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); - } - - return NULL; -} - -// ----------------------------------------------------------------------- - static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex, USHORT& rFormStart, USHORT& rFormEnd ) { @@ -347,6 +285,10 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // Focus-Fenster in der Child-Liste suchen pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE ); + + if( pWindow == NULL ) + pWindow = pSWindow; + while ( pSWindow ) { if ( pSWindow->ImplGetWindow()->IsDialogControlStart() ) @@ -404,6 +346,89 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // ----------------------------------------------------------------------- +static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode, + USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE ) +{ + DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd), + "Window::ImplFindAccelWindow() - rIndex not in Form" ); + + xub_Unicode cCompareChar; + USHORT nStart = rIndex; + USHORT i = rIndex; + int bSearch = TRUE; + Window* pWindow; + + // MT: Where can we keep the CharClass?! + static uno::Reference< i18n::XCharacterClassification > xCharClass; + if ( !xCharClass.is() ) + xCharClass = vcl::unohelper::CreateCharacterClassification(); + + const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); + cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; + + if ( i < nFormEnd ) + pWindow = ImplGetNextWindow( pParent, i, i, TRUE ); + else + pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE ); + while( bSearch && pWindow ) + { + const XubString aStr = pWindow->GetText(); + USHORT nPos = aStr.Search( '~' ); + while ( nPos != STRING_NOTFOUND ) + { + cCompareChar = aStr.GetChar( nPos+1 ); + cCompareChar = xCharClass->toUpper( String(cCompareChar), 0, 1, rLocale )[0]; + if ( cCompareChar == cCharCode ) + { + // Bei Static-Controls auf das naechste Controlm weiterschalten + if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || + (pWindow->GetType() == WINDOW_FIXEDLINE) || + (pWindow->GetType() == WINDOW_GROUPBOX) ) + pWindow = pParent->ImplGetDlgWindow( i, DLGWINDOW_NEXT ); + rIndex = i; + return pWindow; + } + nPos = aStr.Search( '~', nPos+1 ); + } + + // #i93011# it would have made sense to have this really recursive + // right from the start. However this would cause unpredictable side effects now + // so instead we have a style bit for some child windows, that want their + // children checked for accelerators + if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 ) + { + USHORT nChildIndex; + USHORT nChildFormStart; + USHORT nChildFormEnd; + + // get form start and end + ::ImplFindDlgCtrlWindow( pWindow, NULL, + nChildIndex, nChildFormStart, nChildFormEnd ); + Window* pAccelWin = ImplFindAccelWindow( pWindow, nChildIndex, cCharCode, + nChildFormStart, nChildFormEnd, + bCheckEnable ); + if( pAccelWin ) + return pAccelWin; + } + + if ( i == nStart ) + break; + + if ( i < nFormEnd ) + { + pWindow = ImplGetNextWindow( pParent, i, i, bCheckEnable ); + if( ! pWindow ) + pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); + } + else + pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); + } + + return NULL; +} + +// ----------------------------------------------------------------------- + void Window::ImplControlFocus( USHORT nFlags ) { if ( nFlags & GETFOCUS_MNEMONIC ) @@ -848,7 +873,7 @@ void Window::ImplDlgCtrlNextWindow() ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) ) pDlgCtrlParent = pDlgCtrlParent->ImplGetParent(); - if ( !pDlgCtrlParent || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) ) +if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) ) return; // lookup window in child list diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 59dfc2a04eae..7bcb90bbb8fc 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -424,6 +424,11 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, { if( devRectRTL.Right()-aSize.Width()+1 < aScreenRect.Left() ) aPos.X() -= aScreenRect.Left() - devRectRTL.Right() + aSize.Width() - 1; + else if( aPos.X() + aSize.Width() > aScreenRect.Right() ) + { + aPos.X() -= aSize.Width()-2; // popup to left instead + aPos.Y() -= 2; + } } else if ( aPos.X()+aSize.Width() > aScreenRect.Right() ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 81f6380ad160..1318f4fa8415 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -31,42 +31,36 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#ifndef _SV_SVSYS_HXX -#include <svsys.h> -#endif -#include <vcl/salinst.hxx> -#include <tools/list.hxx> -#include <tools/debug.hxx> -#include <vcl/svdata.hxx> -#include <vcl/svapp.hxx> -#include <vcl/mnemonic.hxx> -#include <vcl/image.hxx> -#include <vcl/event.hxx> -#include <vcl/help.hxx> -#ifndef _SV_SVIDS_HRC -#include <vcl/svids.hrc> -#endif -#include <vcl/floatwin.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/timer.hxx> -#include <vcl/sound.hxx> -#include <vcl/decoview.hxx> -#include <vcl/bitmap.hxx> -#ifndef _SV_RC_H -#include <tools/rc.h> -#endif -#include <vcl/menu.hxx> -#include <vcl/button.hxx> -#include <vcl/gradient.hxx> -#include <vcl/i18nhelp.hxx> -#include <vcl/taskpanelist.hxx> -#include <vcl/window.h> -#include <vcl/controllayout.hxx> -#include <vcl/toolbox.hxx> -#include <tools/stream.hxx> -#include <vcl/salmenu.hxx> -#include <vcl/salframe.hxx> -#include <vcl/dockingarea.hxx> +#include "svsys.h" +#include "vcl/salinst.hxx" +#include "tools/list.hxx" +#include "tools/debug.hxx" +#include "vcl/svdata.hxx" +#include "vcl/svapp.hxx" +#include "vcl/mnemonic.hxx" +#include "vcl/image.hxx" +#include "vcl/event.hxx" +#include "vcl/help.hxx" +#include "vcl/svids.hrc" +#include "vcl/floatwin.hxx" +#include "vcl/wrkwin.hxx" +#include "vcl/timer.hxx" +#include "vcl/sound.hxx" +#include "vcl/decoview.hxx" +#include "vcl/bitmap.hxx" +#include "tools/rc.h" +#include "vcl/menu.hxx" +#include "vcl/button.hxx" +#include "vcl/gradient.hxx" +#include "vcl/i18nhelp.hxx" +#include "vcl/taskpanelist.hxx" +#include "vcl/window.h" +#include "vcl/controllayout.hxx" +#include "vcl/toolbox.hxx" +#include "tools/stream.hxx" +#include "vcl/salmenu.hxx" +#include "vcl/salframe.hxx" +#include "vcl/dockingarea.hxx" #include <com/sun/star/uno/Reference.h> @@ -352,10 +346,12 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod { MenuItemData* pData = GetDataFromPos( rPos ); if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) ) + { if( nDuplicates > 1 && rPos == nCurrentPos ) continue; // select next entry with the same mnemonic else return pData; + } } } @@ -1588,10 +1584,12 @@ void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu ) // set native submenu if( ImplGetSalMenu() && pData->pSalMenuItem ) + { if( pMenu ) ImplGetSalMenu()->SetSubMenu( pData->pSalMenuItem, pMenu->ImplGetSalMenu(), nPos ); else ImplGetSalMenu()->SetSubMenu( pData->pSalMenuItem, NULL, nPos ); + } ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos ); } @@ -3568,7 +3566,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM pWin->SetFocusId( nFocusId ); pWin->SetOutputSizePixel( aSz ); - // #102158# menues must never grab the focus, otherwise + // #102158# menus must never grab the focus, otherwise // they will be closed immediately // from now on focus grabbing is only prohibited automatically if // FLOATWIN_POPUPMODE_GRABFOCUS was set (which is done below), because some @@ -3577,15 +3575,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( GetItemCount() ) { SalMenu* pMenu = ImplGetSalMenu(); - Rectangle aNativeRect( aRect ); - if( pW->IsRTLEnabled() && Application::GetSettings().GetLayoutRTL() ) - { - Point aPt( aRect.TopLeft() ); - aPt.X() += aSz.Width(); - pW->ImplMirrorFramePos( aPt ); - aNativeRect = Rectangle( aPt, aNativeRect.GetSize() ); - } - if( pMenu && pMenu->ShowNativePopupMenu( pWin, aNativeRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) + if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) { pWin->StopExecute(0); pWin->doShutdown(); @@ -4669,10 +4659,12 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) { n++; if ( n >= pMenu->GetItemCount() ) + { if ( !IsScrollMenu() || ( nHighlightedItem == ITEMPOS_INVALID ) ) n = 0; else break; + } } MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index d9891430f29d..ec16b65cf41f 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3015,25 +3015,9 @@ void Window::ImplScroll( const Rectangle& rRect, Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) { - pWindow->mpWindowImpl->mnX += nHorzScroll; - pWindow->mpWindowImpl->maPos.X() += nHorzScroll; - pWindow->mpWindowImpl->mnY += nVertScroll; - pWindow->mpWindowImpl->maPos.Y() += nVertScroll; - if ( pWindow->ImplUpdatePos() ) - pWindow->ImplUpdateSysObjPos(); - if ( pWindow->IsReallyVisible() ) - pWindow->ImplSetClipFlag(); - if ( pWindow->mpWindowImpl->mpClientWindow ) - pWindow->mpWindowImpl->mpClientWindow->mpWindowImpl->maPos = pWindow->mpWindowImpl->maPos; - - if ( pWindow->IsVisible() ) - { - pWindow->ImplCallMove(); - } - else - { - pWindow->mpWindowImpl->mbCallMove = TRUE; - } + Point aPos = pWindow->GetPosPixel(); + aPos += Point( nHorzScroll, nVertScroll ); + pWindow->SetPosPixel( aPos ); pWindow = pWindow->mpWindowImpl->mpNext; } @@ -3261,7 +3245,6 @@ void Window::ImplPosSizeWindow( long nX, long nY, if ( nFlags & WINDOW_POSSIZE_X ) { long nOrgX = nX; - //if ( nX != mnX ) // --- RTL --- (compare the screen coordinates) Point aPtDev( Point( nX+mnOutOffX, 0 ) ); if( ImplHasMirroredGraphics() ) @@ -3276,6 +3259,17 @@ void Window::ImplPosSizeWindow( long nX, long nY, // --- RTL --- (re-mirror at parent window) nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX; } + /* #i99166# An LTR window in RTL UI that gets sized only would be + expected to not moved its upper left point + */ + if( bnXRecycled ) + { + if( ImplIsAntiparallel() ) + { + aPtDev.X() = mpWindowImpl->mnAbsScreenX; + nOrgX = mpWindowImpl->maPos.X(); + } + } } else if( !bnXRecycled && mpWindowImpl->mpParent && !mpWindowImpl->mpParent->mpWindowImpl->mbFrame && mpWindowImpl->mpParent->ImplIsAntiparallel() ) { @@ -4763,7 +4757,9 @@ Window::~Window() // ----------------------------------------------------------------------- void Window::doLazyDelete() { - if( dynamic_cast<SystemWindow*>(this) ) + SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(this); + DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(this); + if( pSysWin || ( pDockWin && pDockWin->IsFloatingMode() ) ) SetParent( ImplGetDefaultWindow() ); vcl::LazyDeletor<Window>::Delete( this ); } diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index d0618328e59c..04d679d8d4f1 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -406,8 +406,16 @@ void GtkData::initNWF( void ) // open first menu on F10 pSVData->maNWFData.mbOpenMenuOnF10 = true; + int nScreens = GetX11SalData()->GetDisplay()->GetScreenCount(); + gWidgetData = std::vector<NWFWidgetData>( nScreens ); + for( int i = 0; i < nScreens; i++ ) + gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList; + + if( SalGetDesktopEnvironment().equalsAscii( "KDE" ) ) { + // #i97196# ensure a widget exists and the style engine was loaded + NWEnsureGTKButton( 0 ); if( g_type_from_name( "QtEngineStyle" ) ) { // KDE 3.3 invented a bug in the qt<->gtk theme engine @@ -420,12 +428,6 @@ void GtkData::initNWF( void ) if( pEnv && *pEnv ) GtkSalGraphics::bNeedPixmapPaint = GtkSalGraphics::bGlobalNeedPixmapPaint = true; - int nScreens = GetX11SalData()->GetDisplay()->GetScreenCount(); - gWidgetData = std::vector<NWFWidgetData>( nScreens ); - for( int i = 0; i < nScreens; i++ ) - gWidgetData[i].gNWPixmapCacheList = new NWPixmapCacheList; - - #if OSL_DEBUG_LEVEL > 1 std::fprintf( stderr, "GtkPlugin: using %s NWF\n", GtkSalGraphics::bNeedPixmapPaint ? "offscreen" : "direct" ); @@ -3356,7 +3358,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) static gboolean(*pAbso)(const PangoFontDescription*) = (gboolean(*)(const PangoFontDescription*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" ); - if( ! pAbso || pAbso( pStyle->font_desc ) ) + if( pAbso && pAbso( pStyle->font_desc ) ) nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); else nPointHeight = nPangoHeight/PANGO_SCALE; diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index c00d14a4a587..a47b9bf31b01 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -84,20 +84,10 @@ static USHORT GetKeyModCode( guint state ) USHORT nCode = 0; if( (state & GDK_SHIFT_MASK) ) nCode |= KEY_SHIFT; - if( (state & GDK_CONTROL_MASK) -#ifdef MACOSX - || (state & GDK_MOD2_MASK) // map Meta (aka Command key) to Ctrl -#endif - ) + if( (state & GDK_CONTROL_MASK) ) nCode |= KEY_MOD1; if( (state & GDK_MOD1_MASK) ) - { nCode |= KEY_MOD2; -#ifdef MACOSX - if( ! (nCode & KEY_MOD1) ) - nCode |= KEY_MOD3; -#endif - } return nCode; } @@ -652,6 +642,10 @@ extern "C" { typedef void(*setAcceptFn)( GtkWindow*, gboolean ); static setAcceptFn p_gtk_window_set_accept_focus = NULL; static bool bGetAcceptFocusFn = true; + + typedef void(*setUserTimeFn)( GdkWindow*, guint32 ); + static setUserTimeFn p_gdk_x11_window_set_user_time = NULL; + static bool bGetSetUserTimeFn = true; } static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBeforeRealize ) @@ -659,8 +653,7 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe if( bGetAcceptFocusFn ) { bGetAcceptFocusFn = false; - OUString aSym( RTL_CONSTASCII_USTRINGPARAM( "gtk_window_set_accept_focus" ) ); - p_gtk_window_set_accept_focus = (setAcceptFn)osl_getFunctionSymbol( GetSalData()->m_pPlugin, aSym.pData ); + p_gtk_window_set_accept_focus = (setAcceptFn)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_window_set_accept_focus" ); } if( p_gtk_window_set_accept_focus && bBeforeRealize ) p_gtk_window_set_accept_focus( pWindow, bAccept ); @@ -679,6 +672,9 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe XSetWMHints( pDisplay, aWindow, pHints ); XFree( pHints ); + if (GetX11SalData()->GetDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")) + return; + /* remove WM_TAKE_FOCUS protocol; this would usually be the * right thing, but gtk handles it internally whereas we * want to handle it ourselves (as to sometimes not get @@ -713,6 +709,28 @@ static void lcl_set_accept_focus( GtkWindow* pWindow, gboolean bAccept, bool bBe } } } +static void lcl_set_user_time( GdkWindow* i_pWindow, guint32 i_nTime ) +{ + if( bGetSetUserTimeFn ) + { + bGetSetUserTimeFn = false; + p_gdk_x11_window_set_user_time = (setUserTimeFn)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_x11_window_set_user_time" ); + } + if( p_gdk_x11_window_set_user_time ) + p_gdk_x11_window_set_user_time( i_pWindow, i_nTime ); + else + { + Display* pDisplay = GetX11SalData()->GetDisplay()->GetDisplay(); + XLIB_Window aWindow = GDK_WINDOW_XWINDOW( i_pWindow ); + Atom nUserTime = XInternAtom( pDisplay, "_NET_WM_USER_TIME", True ); + if( nUserTime ) + { + XChangeProperty( pDisplay, aWindow, + nUserTime, XA_CARDINAL, 32, + PropModeReplace, (unsigned char*)&i_nTime, 1 ); + } + } +}; GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow ) { @@ -734,6 +752,9 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) m_aForeignTopLevelWindow = None; m_nStyle = nStyle; + GtkWindowType eWinType = ((nStyle & SAL_FRAME_STYLE_FLOAT) && ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION)) + ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL; + if( nStyle & SAL_FRAME_STYLE_SYSTEMCHILD ) { m_pWindow = gtk_event_box_new(); @@ -746,7 +767,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) } } else - m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", ((nStyle & SAL_FRAME_STYLE_FLOAT) && ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL, "visible", FALSE, NULL ); + m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType, "visible", FALSE, NULL ); g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this ); // force wm class hint @@ -777,6 +798,7 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) { eType = GDK_WINDOW_TYPE_HINT_UTILITY; gtk_window_set_skip_taskbar_hint( GTK_WINDOW(m_pWindow), true ); + lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, true ); } else if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) { @@ -806,10 +828,22 @@ void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle ) InitCommon(); + if( eWinType == GTK_WINDOW_TOPLEVEL ) + { + guint32 nUserTime = 0; + if( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) + { + /* #i99360# ugly workaround an X11 library bug */ + nUserTime= getDisplay()->GetLastUserEventTime( true ); + // nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); + } + lcl_set_user_time(GTK_WIDGET(m_pWindow)->window, nUserTime); + } + if( bDecoHandling ) { gtk_window_set_resizable( GTK_WINDOW(m_pWindow), (nStyle & SAL_FRAME_STYLE_SIZEABLE) ? TRUE : FALSE ); - if( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) + if( ( (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) || ( (nStyle & SAL_FRAME_STYLE_TOOLWINDOW ) ) ) lcl_set_accept_focus( GTK_WINDOW(m_pWindow), FALSE, false ); } @@ -1228,7 +1262,7 @@ static void initClientId() } } -void GtkSalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) +void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) { if( m_pWindow ) { @@ -1264,7 +1298,50 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) */ m_pParent->grabPointer( TRUE, TRUE ); } + + guint32 nUserTime = 0; + if( ! bNoActivate && (m_nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) + /* #i99360# ugly workaround an X11 library bug */ + nUserTime= getDisplay()->GetLastUserEventTime( true ); + //nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); + + //For these floating windows we don't want the main window to lose focus, and metacity has... + // metacity-2.24.0/src/core/window.c + // + // if ((focus_window != NULL) && XSERVER_TIME_IS_BEFORE (compare, focus_window->net_wm_user_time)) + // "compare" window focus prevented by other activity + // + // where "compare" is this window + + // which leads to... + + // /* This happens for error dialogs or alerts; these need to remain on + // * top, but it would be confusing to have its ancestor remain + // * focused. + // */ + // if (meta_window_is_ancestor_of_transient (focus_window, window)) + // "The focus window %s is an ancestor of the newly mapped " + // "window %s which isn't being focused. Unfocusing the " + // "ancestor.\n", + // + // i.e. having a time < that of the toplevel frame means that the toplevel frame gets unfocused. + // awesome. + if( nUserTime == 0 && + ( + getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") || + getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz") + ) + ) + { + /* #i99360# ugly workaround an X11 library bug */ + nUserTime= getDisplay()->GetLastUserEventTime( true ); + //nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window); + } + + lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime ); + gtk_widget_show( m_pWindow ); + if( isFloatGrabWindow() ) { m_nFloats++; @@ -1288,6 +1365,9 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) gtk_widget_hide( m_pWindow ); if( m_pIMHandler ) m_pIMHandler->focusChanged( false ); + // flush here; there may be a very seldom race between + // the display connection used for clipboard and our connection + Flush(); } CallCallback( SALEVENT_RESIZE, NULL ); } @@ -1951,7 +2031,12 @@ void GtkSalFrame::ToTop( USHORT nFlags ) if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) ) gtk_window_present( GTK_WINDOW(m_pWindow) ); else - gdk_window_focus( m_pWindow->window, GDK_CURRENT_TIME ); + { + // gdk_window_focus( m_pWindow->window, gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) ); + /* #i99360# ugly workaround an X11 library bug */ + guint32 nUserTime= getDisplay()->GetLastUserEventTime( true ); + gdk_window_focus( m_pWindow->window, nUserTime ); + } /* need to do an XSetInputFocus here because * gdk_window_focus will ask a EWMH compliant WM to put the focus * to our window - which it of course won't since our input hint @@ -2869,35 +2954,21 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame // The modifier mode therefore has to be adapted manually. switch( pEvent->keyval ) { -#ifdef MACOSX - case GDK_Meta_L: // map Meta (aka Command key) to Ctrl -#endif case GDK_Control_L: nExtModMask = MODKEY_LMOD1; nModMask = KEY_MOD1; break; -#ifdef MACOSX - case GDK_Meta_R: // map Meta (aka Command key) to Ctrl -#endif case GDK_Control_R: nExtModMask = MODKEY_RMOD1; nModMask = KEY_MOD1; break; case GDK_Alt_L: nExtModMask = MODKEY_LMOD2; -#ifdef MACOSX - nModMask = KEY_MOD3; -#else nModMask = KEY_MOD2; -#endif break; case GDK_Alt_R: nExtModMask = MODKEY_RMOD2; -#ifdef MACOSX - nModMask = KEY_MOD2 | (pEvent->type == GDK_KEY_RELEASE ? KEY_MOD3 : 0); -#else nModMask = KEY_MOD2; -#endif break; case GDK_Shift_L: nExtModMask = MODKEY_LSHIFT; diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 0ac79afeec88..e9d726464921 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -28,17 +28,17 @@ * ************************************************************************/ -#include <vcl/svapp.hxx> -#include <vcl/jobset.h> +#include "vcl/svapp.hxx" +#include "vcl/jobset.h" +#include "vcl/print.h" +#include "vcl/salptype.hxx" +#include "vcl/timer.hxx" +#include "vcl/printerinfomanager.hxx" + #include "svpprn.hxx" -#include <vcl/print.h> -#include <vcl/salptype.hxx> -#include <vcl/timer.hxx> #include "svppspgraphics.hxx" #include "svpinst.hxx" -#include <psprint/printerinfomanager.hxx> - #include <unistd.h> #include <sys/stat.h> #include <sys/wait.h> @@ -623,58 +623,13 @@ BOOL PspSalInfoPrinter::SetData( } String aPaper; -#ifdef MACOSX - // For Mac OS X, many printers are directly attached - // USB/Serial printers with a stripped-down PPD that gives us - // problems. We need to do PS->PDF conversion for these printers - // but they are not able to handle multiple page sizes in the same - // document at all, since we must pass -o media=... to them to get - // a good printout. - // So, we must find a match between the paper size from OOo and what - // the PPD of the printer has, and pass that paper size to -o media=... - // If a match cannot be found (ie the paper size from Format->Page is - // nowhere near anything in the PPD), we default to what has been - // chosen in File->Print->Properties. - // - // For printers capable of directly accepting PostScript data, none - // of this occurs and we default to the normal OOo behavior. - const PPDKey *pCupsFilterKey; - const PPDValue *pCupsFilterValue; - BOOL bIsCUPSPrinter = TRUE; - - // Printers that need PS->PDF conversion have a "cupsFilter" key and - // a value of "application/pdf" in that key - pCupsFilterKey = aData.m_pParser->getKey( String(RTL_CONSTASCII_USTRINGPARAM("cupsFilter")) ); - pCupsFilterValue = pCupsFilterKey != NULL ? aData.m_aContext.getValue( pCupsFilterKey ) : NULL; - if ( pCupsFilterValue ) - { - // PPD had a cupsFilter key, check for PS->PDF conversion requirement - ByteString aCupsFilterString( pCupsFilterValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ); - if ( aCupsFilterString.Search("application/pdf") == 0 ) - bIsCUPSPrinter = FALSE; - } + if( pJobSetup->mePaperFormat == PAPER_USER ) + aPaper = aData.m_pParser->matchPaper( + TenMuToPt( pJobSetup->mnPaperWidth ), + TenMuToPt( pJobSetup->mnPaperHeight ) ); else - bIsCUPSPrinter = FALSE; + aPaper = String( ByteString( aPaperTab[ pJobSetup->mePaperFormat ].name ), RTL_TEXTENCODING_ISO_8859_1 ); - if ( TRUE == bIsCUPSPrinter ) - { - // If its a directly attached printer, with a - // stripped down PPD (most OS X printers are) always - // match the paper size. - aPaper = aData.m_pParser->matchPaper( - TenMuToPt( pJobSetup->mnPaperWidth ), - TenMuToPt( pJobSetup->mnPaperHeight ) ); - } - else -#endif - { - if( pJobSetup->mePaperFormat == PAPER_USER ) - aPaper = aData.m_pParser->matchPaper( - TenMuToPt( pJobSetup->mnPaperWidth ), - TenMuToPt( pJobSetup->mnPaperHeight ) ); - else - aPaper = String( ByteString( aPaperTab[ pJobSetup->mePaperFormat ].name ), RTL_TEXTENCODING_ISO_8859_1 ); - } pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pValue = pKey ? pKey->getValue( aPaper ) : NULL; if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx index eef8865fb56b..c2d85c054fce 100644 --- a/vcl/unx/headless/svpprn.hxx +++ b/vcl/unx/headless/svpprn.hxx @@ -31,10 +31,10 @@ #ifndef _SVP_SVPPRN_HXX #define _SVP_SVPPRN_HXX -#include <psprint/jobdata.hxx> -#include <psprint/printergfx.hxx> -#include <psprint/printerjob.hxx> -#include <vcl/salprn.hxx> +#include "vcl/jobdata.hxx" +#include "vcl/printergfx.hxx" +#include "vcl/printerjob.hxx" +#include "vcl/salprn.hxx" class PspGraphics; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 12302c1bbae2..2ff48966c765 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -29,22 +29,24 @@ ************************************************************************/ #include "svppspgraphics.hxx" -#include <psprint/jobdata.hxx> -#include <psprint/printergfx.hxx> -#include <psprint/printerinfomanager.hxx> -#include <vcl/bmpacc.hxx> -#include <vcl/salbmp.hxx> -#include <vcl/glyphcache.hxx> -#include <vcl/impfont.hxx> -#include <vcl/outfont.hxx> -#include <vcl/svapp.hxx> -#include <vcl/salprn.hxx> -#include <vcl/sysdata.hxx> -#include <basegfx/vector/b2ivector.hxx> -#include <basegfx/point/b2ipoint.hxx> -#include <basebmp/color.hxx> #include "svpbmp.hxx" +#include "vcl/jobdata.hxx" +#include "vcl/printergfx.hxx" +#include "vcl/printerinfomanager.hxx" +#include "vcl/bmpacc.hxx" +#include "vcl/salbmp.hxx" +#include "vcl/glyphcache.hxx" +#include "vcl/impfont.hxx" +#include "vcl/outfont.hxx" +#include "vcl/svapp.hxx" +#include "vcl/salprn.hxx" +#include "vcl/sysdata.hxx" + +#include "basegfx/vector/b2ivector.hxx" +#include "basegfx/point/b2ipoint.hxx" +#include "basebmp/color.hxx" + #include <stdlib.h> #include <unistd.h> #include <fcntl.h> diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 9cbbac446477..ba7d690a9f90 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -32,11 +32,9 @@ #define _SVP_PSPGRAPHICS_HXX -#ifndef _PSPRINT_FONTMANAGER_HXX -#include <psprint/fontmanager.hxx> -#endif -#include <vcl/sallayout.hxx> -#include <vcl/salgdi.hxx> +#include "vcl/fontmanager.hxx" +#include "vcl/sallayout.hxx" +#include "vcl/salgdi.hxx" namespace psp { struct JobData; class PrinterGfx; } diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx index b7cc8941219f..e65e41a73af5 100644 --- a/vcl/unx/inc/dtint.hxx +++ b/vcl/unx/inc/dtint.hxx @@ -49,8 +49,7 @@ struct XEvent; enum DtType { DtGeneric, - DtCDE, - DtMACOSX + DtCDE }; class DtIntegrator diff --git a/vcl/unx/inc/macosxint.hxx b/vcl/unx/inc/macosxint.hxx deleted file mode 100644 index 86b5f34840df..000000000000 --- a/vcl/unx/inc/macosxint.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macosxint.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SV_MACOSXINT_HXX -#define _SV_MACOSXINT_HXX - -#include <dtint.hxx> -#include <tools/list.hxx> - -class MACOSXIntegrator : public DtIntegrator -{ - friend DtIntegrator* DtIntegrator::CreateDtIntegrator(); -private: - MACOSXIntegrator(); - -public: - virtual ~MACOSXIntegrator(); - - virtual void GetSystemLook( AllSettings& rSettings ); -}; - -#endif diff --git a/vcl/unx/inc/prex.h b/vcl/unx/inc/prex.h index 705e33ca5188..131e628efe2e 100644 --- a/vcl/unx/inc/prex.h +++ b/vcl/unx/inc/prex.h @@ -50,7 +50,7 @@ extern "C" { #endif -#if defined(LINUX) || defined(FREEBSD) || defined(MACOSX) // should really check for xfree86 or for X11R6.1 and higher +#if defined(LINUX) || defined(FREEBSD) // should really check for xfree86 or for X11R6.1 and higher #define __XKeyboardExtension__ 1 #else #define __XKeyboardExtension__ 0 diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index c8c0abf29fd6..5c31d889453c 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -32,16 +32,12 @@ #define _VCL_PSPGRAPHICS_H -#include <vcl/salgdi.hxx> -#ifndef _PSPRINT_FONTMANAGER_HXX -#include <psprint/fontmanager.hxx> -#endif -#include <vcl/sallayout.hxx> -#include <vcl/dllapi.h> - -#ifndef _USE_PRINT_EXTENSION_ +#include "vcl/fontmanager.hxx" +#include "vcl/salgdi.hxx" +#include "vcl/sallayout.hxx" +#include "vcl/dllapi.h" + namespace psp { struct JobData; class PrinterGfx; } -#endif class ServerFont; class ImplDevFontAttributes; diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx index e62b00952663..a4326990c464 100644 --- a/vcl/unx/inc/saldata.hxx +++ b/vcl/unx/inc/saldata.hxx @@ -51,7 +51,7 @@ class SalPrinter; DECLARE_LIST( SalDisplays, SalDisplay* ) -#if defined SCO || defined LINUX || defined NETBSD || defined AIX || defined HPUX || defined FREEBSD || defined MACOSX +#if defined SCO || defined LINUX || defined NETBSD || defined AIX || defined HPUX || defined FREEBSD #include <pthread.h> #else typedef unsigned int pthread_t; diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index d662ce51d855..6e520df97f25 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -283,6 +283,7 @@ DECLARE_LIST( SalFontCache, ExtendedFontStruct* ) extern "C" { struct SnDisplay; struct SnLauncheeContext; + typedef Bool(*X_if_predicate)(Display*,XEvent*,XPointer); } class VCL_DLLPUBLIC SalDisplay @@ -384,9 +385,6 @@ protected: KeySym nShiftKeySym_; // first shift modifier KeySym nCtrlKeySym_; // first control modifier KeySym nMod1KeySym_; // first mod1 modifier -#ifdef MACOSX - KeySym nMod2KeySym_; //first mod2 modifier -#endif ByteString m_aKeyboardName; vcl_sal::WMAdaptor* m_pWMAdaptor; @@ -399,6 +397,8 @@ protected: bool m_bUseRandRWrapper; // don't use randr on gtk, use gdk signals there + mutable XLIB_Time m_nLastUserEventTime; // mutable because changed on first access + void DestroyFontCache(); virtual long Dispatch( XEvent *pEvent ) = 0; void InitXinerama(); @@ -495,6 +495,9 @@ public: bool GetExactResolution() const { return mbExactResolution; } ULONG GetProperties() const { return nProperties_; } ULONG GetMaxRequestSize() const { return nMaxRequestSize_; } + XLIB_Time GetLastUserEventTime( bool bAlwaysReget = false ) const; + + bool XIfEventWithTimeout( XEvent*, XPointer, X_if_predicate, long i_nTimeout = 1000 ) const; BOOL MouseCaptured( const SalFrame *pFrameData ) const { return m_pCapture == pFrameData; } diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 0a5028b764eb..55c8f8303052 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -344,7 +344,7 @@ public: * it is imperative to eat up graphics exposes even in case you don't need * them because the next one using XCopyArea can depend on them */ - static void YieldGraphicsExpose( Display* pDisplay, SalFrame* pFrame, Drawable aDrawable ); + void YieldGraphicsExpose(); // do XCopyArea or XGet/PutImage depending on screen numbers // signature is like XCopyArea with screen numbers added diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index e35774b01f02..c0614a78af9b 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -113,7 +113,8 @@ public: virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); virtual void DestroyMenuItem( SalMenuItem* pItem ); - virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); bool isPrinterInit() const diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h index 51e22dbbe589..452fa5a89387 100644 --- a/vcl/unx/inc/salprn.h +++ b/vcl/unx/inc/salprn.h @@ -31,10 +31,10 @@ #ifndef _SV_SALPRN_H #define _SV_SALPRN_H -#include <psprint/jobdata.hxx> -#include <psprint/printergfx.hxx> -#include <psprint/printerjob.hxx> -#include <vcl/salprn.hxx> +#include "vcl/jobdata.hxx" +#include "vcl/printergfx.hxx" +#include "vcl/printerjob.hxx" +#include "vcl/salprn.hxx" class PspGraphics; diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h index ed9368895f0c..cdf45fd30867 100644 --- a/vcl/unx/inc/salunx.h +++ b/vcl/unx/inc/salunx.h @@ -32,7 +32,7 @@ #define _SALUNX_H // -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#if defined SCO || defined LINUX || defined HPUX || defined FREEBSD || defined NETBSD || defined MACOSX +#if defined SCO || defined LINUX || defined HPUX || defined FREEBSD || defined NETBSD #include <sys/time.h> #elif defined AIX #include <time.h> diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx index 1eec613d7568..a6146748fb8a 100644 --- a/vcl/unx/inc/wmadaptor.hxx +++ b/vcl/unx/inc/wmadaptor.hxx @@ -73,6 +73,7 @@ public: NET_WM_STATE_FULLSCREEN, NET_WM_STRUT, NET_WM_STRUT_PARTIAL, + NET_WM_USER_TIME, NET_WM_WINDOW_TYPE, NET_WM_WINDOW_TYPE_DESKTOP, NET_WM_WINDOW_TYPE_DIALOG, @@ -117,6 +118,7 @@ public: SAL_QUITEVENT, SAL_USEREVENT, SAL_EXTTEXTEVENT, + SAL_GETTIMEEVENT, DTWM_IS_RUNNING, VCL_SYSTEM_SETTINGS, XSETTINGS, @@ -241,6 +243,11 @@ public: int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x ) const; /* + * set _NET_WM_USER_TIME property, if NetWM + */ + virtual void setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const; + + /* * tells whether fullscreen mode is supported by WM */ bool supportsFullScreen() const { return m_aWMAtoms[ NET_WM_STATE_FULLSCREEN ] != 0; } diff --git a/vcl/unx/inc/xsalprn.h b/vcl/unx/inc/xsalprn.h deleted file mode 100644 index ac72454c70ab..000000000000 --- a/vcl/unx/inc/xsalprn.h +++ /dev/null @@ -1,192 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: xsalprn.h,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __salprint_h -#define __salprint_h - - -class String; - -#ifdef __cplusplus -extern "C" { -#endif - -/* printer interface */ -extern int XSalIsDisplay( const Display * ); -extern int XSalIsPrinter( const Display * ); - -/* error handling */ -typedef int (*XSalPrinterErrorHandler)( XErrorEvent * ); - -extern XSalPrinterErrorHandler XSalSetPrinterErrorHandler( XSalPrinterErrorHandler ); - -/* common callbacks */ -typedef void* XSalPointer; -typedef int (*XSalPrinterCallback)( XSalPointer cb_data, XSalPointer client_data ); - -#ifndef _SV_SV_H -#define _SV_SV_H -#define USHORT unsigned short -#include <vcl/prntypes.hxx> -#undef USHORT -#undef _SV_SV_H -#else -#include <vcl/prntypes.hxx> -#endif - -typedef enum Orientation Orientation; - -/* initialize before first use */ -extern void XSalPrinterInit( const String& installPath ); - -typedef unsigned short XSalEnum; -typedef unsigned char XSalBool; - -#define COLOR_SPACE_COLOR 1 -#define COLOR_SPACE_GRAY 0 - -typedef struct -{ - unsigned int nMagic; /* internal data */ - unsigned short nVersion; /* internal data */ - unsigned short nFlags; /* internal data */ - XSalEnum eDriver; /* PostScript, PCL, ... */ - unsigned short nCopies; /* number of copies */ - unsigned short nPaperBin; /* paper bin to use */ - XSalEnum ePaper; /* A4, A5, ... */ - unsigned int nPaperWidth; /* paper width if PAPER_USER */ - unsigned int nPaperHeight; /* paper height if PAPER_USER */ - XSalEnum eOrientation; /* portrait / landscape */ - unsigned int nScale; /* [%] ( 100 => 1:1 ) */ - unsigned short nResolutionX; /* [dots per inch] */ - unsigned short nResolutionY; /* [dots per inch] */ - char sCompatCommand[256];/* current shell command */ - char sPort[256]; /* default shell command */ - char cDriverName[32]; /* Druckertreibername */ - unsigned int nTrailingBytes; /* trailing bytes appended to this structure */ -} XSalPrinterSetup; - -#define XSAL_PRINTER_SETUP_MAGIC 0x0000ede1 -#define WRONG_ENDIANESS_MAGIC 0xe1ed0000 - -/* definition for XSalPrinterSetup.nFlags */ -#define XSALPRINTERSETUP_FLAG_LEVEL_DEFAULT 0x0000 -#define XSALPRINTERSETUP_FLAG_LEVEL 0x000f -#define XSALPRINTERSETUP_FLAG_LEVEL_SHIFT 0 -#define XSALPRINTERSETUP_FLAG_COLOR 0x0010 /* colored bitmaps */ -#define XSALPRINTERSETUP_FLAG_COLOR_DEFAULT 0x0020 -#define XSALPRINTERSETUP_FLAG_COMPRESS 0x0040 /* compress bitmaps */ -#define XSALPRINTERSETUP_FLAG_COMPRESS_DEFAULT 0x0080 /* compress bitmaps */ -#define XSALPRINTERSETUP_FLAG_DEPTH_DEFAULT 0x0700 -#define XSALPRINTERSETUP_FLAG_DEPTH 0x0700 /* depth n = depth 2^n, 6 = 24Bit, 7 = default */ -#define XSALPRINTERSETUP_FLAG_DEPTH_SHIFT 8 - -#define XSALPRINTERSETUP_FLAG_DEFAULT\ - (XSALPRINTERSETUP_FLAG_LEVEL_DEFAULT | \ - XSALPRINTERSETUP_FLAG_COMPRESS_DEFAULT | \ - XSALPRINTERSETUP_FLAG_COLOR_DEFAULT | \ - XSALPRINTERSETUP_FLAG_DEPTH_DEFAULT ) - - -/* XSalPrinterSetup access */ -extern unsigned short XSalGetPrinterDriverId( const char* driverName ); -extern const char* XSalGetPrinterDriverName( unsigned short driverId ); - -extern unsigned short XSalGetLanguageLevel( const XSalPrinterSetup* pSetup ); -extern void XSalGetLanguageLevels( - const XSalPrinterSetup* pSetup, - unsigned short* minLevel, - unsigned short* maxLevel ); -extern void XSalSetLanguageLevel( XSalPrinterSetup* pSetup, unsigned short); - -extern unsigned short XSalGetDepth( const XSalPrinterSetup* pSetup ); -extern void XSalSetDepth( XSalPrinterSetup* pSetup, unsigned short depth ); - -extern XSalEnum XSalGetColorSpace( const XSalPrinterSetup* pSetup ); -extern void XSalSetColorSpace( XSalPrinterSetup* pSetup, XSalEnum space ); - -extern XSalBool XSalGetBmpCompression( const XSalPrinterSetup* pSetup ); -extern void XSalSetBmpCompression( XSalPrinterSetup* pSetup, XSalBool compress ); - -extern XSalEnum XSalGetOrientation( const char* string ); -extern const char* XSalGetOrientationName( XSalEnum eOrientation ); - -extern XSalEnum XSalGetPaper( const char* sPaperName ); -extern const char* XSalGetPaperName( XSalEnum ePaper ); - -/* use XSalInitPrinterSetup to initialize internal data */ -extern void XSalInitPrinterSetup( XSalPrinterSetup* ); -extern void XSalCorrectEndianess( XSalPrinterSetup* ); -extern void XSalSetupPrinterSetup( XSalPrinterSetup*, Display* display, XLIB_Window parent); - - -/* the following two functions set defaults of the profile */ -extern void XSalReadPrinterSetup( XSalPrinterSetup*, const String& rPrinter ); -extern void XSalReadPrinterSetupDefaults( XSalPrinterSetup* ); - - -typedef Display XSalPrinter; /* an XSalPrinter is a Display. Draw into RootWindow */ - - -/* open, change setup and close printer */ -extern XSalPrinter* XSalOpenPrinter( const XSalPrinterSetup * pSetup, const String& rPrinterName, const String& rPrintFile ); -/* XSalSetupPrinter() can setup: Orientation, Copies, Page, PaperBin */ -extern void XSalSetupPrinter( XSalPrinter *, const XSalPrinterSetup * pSetup ); -extern void XSalClosePrinter( XSalPrinter * ); - -typedef struct -{ - int nWidth; /* [dots] drawable area */ - int nHeight; /* [dots] drawable area */ - int nMarginLeft; /* [dots] left margin */ - int nMarginTop; /* [dots] top margin */ - int nMarginRight; /* [dots] right margin */ - int nMarginBottom; /* [dots] bottom margin */ - int nResolutionX; /* [dpi] resolution x */ - int nResolutionY; /* [dpi] resolution y */ -} XSalPageInfo; - -extern void XSalGetPageInfo( - const XSalPrinter* printer, - const XSalPrinterSetup* pSetup, - XSalPageInfo* pPageInfo ); - - -/* printer job control */ -extern int XSalStartDoc( XSalPrinter * printer, const String& jobName ); -extern int XSalStartPage( XSalPrinter * printer ); -extern int XSalEndPage( XSalPrinter * printer ); -extern int XSalEndDoc( XSalPrinter * printer ); -extern int XSalAbortDoc( XSalPrinter * printer ); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx index 9fba669f338d..817fc2781e8c 100644 --- a/vcl/unx/source/app/i18n_ic.cxx +++ b/vcl/unx/source/app/i18n_ic.cxx @@ -340,7 +340,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : if ( mnPreeditStyle != XIMPreeditNone ) { -#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX || defined MACOSX +#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX if ( mpPreeditAttributes != NULL ) #endif mpAttributes = XVaAddToNestedList( mpAttributes, @@ -348,7 +348,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) : } if ( mnStatusStyle != XIMStatusNone ) { -#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX || defined MACOSX +#if defined LINUX || defined FREEBSD || defined NETBSD || defined IRIX if ( mpStatusAttributes != NULL ) #endif mpAttributes = XVaAddToNestedList( mpAttributes, diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx index d4ff59e87864..a47cefcef7dd 100644 --- a/vcl/unx/source/app/i18n_im.cxx +++ b/vcl/unx/source/app/i18n_im.cxx @@ -55,10 +55,6 @@ #include "i18n_im.hxx" #include <i18n_status.hxx> -#ifdef MACOSX -#include <osl/process.h> -#include <tools/string.hxx> -#endif #include <osl/thread.h> using namespace vcl; @@ -253,13 +249,8 @@ SalI18N_InputMethod::SetLocale( const char* pLocale ) char *locale = SetSystemLocale( pLocale ); if ( (!IsXWindowCompatibleLocale(locale)) || IsPosixLocale(locale) ) { - #ifdef MACOSX // MacOS X always uses UTF-8 for the filesystem - osl_setThreadTextEncoding (RTL_TEXTENCODING_UTF8); - locale = SetSystemLocale( "en_US.UTF-8" ); - #else osl_setThreadTextEncoding (RTL_TEXTENCODING_ISO_8859_1); locale = SetSystemLocale( "en_US" ); - #endif #ifdef SOLARIS SetSystemEnvironment( "en_US" ); #endif diff --git a/vcl/unx/source/app/i18n_wrp.cxx b/vcl/unx/source/app/i18n_wrp.cxx index f561e18e0ff0..b3a3ebc8e101 100644 --- a/vcl/unx/source/app/i18n_wrp.cxx +++ b/vcl/unx/source/app/i18n_wrp.cxx @@ -45,10 +45,7 @@ struct XIMArg #include <sal/alloca.h> #include <string.h> -#if !defined(MACOSX) -/* MacOS X doesn't yet support XIM... FIXME */ #include <dlfcn.h> -#endif #include <X11/Xlib.h> #include <X11/Xlibint.h> #include "XIM.h" @@ -66,10 +63,8 @@ typedef XIM (*OpenFunction)(Display*, XrmDatabase, char*, char*, XIMArg*); } /* global variables */ -#if !defined(MACOSX) static void *g_dlmodule = 0; static OpenFunction g_open_im = (OpenFunction)NULL; -#endif /* utility function to transform vararg list into an array of XIMArg */ @@ -213,8 +208,6 @@ XvaOpenIM(Display *display, XrmDatabase rdb, XvaGetArgs( variable, args ); va_end(variable); - /* MacOS X doesn't yet support XIM... FIXME */ -#if !defined(MACOSX) if (!g_dlmodule) { g_dlmodule = dlopen(XIIIMP_LIB, RTLD_LAZY); @@ -235,13 +228,10 @@ XvaOpenIM(Display *display, XrmDatabase rdb, { goto legacy_XIM; } -#endif } // in #if to prevent warning "warning: label 'legacy_XIM' defined but not used" -#if !defined(MACOSX) legacy_XIM: -#endif if (!xim) xim = XOpenIM(display, rdb, res_name, res_class); @@ -257,8 +247,6 @@ Status XvaCloseIM(XIM) { Status s = False; - /* MacOS X doesn't yet support XIM... FIXME */ -#if !defined(MACOSX) if (!g_dlmodule) { /* assuming one XvaOpenIM call */ @@ -267,7 +255,6 @@ Status XvaCloseIM(XIM) g_open_im = (OpenFunction)NULL; s = True; } -#endif return (s); } diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx index 2a78110c35fa..4a2bf13af3e0 100644 --- a/vcl/unx/source/app/keysymnames.cxx +++ b/vcl/unx/source/app/keysymnames.cxx @@ -649,18 +649,7 @@ const char* SalDisplay::GetKeyboardName( BOOL bRefresh ) { XkbDescPtr pXkbDesc = NULL; // try X keyboard extension - #ifdef MACOSX - // FIXME - // XDarwin doesn't yet have very good support for the Xkeyboard extension. - // When we call XkbGetKeyboard(), the XServer throws a message up in the - // console about xkbcomp and files for geometry include. The side effect of - // this is _very_ noticable lag when drawing menus. The file menu, for example, - // takes about 1s to come down on my G4/450 DP and you can see it draw. Therefore - // we are disabling it for the moment until better XDarwin support exists. - if ( 0 ) - #else if( (pXkbDesc = XkbGetKeyboard( GetDisplay(), XkbAllComponentsMask, XkbUseCoreKbd )) ) - #endif { const char* pAtom = NULL; if( pXkbDesc->names->groups[0] ) diff --git a/vcl/unx/source/app/makefile.mk b/vcl/unx/source/app/makefile.mk index 948c2b2de5be..a7f790fd67ab 100644 --- a/vcl/unx/source/app/makefile.mk +++ b/vcl/unx/source/app/makefile.mk @@ -71,6 +71,7 @@ SLOFILES=\ EXCEPTIONSFILES=\ $(SLO)$/wmadaptor.obj \ $(SLO)$/saldata.obj \ + $(SLO)$/salinst.obj \ $(SLO)$/saldisp.obj \ $(SLO)$/i18n_status.obj \ $(SLO)$/i18n_cb.obj \ diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index f18d31890247..b599cf0895eb 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -65,7 +65,7 @@ #ifdef USE_XINERAMA #ifdef USE_XINERAMA_XORG -#if defined(X86) || defined(X86_64) || defined(MACOSX) +#if defined(X86) || defined(X86_64) #include <X11/extensions/Xinerama.h> #endif #elif defined USE_XINERAMA_XSUN @@ -104,6 +104,7 @@ Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*); #include <dtint.hxx> #include <osl/socket.h> +#include <poll.h> using namespace rtl; using namespace vcl_sal; @@ -519,7 +520,8 @@ SalDisplay::SalDisplay( Display *display ) : pDisp_( display ), m_pWMAdaptor( NULL ), m_pDtIntegrator( NULL ), - m_bUseRandRWrapper( true ) + m_bUseRandRWrapper( true ), + m_nLastUserEventTime( CurrentTime ) { #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "SalDisplay::SalDisplay()\n" ); @@ -892,7 +894,7 @@ void SalDisplay::Init() sscanf( pProperties, "%li", &nProperties_ ); else { -#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || defined IRIX || defined MACOSX +#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || defined IRIX nProperties_ |= PROPERTY_FEATURE_Maximize; #endif // Server Bugs & Properties @@ -918,7 +920,7 @@ void SalDisplay::Init() if( GetServerVendor() == vendor_xfree ) { nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor; -#if defined LINUX || defined FREEBSD || defined MACOSX +#if defined LINUX || defined FREEBSD // otherwm and olwm are a kind of default, which are not detected // carefully. if we are running linux (i.e. not netbsd) on an xfree // display, fvwm is most probable the wm to choose, confusing with mwm @@ -1084,9 +1086,6 @@ void SalDisplay::ModifierMapping() nShiftKeySym_ = sal_XModifier2Keysym( pDisp_, pXModMap, ShiftMapIndex ); nCtrlKeySym_ = sal_XModifier2Keysym( pDisp_, pXModMap, ControlMapIndex ); nMod1KeySym_ = sal_XModifier2Keysym( pDisp_, pXModMap, Mod1MapIndex ); -#ifdef MACOSX - nMod2KeySym_ = sal_XModifier2Keysym( pDisp_, pXModMap, Mod2MapIndex ); -#endif // Auf Sun-Servern und SCO-Severn beruecksichtigt XLookupString // nicht den NumLock Modifier. if( (GetServerVendor() == vendor_sun) @@ -1115,25 +1114,12 @@ XubString SalDisplay::GetKeyName( USHORT nKeyCode ) const String aStrMap; if( nKeyCode & KEY_MOD1 ) - { - if( aStrMap.Len() ) - aStrMap += '+'; aStrMap += GetKeyNameFromKeySym( nCtrlKeySym_ ); - } -#ifdef MACOSX - if( nKeyCode & KEY_MOD3 ) - { - aStrMap += GetKeyNameFromKeySym( nMod2KeySym_ ); - } - if( nKeyCode & KEY_MOD2 ) - { - if ( aStrMap.Len() ) - aStrMap += '+' ; -#else if( nKeyCode & KEY_MOD2 ) { -#endif + if( aStrMap.Len() ) + aStrMap += '+'; aStrMap += GetKeyNameFromKeySym( nMod1KeySym_ ); } @@ -2331,6 +2317,7 @@ long SalX11Display::Dispatch( XEvent *pEvent ) ButtonMotionMask, pEvent ) ) ; + m_nLastUserEventTime = pEvent->xmotion.time; break; case PropertyNotify: if( pEvent->xproperty.atom == getWMAdaptor()->getAtom( WMAdaptor::VCL_SYSTEM_SETTINGS ) ) @@ -2358,7 +2345,14 @@ long SalX11Display::Dispatch( XEvent *pEvent ) GetKeyboardName( TRUE ); } break; - + case ButtonPress: + case ButtonRelease: + m_nLastUserEventTime = pEvent->xbutton.time; + break; + case XLIB_KeyPress: + case KeyRelease: + m_nLastUserEventTime = pEvent->xkey.time; + break; default: if ( GetKbdExtension()->UseExtension() @@ -2637,7 +2631,7 @@ void SalDisplay::InitXinerama() } } #elif defined(USE_XINERAMA_XORG) -#if defined( X86 ) || defined( X86_64 ) || defined( MACOSX ) +#if defined( X86 ) || defined( X86_64 ) if( XineramaIsActive( pDisp_ ) ) { int nFramebuffers = 1; @@ -2718,6 +2712,73 @@ void SalDisplay::deregisterFrame( SalFrame* pFrame ) } +extern "C" +{ + static Bool timestamp_predicate( Display*, XEvent* i_pEvent, XPointer i_pArg ) + { + SalDisplay* pSalDisplay = reinterpret_cast<SalDisplay*>(i_pArg); + if( i_pEvent->type == PropertyNotify && + i_pEvent->xproperty.window == pSalDisplay->GetDrawable( pSalDisplay->GetDefaultScreenNumber() ) && + i_pEvent->xproperty.atom == pSalDisplay->getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT ) + ) + return True; + + return False; + } +} + +XLIB_Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const +{ + if( m_nLastUserEventTime == CurrentTime || i_bAlwaysReget ) + { + // get current server time + unsigned char c = 0; + XEvent aEvent; + Atom nAtom = getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT ); + XChangeProperty( GetDisplay(), GetDrawable( GetDefaultScreenNumber() ), + nAtom, nAtom, 8, PropModeReplace, &c, 1 ); + XFlush( GetDisplay() ); + + if( ! XIfEventWithTimeout( &aEvent, (XPointer)this, timestamp_predicate ) ) + { + // this should not happen at all; still sometimes it happens + aEvent.xproperty.time = CurrentTime; + } + + m_nLastUserEventTime = aEvent.xproperty.time; + } + return m_nLastUserEventTime; +} + +bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateData, + X_if_predicate i_pPredicate, long i_nTimeout ) const +{ + /* #i99360# ugly workaround an X11 library bug + this replaces the following call: + XIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ); + */ + bool bRet = true; + + if( ! XCheckIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ) ) + { + // wait for some event to arrive + struct pollfd aFD; + aFD.fd = ConnectionNumber(GetDisplay()); + aFD.events = POLLIN; + aFD.revents = 0; + poll( &aFD, 1, i_nTimeout ); + if( ! XCheckIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ) ) + { + poll( &aFD, 1, i_nTimeout ); // try once more for a packet of events from the Xserver + if( ! XCheckIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ) ) + { + bRet = false; + } + } + } + return bRet; +} + // -=-= SalVisual -=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SalVisual::SalVisual() diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx index 18b24e2cb2f3..c160ea4c2fa5 100644 --- a/vcl/unx/source/app/salinst.cxx +++ b/vcl/unx/source/app/salinst.cxx @@ -35,20 +35,21 @@ #include <stdio.h> #include <stdlib.h> -#include <salunx.h> +#include "salunx.h" -#ifndef _VOS_MUTEX_HXX -#include <vos/mutex.hxx> -#endif -#include <saldata.hxx> -#include <saldisp.hxx> -#include <salinst.h> -#include <salframe.h> -#include <vcl/salwtype.hxx> -#include <vcl/salatype.hxx> -#include <dtint.hxx> -#include <salprn.h> -#include <sm.hxx> +#include "saldata.hxx" +#include "saldisp.hxx" +#include "salinst.h" +#include "salframe.h" +#include "dtint.hxx" +#include "salprn.h" +#include "sm.hxx" + +#include "vcl/salwtype.hxx" +#include "vcl/salatype.hxx" +#include "vcl/helper.hxx" + +#include "vos/mutex.hxx" // ------------------------------------------------------------------------- // @@ -276,3 +277,129 @@ void X11SalInstance::DestroyFrame( SalFrame* pFrame ) { delete pFrame; } + +static void getServerDirectories( std::list< rtl::OString >& o_rFontPaths ) +{ +#ifdef LINUX + /* + * chkfontpath exists on some (RH derived) Linux distributions + */ + static const char* pCommands[] = { + "/usr/sbin/chkfontpath 2>/dev/null", "chkfontpath 2>/dev/null" + }; + ::std::list< ByteString > aLines; + + for( unsigned int i = 0; i < sizeof(pCommands)/sizeof(pCommands[0]); i++ ) + { + FILE* pPipe = popen( pCommands[i], "r" ); + aLines.clear(); + if( pPipe ) + { + char line[1024]; + char* pSearch; + while( fgets( line, sizeof(line), pPipe ) ) + { + int nLen = strlen( line ); + if( line[nLen-1] == '\n' ) + line[nLen-1] = 0; + pSearch = strstr( line, ": " ); + if( pSearch ) + aLines.push_back( pSearch+2 ); + } + if( ! pclose( pPipe ) ) + break; + } + } + + for( ::std::list< ByteString >::iterator it = aLines.begin(); it != aLines.end(); ++it ) + { + if( ! access( it->GetBuffer(), F_OK ) ) + { + o_rFontPaths.push_back( *it ); +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "adding fs dir %s\n", it->GetBuffer() ); +#endif + } + } +#else + (void)o_rFontPaths; +#endif +} + + + +void X11SalInstance::FillFontPathList( std::list< rtl::OString >& o_rFontPaths ) +{ + Display *pDisplay = GetX11SalData()->GetDisplay()->GetDisplay(); + + DBG_ASSERT( pDisplay, "No Display !" ); + if( pDisplay ) + { + // get font paths to look for fonts + int nPaths = 0, i; + char** pPaths = XGetFontPath( pDisplay, &nPaths ); + + bool bServerDirs = false; + for( i = 0; i < nPaths; i++ ) + { + OString aPath( pPaths[i] ); + sal_Int32 nPos = 0; + if( ! bServerDirs + && ( nPos = aPath.indexOf( ':' ) ) > 0 + && ( !aPath.copy(nPos).equals( ":unscaled" ) ) ) + { + bServerDirs = true; + getServerDirectories( o_rFontPaths ); + } + else + { + psp::normPath( aPath ); + o_rFontPaths.push_back( aPath ); + } + } + + if( nPaths ) + XFreeFontPath( pPaths ); + } + + // insert some standard directories + o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/TrueType" ); + o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/Type1" ); + o_rFontPaths.push_back( "/usr/openwin/lib/X11/fonts/Type1/sun" ); + o_rFontPaths.push_back( "/usr/X11R6/lib/X11/fonts/truetype" ); + o_rFontPaths.push_back( "/usr/X11R6/lib/X11/fonts/Type1" ); + + #ifdef SOLARIS + /* cde specials, from /usr/dt/bin/Xsession: here are the good fonts, + the OWfontpath file may contain as well multiple lines as a comma + separated list of fonts in each line. to make it even more weird + environment variables are allowed as well */ + + const char* lang = getenv("LANG"); + if ( lang != NULL ) + { + String aOpenWinDir( String::CreateFromAscii( "/usr/openwin/lib/locale/" ) ); + aOpenWinDir.AppendAscii( lang ); + aOpenWinDir.AppendAscii( "/OWfontpath" ); + + SvFileStream aStream( aOpenWinDir, STREAM_READ ); + + // TODO: replace environment variables + while( aStream.IsOpen() && ! aStream.IsEof() ) + { + ByteString aLine; + aStream.ReadLine( aLine ); + // need an OString for normpath + OString aNLine( aLine ); + psp::normPath( aNLine ); + aLine = aNLine; + // try to avoid bad fonts in some cases + static bool bAvoid = (strncasecmp( lang, "ar", 2 ) == 0) || (strncasecmp( lang, "he", 2 ) == 0) || strncasecmp( lang, "iw", 2 ) == 0 || (strncasecmp( lang, "hi", 2 ) == 0); + if( bAvoid && aLine.Search( "iso_8859" ) != STRING_NOTFOUND ) + continue; + o_rFontPaths.push_back( aLine ); + } + } + #endif /* SOLARIS */ +} + diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index 6c1ae35b7e3d..37015b6e58d6 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -79,6 +79,7 @@ public: int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x ) const; + virtual void setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const; }; class GnomeWMAdaptor : public WMAdaptor @@ -175,11 +176,13 @@ static const WMAdaptorProtocol aAtomTab[] = { "SAL_QUITEVENT", WMAdaptor::SAL_QUITEVENT }, { "SAL_USEREVENT", WMAdaptor::SAL_USEREVENT }, { "SAL_EXTTEXTEVENT", WMAdaptor::SAL_EXTTEXTEVENT }, + { "SAL_GETTIMEEVENT", WMAdaptor::SAL_GETTIMEEVENT }, { "VCL_SYSTEM_SETTINGS", WMAdaptor::VCL_SYSTEM_SETTINGS }, { "DTWM_IS_RUNNING", WMAdaptor::DTWM_IS_RUNNING }, { "_XSETTINGS_SETTINGS", WMAdaptor::XSETTINGS }, { "_XEMBED", WMAdaptor::XEMBED }, - { "_XEMBED_INFO", WMAdaptor::XEMBED_INFO } + { "_XEMBED_INFO", WMAdaptor::XEMBED_INFO }, + { "_NET_WM_USER_TIME", WMAdaptor::NET_WM_USER_TIME } }; extern "C" { @@ -402,12 +405,6 @@ WMAdaptor::WMAdaptor( SalDisplay* pDisplay ) : XFree( pProperty ); } } - -#ifdef MACOSX - /* Apple's X11 needs NW gravity with OOo 1.1 */ - m_nWinGravity = NorthWestGravity; - m_nInitWinGravity = NorthWestGravity; -#endif } /* @@ -2393,3 +2390,28 @@ void NetWMAdaptor::setFrameStruts( X11SalFrame* pFrame, } } +/* + * WMAdaptor::setUserTime + */ +void WMAdaptor::setUserTime( X11SalFrame*, long ) const +{ +} + +/* + * NetWMAdaptor::setUserTime + */ +void NetWMAdaptor::setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const +{ + if( m_aWMAtoms[NET_WM_USER_TIME] ) + { + XChangeProperty( m_pDisplay, + i_pFrame->GetShellWindow(), + m_aWMAtoms[NET_WM_USER_TIME], + XA_CARDINAL, + 32, + PropModeReplace, + (unsigned char*)&i_nUserTime, + 1 + ); + } +} diff --git a/psprint/source/fontmanager/adobeenc.tab b/vcl/unx/source/fontmanager/adobeenc.tab index e4005a87849f..e4005a87849f 100644 --- a/psprint/source/fontmanager/adobeenc.tab +++ b/vcl/unx/source/fontmanager/adobeenc.tab diff --git a/psprint/source/fontmanager/afm_hash.cpp b/vcl/unx/source/fontmanager/afm_hash.cpp index de01d8cd0434..de01d8cd0434 100755 --- a/psprint/source/fontmanager/afm_hash.cpp +++ b/vcl/unx/source/fontmanager/afm_hash.cpp diff --git a/psprint/source/fontmanager/afm_keyword_list b/vcl/unx/source/fontmanager/afm_keyword_list index 263d76bca4d3..263d76bca4d3 100755 --- a/psprint/source/fontmanager/afm_keyword_list +++ b/vcl/unx/source/fontmanager/afm_keyword_list diff --git a/psprint/source/fontmanager/fontcache.cxx b/vcl/unx/source/fontmanager/fontcache.cxx index b2bdbd1f8771..4932f7a771e0 100644 --- a/psprint/source/fontmanager/fontcache.cxx +++ b/vcl/unx/source/fontmanager/fontcache.cxx @@ -29,17 +29,18 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" #include <cstdlib> #include <cstring> -#include <psprint/fontcache.hxx> -#ifndef _OSL_THREAD_H -#include <osl/thread.h> -#endif -#include <unotools/atom.hxx> -#include <tools/stream.hxx> +#include "vcl/fontcache.hxx" + +#include "osl/thread.h" + +#include "unotools/atom.hxx" + +#include "tools/stream.hxx" #include <unistd.h> #include <sys/stat.h> diff --git a/psprint/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index a89591e8618f..c44e082f91bd 100644 --- a/psprint/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -29,11 +29,11 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <psprint/fontmanager.hxx> -#ifndef _PSPRINT_FONTCACHE_HXX_ -#include <psprint/fontcache.hxx> -#endif +#include "precompiled_vcl.hxx" + +#include "vcl/fontmanager.hxx" +#include "vcl/fontcache.hxx" + using namespace psp; #ifdef ENABLE_FONTCONFIG @@ -68,19 +68,17 @@ typedef int FcSetName; #include <cstdio> #include <cstdarg> -#include <unotools/atom.hxx> -#ifndef _OSL_MODULE_H -#include <osl/module.h> -#endif -#ifndef _OSL_THREAD_H -#include <osl/thread.h> -#endif -#ifndef _RTL_USTRBUF_HXX -#include <rtl/ustrbuf.hxx> -#endif -#include <osl/process.h> -#include <rtl/locale.hxx> -#include <sal/alloca.h> + +#include "unotools/atom.hxx" + +#include "osl/module.h" +#include "osl/thread.h" +#include "osl/process.h" + +#include "rtl/ustrbuf.hxx" +#include "rtl/locale.hxx" + +#include "sal/alloca.h" #include <utility> #include <algorithm> diff --git a/psprint/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx index 8fac64dc5b49..73e117550a14 100644 --- a/psprint/source/fontmanager/fontmanager.cxx +++ b/vcl/unx/source/fontmanager/fontmanager.cxx @@ -29,41 +29,42 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" -#define Window XLIB_Window -#define Time XLIB_Time -#include <X11/Xlib.h> -#undef Window -#undef Time #include <unistd.h> #include <sys/stat.h> #include <dirent.h> #include <stdlib.h> #include <osl/thread.h> -#include <unotools/atom.hxx> -#include <psprint/fontmanager.hxx> -#ifndef _PSPRINT_FONTCACHE_HXX_ -#include <psprint/fontcache.hxx> -#endif -#include <tools/urlobj.hxx> -#include <tools/stream.hxx> -#include <psprint/helper.hxx> -#include <osl/file.hxx> -#include <osl/process.h> -#include <psprint/strhelper.hxx> -#include <psprint/ppdparser.hxx> -#include <rtl/tencinfo.h> -#include <tools/debug.hxx> -#include <tools/config.hxx> -#include <i18npool/mslangid.hxx> -#include <rtl/ustrbuf.hxx> -#include <rtl/strbuf.hxx> - - -#include <parseAFM.hxx> + +#include "unotools/atom.hxx" + +#include "vcl/fontmanager.hxx" +#include "vcl/fontcache.hxx" +#include "vcl/helper.hxx" +#include "vcl/strhelper.hxx" +#include "vcl/ppdparser.hxx" +#include "vcl/svdata.hxx" +#include "vcl/salinst.hxx" + +#include "tools/urlobj.hxx" +#include "tools/stream.hxx" +#include "tools/debug.hxx" +#include "tools/config.hxx" + +#include "osl/file.hxx" +#include "osl/process.h" + +#include "rtl/tencinfo.h" +#include "rtl/ustrbuf.hxx" +#include "rtl/strbuf.hxx" + +#include "i18npool/mslangid.hxx" + + +#include "parseAFM.hxx" #define NO_LIST -#include <sft.h> +#include "sft.h" #undef NO_LIST #if OSL_DEBUG_LEVEL > 1 @@ -71,21 +72,21 @@ #include <stdio.h> #endif -#include <sal/alloca.h> +#include "sal/alloca.h" #include <set> #include <hash_set> #include <algorithm> -#include <adobeenc.tab> // get encoding table for AFM metrics +#include "adobeenc.tab" // get encoding table for AFM metrics #ifdef CALLGRIND_COMPILE #include <valgrind/callgrind.h> #endif -#include <comphelper/processfactory.hxx> -#include <com/sun/star/beans/XMaterialHolder.hpp> -#include <com/sun/star/beans/NamedValue.hpp> +#include "comphelper/processfactory.hxx" +#include "com/sun/star/beans/XMaterialHolder.hpp" +#include "com/sun/star/beans/NamedValue.hpp" #define PRINTER_METRICDIR "fontmetric" @@ -2004,52 +2005,6 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const // ------------------------------------------------------------------------- -void PrintFontManager::getServerDirectories() -{ -#ifdef LINUX - /* - * chkfontpath exists on some (RH derived) Linux distributions - */ - static const char* pCommands[] = { - "/usr/sbin/chkfontpath 2>/dev/null", "chkfontpath 2>/dev/null" - }; - ::std::list< ByteString > aLines; - - for( unsigned int i = 0; i < sizeof(pCommands)/sizeof(pCommands[0]); i++ ) - { - FILE* pPipe = popen( pCommands[i], "r" ); - aLines.clear(); - if( pPipe ) - { - char line[1024]; - char* pSearch; - while( fgets( line, sizeof(line), pPipe ) ) - { - int nLen = strlen( line ); - if( line[nLen-1] == '\n' ) - line[nLen-1] = 0; - pSearch = strstr( line, ": " ); - if( pSearch ) - aLines.push_back( pSearch+2 ); - } - if( ! pclose( pPipe ) ) - break; - } - } - - for( ::std::list< ByteString >::iterator it = aLines.begin(); it != aLines.end(); ++it ) - { - if( ! access( it->GetBuffer(), F_OK ) ) - { - m_aFontDirectories.push_back( *it ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "adding fs dir %s\n", it->GetBuffer() ); -#endif - } - } -#endif -} - void PrintFontManager::initFontsAlias() { m_aXLFD_Aliases.clear(); @@ -2113,7 +2068,7 @@ static bool AreFCSubstitutionsEnabled() return ((nDisableBits & 3) == 0); } -void PrintFontManager::initialize( void* pInitDisplay ) +void PrintFontManager::initialize() { #ifdef CALLGRIND_COMPILE CALLGRIND_TOGGLE_COLLECT(); @@ -2197,99 +2152,7 @@ void PrintFontManager::initialize( void* pInitDisplay ) // don't search through many directories fontconfig already told us about if( ! m_bFontconfigSuccess ) - { - Display *pDisplay = (Display*)pInitDisplay; - - if( ! pDisplay ) - { - int nParams = osl_getCommandArgCount(); - OUString aParam; - bool bIsHeadless = false; - for( int i = 0; i < nParams; i++ ) - { - osl_getCommandArg( i, &aParam.pData ); - if( aParam.equalsAscii( "-headless" ) ) - { - bIsHeadless = true; - break; - } - } - if( ! bIsHeadless ) - pDisplay = XOpenDisplay( NULL ); - } - - if( pDisplay ) - { - // get font paths to look for fonts - int nPaths = 0, i; - char** pPaths = XGetFontPath( pDisplay, &nPaths ); - - bool bServerDirs = false; - for( i = 0; i < nPaths; i++ ) - { - OString aPath( pPaths[i] ); - sal_Int32 nPos = 0; - if( ! bServerDirs - && ( nPos = aPath.indexOf( ':' ) ) > 0 - && ( !aPath.copy(nPos).equals( ":unscaled" ) ) ) - { - bServerDirs = true; - getServerDirectories(); - } - else - { - normPath( aPath ); - m_aFontDirectories.push_back( aPath ); - } - } - - if( nPaths ) - XFreeFontPath( pPaths ); - - if( ! pInitDisplay ) - XCloseDisplay( pDisplay ); - } - - // insert some standard directories - m_aFontDirectories.push_back( "/usr/openwin/lib/X11/fonts/TrueType" ); - m_aFontDirectories.push_back( "/usr/openwin/lib/X11/fonts/Type1" ); - m_aFontDirectories.push_back( "/usr/openwin/lib/X11/fonts/Type1/sun" ); - m_aFontDirectories.push_back( "/usr/X11R6/lib/X11/fonts/truetype" ); - m_aFontDirectories.push_back( "/usr/X11R6/lib/X11/fonts/Type1" ); - -#ifdef SOLARIS - /* cde specials, from /usr/dt/bin/Xsession: here are the good fonts, - the OWfontpath file may contain as well multiple lines as a comma - separated list of fonts in each line. to make it even more weird - environment variables are allowed as well */ - - const char* lang = getenv("LANG"); - if ( lang != NULL ) - { - String aOpenWinDir( String::CreateFromAscii( "/usr/openwin/lib/locale/" ) ); - aOpenWinDir.AppendAscii( lang ); - aOpenWinDir.AppendAscii( "/OWfontpath" ); - - SvFileStream aStream( aOpenWinDir, STREAM_READ ); - - // TODO: replace environment variables - while( aStream.IsOpen() && ! aStream.IsEof() ) - { - ByteString aLine; - aStream.ReadLine( aLine ); - // need an OString for normpath - OString aNLine( aLine ); - normPath( aNLine ); - aLine = aNLine; - // try to avoid bad fonts in some cases - static bool bAvoid = (strncasecmp( lang, "ar", 2 ) == 0) || (strncasecmp( lang, "he", 2 ) == 0) || strncasecmp( lang, "iw", 2 ) == 0 || (strncasecmp( lang, "hi", 2 ) == 0); - if( bAvoid && aLine.Search( "iso_8859" ) != STRING_NOTFOUND ) - continue; - m_aFontDirectories.push_back( aLine ); - } - } -#endif /* SOLARIS */ - } // ! m_bFontconfigSuccess + ImplGetSVData()->mpDefInst->FillFontPathList( m_aFontDirectories ); // fill XLFD aliases from fonts.alias files initFontsAlias(); @@ -3279,7 +3142,8 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal analyzeTrueTypeFile( pFont ); } - for( sal_Unicode code = minCharacter; code <= maxCharacter; code++ ) + sal_Unicode code = minCharacter; + do { if( ! pFont->m_pMetrics || ! ( pFont->m_pMetrics->m_aPages[ code >> 11 ] & ( 1 << ( ( code >> 8 ) & 7 ) ) ) ) @@ -3299,7 +3163,8 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal if( it != pFont->m_pMetrics->m_aMetrics.end() ) pArray[ code - minCharacter ] = it->second; } - } + } while( code++ != maxCharacter ); + return true; } diff --git a/psprint/source/helper/helper.cxx b/vcl/unx/source/fontmanager/helper.cxx index 0c24b269f540..2f3821eac7d1 100644 --- a/psprint/source/helper/helper.cxx +++ b/vcl/unx/source/fontmanager/helper.cxx @@ -29,31 +29,26 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" #include <cstring> #include <sys/stat.h> #include <unistd.h> #include <limits.h> -#include "psprint/helper.hxx" -#include "psprint/ppdparser.hxx" +#include "vcl/helper.hxx" +#include "vcl/ppdparser.hxx" #include "tools/string.hxx" #include "tools/urlobj.hxx" #include "osl/file.hxx" #include "osl/process.h" #include "rtl/bootstrap.hxx" -#ifdef MACOSX -// directories of OS X fonts -#define MACXP_FONT_DIR "/Library/Fonts;/System/Library/Fonts;" -#endif - using namespace rtl; namespace psp { -const OUString& getOfficePath( enum whichOfficePath ePath ) +OUString getOfficePath( enum whichOfficePath ePath ) { static OUString aNetPath; static OUString aUserPath; @@ -202,7 +197,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub } } -const OUString& psp::getFontPath() +OUString psp::getFontPath() { static OUString aPath; @@ -210,9 +205,9 @@ const OUString& psp::getFontPath() { OUStringBuffer aPathBuffer( 512 ); - OUString aConfigPath = getOfficePath( psp::ConfigPath ); - OUString aNetPath = getOfficePath( psp::NetPath ); - OUString aUserPath = getOfficePath( psp::UserPath ); + OUString aConfigPath( getOfficePath( psp::ConfigPath ) ); + OUString aNetPath( getOfficePath( psp::NetPath ) ); + OUString aUserPath( getOfficePath( psp::UserPath ) ); if( aConfigPath.getLength() ) { // #i53530# Path from CustomDataUrl will completely @@ -252,21 +247,6 @@ const OUString& psp::getFontPath() aPathBuffer.append( OStringToOUString( aEnvPath, osl_getThreadTextEncoding() ) ); } -#ifdef MACOSX // Search for truetype fonts also in the MACOSX system paths - - aPathBuffer.append(sal_Unicode(';') ); - aPath += OUString( RTL_CONSTASCII_USTRINGPARAM(MACXP_FONT_DIR) ); - - //Userfonts - aPath += aUserPath; - // #i67231# [ericb 07/06] aPath was not concatened with other paths - if (aUserPath.getLength() ) - { - aPathBuffer.append(aPath); - aPathBuffer.appendAscii("/../../Fonts"); - } -#endif // MACOSX - aPath = aPathBuffer.makeStringAndClear(); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "initializing font path to \"%s\"\n", OUStringToOString( aPath, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); diff --git a/psprint/source/fontmanager/makefile.mk b/vcl/unx/source/fontmanager/makefile.mk index 27b1cdad8e7d..c1d1fde15de3 100644 --- a/psprint/source/fontmanager/makefile.mk +++ b/vcl/unx/source/fontmanager/makefile.mk @@ -29,10 +29,10 @@ # #************************************************************************* -PRJ=..$/.. +PRJ=..$/..$/.. ENABLE_EXCEPTIONS=TRUE -PRJNAME=psprint +PRJNAME=vcl TARGET=fontman # --- Settings ----------------------------------------------------- @@ -62,6 +62,7 @@ SLOFILES=\ $(SLO)$/fontmanager.obj \ $(SLO)$/fontcache.obj \ $(SLO)$/fontconfig.obj \ + $(SLO)$/helper.obj \ $(SLO)$/parseAFM.obj .IF "$(OS)$(CPU)"=="SOLARISI" diff --git a/psprint/source/fontmanager/parseAFM.cxx b/vcl/unx/source/fontmanager/parseAFM.cxx index 480b4217503a..0ac4754d4bd5 100644 --- a/psprint/source/fontmanager/parseAFM.cxx +++ b/vcl/unx/source/fontmanager/parseAFM.cxx @@ -53,7 +53,7 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" /* parseAFM.c * @@ -91,9 +91,11 @@ #include <sys/file.h> #include <sys/stat.h> #include <math.h> -#include <parseAFM.hxx> -#include <psprint/strhelper.hxx> -#include <rtl/alloc.h> + +#include "parseAFM.hxx" +#include "vcl/strhelper.hxx" + +#include "rtl/alloc.h" #define lineterm EOL /* line terminating character */ #define normalEOF 1 /* return code from parsing routines used only */ diff --git a/psprint/source/fontmanager/parseAFM.hxx b/vcl/unx/source/fontmanager/parseAFM.hxx index ad0c32e4b51b..ad0c32e4b51b 100644 --- a/psprint/source/fontmanager/parseAFM.hxx +++ b/vcl/unx/source/fontmanager/parseAFM.hxx diff --git a/vcl/unx/source/gdi/dtint.cxx b/vcl/unx/source/gdi/dtint.cxx index 8a67dbe6fcc7..96d78b4f006d 100644 --- a/vcl/unx/source/gdi/dtint.cxx +++ b/vcl/unx/source/gdi/dtint.cxx @@ -44,9 +44,6 @@ #include <cdeint.hxx> #endif #include <dtint.hxx> -#ifdef MACOSX -#include <macosxint.hxx> -#endif #include <saldisp.hxx> #include <saldata.hxx> #include <wmadaptor.hxx> @@ -98,9 +95,6 @@ DtIntegrator::~DtIntegrator() DtIntegrator* DtIntegrator::CreateDtIntegrator() { -#ifdef MACOSX - return new MACOSXIntegrator(); -#endif /* * #i22061# override desktop detection * if environment variable OOO_FORCE_DESKTOP is set diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx index 77e8ccc09a91..85466c532ff2 100644 --- a/vcl/unx/source/gdi/gcach_xpeer.cxx +++ b/vcl/unx/source/gdi/gcach_xpeer.cxx @@ -647,9 +647,6 @@ Glyph X11GlyphPeer::GetGlyphId( ServerFont& rServerFont, int nGlyphIndex ) X11GlyphCache::X11GlyphCache( X11GlyphPeer& rPeer ) : GlyphCache( rPeer ) { -#ifdef MACOSX - LoadFonts(); -#endif } // --------------------------------------------------------------------------- diff --git a/vcl/unx/source/gdi/macosxint.cxx b/vcl/unx/source/gdi/macosxint.cxx deleted file mode 100644 index 5e2a2838ae7f..000000000000 --- a/vcl/unx/source/gdi/macosxint.cxx +++ /dev/null @@ -1,250 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: macosxint.cxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - -#include <macosxint.hxx> -#include <tools/config.hxx> -#include <vcl/settings.hxx> -#include <osl/thread.h> -#include <osl/file.hxx> -#include <rtl/bootstrap.hxx> -#include <unistd.h> -#include <cstdio> - -using namespace rtl; -using namespace osl; - -MACOSXIntegrator::MACOSXIntegrator() -{ - meType = DtMACOSX; -} - -MACOSXIntegrator::~MACOSXIntegrator() -{ -} - -void MACOSXIntegrator::GetSystemLook( AllSettings& rSettings ) -{ - rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); - - StyleSettings aStyleSettings( rSettings.GetStyleSettings() ); - // #i48001# set a default blink rate - aStyleSettings.SetCursorBlinkTime( 500 ); - -// #i61174# aquacolors -// aUserConfigFile : string containing the user install directory completed with "/user/macosxrc.txt" -// currently : ~/Library/Application Support/OpenOffice.org 2.0/user/macosxrc.txt -// aDefaultConfigFile : string containing the OpenOffice.org install directory + presets/macosxrc.txt -// default should be /Applications/OpenOffice.org 2.0/Contents/openoffice.org2/presets/macosxrc.txt - - - rtl::OUString aUserConfigFile; - rtl::OUString aDefaultConfigFile; - rtl::OUString aTryFiles[2]; - -// read the content of bootstraprc is necessary to find the path to the user configuration file -// ~/Library/Application Support/OpenOffice.org 2.0/user/macosxrc.txt - - rtl::Bootstrap aBootstrap( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("bootstraprc") ) ); - if( aBootstrap.getFrom( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacOSXIntegrationUserFile") ), aUserConfigFile ) ) - { - rtl::OUString aFile = aUserConfigFile ; - osl::FileBase::getSystemPathFromFileURL(aFile, aTryFiles[0]); - } - -// if macosxrc.txt is not found in user install dir, fallback to the second macosxrc.txt (with default values), located in <install_dir>/presets - - if( aBootstrap.getFrom( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacOSXIntegrationDefaultFile") ), aDefaultConfigFile ) ) - { - rtl::OUString aFile = aDefaultConfigFile ; - osl::FileBase::getSystemPathFromFileURL(aFile, aTryFiles[1]); - } - - for( unsigned int i = 0; (i < sizeof(aTryFiles) / sizeof(aTryFiles[0])); i++ ) - { - - #if OSL_DEBUG_LEVEL > 1 - fprintf(stderr, "try accessing %d, %s\n", i, rtl::OUStringToOString( aTryFiles[i], aEncoding ).getStr()); - #endif - if( access( rtl::OUStringToOString( aTryFiles[i], aEncoding ).getStr(), R_OK ) ) - continue; - - #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "using %s for style settings\n", rtl::OUStringToOString( aTryFiles[i], aEncoding ).getStr() ); - #endif - - Config aConfig( aTryFiles[i] ); - ByteString aLine; - - if( aConfig.HasGroup( "General" ) ) - { - aConfig.SetGroup( "General" ); - - aLine = aConfig.ReadKey( "foreground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) - { - Color aFore( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - aStyleSettings.SetDialogTextColor( aFore ); - aStyleSettings.SetMenuTextColor( aFore ); - aStyleSettings.SetButtonTextColor( aFore ); - aStyleSettings.SetRadioCheckTextColor( aFore ); - aStyleSettings.SetGroupTextColor( aFore ); - aStyleSettings.SetLabelTextColor( aFore ); - aStyleSettings.SetInfoTextColor( aFore ); - aStyleSettings.SetFieldTextColor( aFore ); - } - - aLine = aConfig.ReadKey( "background" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) - { - Color aBack( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - aStyleSettings.Set3DColors( aBack ); - aStyleSettings.SetFaceColor( aBack ); - aStyleSettings.SetDialogColor( aBack ); - aStyleSettings.SetMenuColor( aBack ); - aStyleSettings.SetMenuBarColor( aBack ); - aStyleSettings.SetLightBorderColor( aBack ); - if( aBack == COL_LIGHTGRAY ) - aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) ); - else - { - Color aColor2 = aStyleSettings.GetLightColor(); - aStyleSettings.SetCheckedColor( - Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2), - (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2), - (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2) - ) ); - } - } - - aLine = aConfig.ReadKey( "selectForeground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) - { - Color aSelectFore( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32()); - - aStyleSettings.SetHighlightTextColor( aSelectFore ); - aStyleSettings.SetMenuHighlightTextColor( aSelectFore ); - } - aLine = aConfig.ReadKey( "selectBackground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) - { - Color aSelectBack( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - - aStyleSettings.SetHighlightColor( aSelectBack ); - aStyleSettings.SetMenuHighlightColor( aSelectBack ); - } - aLine = aConfig.ReadKey( "activeForeground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) { - Color aActiveFore( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - - aStyleSettings.SetActiveTextColor( aActiveFore ); - } - aLine = aConfig.ReadKey( "activeBackground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) { - Color aActiveBack( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - - aStyleSettings.SetActiveColor( aActiveBack ); - aStyleSettings.SetActiveColor2( aActiveBack ); - } - aLine = aConfig.ReadKey( "deactiveForeground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) { - Color aDeactiveFore( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - - aStyleSettings.SetDeactiveTextColor( aDeactiveFore ); - aStyleSettings.SetDisableColor( aDeactiveFore ); - } - aLine = aConfig.ReadKey( "deactiveBackground" ); - if( aLine.GetTokenCount( ',' ) >= 3 ) { - Color aDeactiveBack( aLine.GetToken( 0, ',' ).ToInt32(), - aLine.GetToken( 1, ',' ).ToInt32(), - aLine.GetToken( 2, ',' ).ToInt32() ); - - aStyleSettings.SetDeactiveColor( aDeactiveBack ); - aStyleSettings.SetDeactiveColor2( aDeactiveBack ); - aStyleSettings.SetDeactiveBorderColor( aDeactiveBack ); - aStyleSettings.SetActiveBorderColor( aDeactiveBack ); - } - - aLine = aConfig.ReadKey( "font" ); - if( aLine.Len() ) - { - Font aFont = aStyleSettings.GetAppFont(); - String aFontName( aLine, RTL_TEXTENCODING_UTF8 ); - if( aFontName.GetTokenCount( ',' ) > 0 ) - aFontName = aFontName.GetToken( 0, ',' ); - aFont.SetName( aFontName ); - - aStyleSettings.SetAppFont( aFont ); - aStyleSettings.SetHelpFont( aFont ); - aStyleSettings.SetTitleFont( aFont ); - aStyleSettings.SetFloatTitleFont( aFont ); - aStyleSettings.SetMenuFont( aFont ); - aStyleSettings.SetToolFont( aFont ); - aStyleSettings.SetLabelFont( aFont ); - aStyleSettings.SetInfoFont( aFont ); - aStyleSettings.SetRadioCheckFont( aFont ); - aStyleSettings.SetPushButtonFont( aFont ); - aStyleSettings.SetFieldFont( aFont ); - aStyleSettings.SetIconFont( aFont ); - aStyleSettings.SetGroupFont( aFont ); - } - - aLine = aConfig.ReadKey( "cursorFlashTime" ); - if( aLine.Len() ) - { - sal_Int32 nTime = aLine.ToInt32() / 2; - if( nTime == 0 ) - nTime = STYLE_CURSOR_NOBLINKTIME; - aStyleSettings.SetCursorBlinkTime( nTime ); - } - } - - break; - } - - rSettings.SetStyleSettings( aStyleSettings ); -} - diff --git a/vcl/unx/source/gdi/macosxrc.txt b/vcl/unx/source/gdi/macosxrc.txt deleted file mode 100644 index 55c2c40f67cc..000000000000 --- a/vcl/unx/source/gdi/macosxrc.txt +++ /dev/null @@ -1,33 +0,0 @@ -# -# Configure file for UI colors in OpenOffice.org Mac OS X port -# Created by Mox 2006/01/27 -# This file follows the format of .kderc files -# -# The settings under label [General] are used. Modify it according to -# the other labels, if you want to change it. -# - -[Aqua] -background=244,244,244 -foreground=0,0,0 -selectBackground=52,112,204 -selectForeground=255,255,255 - -[Graphite] -background=244,244,244 -foreground=0,0,0 -selectBackground=94,106,121 -selectForeground=255,255,255 - -[General] -background=244,244,244 -foreground=0,0,0 -selectBackground=52,112,204 -selectForeground=255,255,255 -#comment out if you want to use a customized font -# only one font can be choosen -#font=Andale Mono,Andale Sans UI -# another nice font example -#font=Futura, Futura Sans UI -#Apple recommandation is Lucida Grande -font=Lucida Grande, Futura Sans UI diff --git a/vcl/unx/source/gdi/makefile.mk b/vcl/unx/source/gdi/makefile.mk index 1516cd8ad5a5..8f0faf863af2 100644 --- a/vcl/unx/source/gdi/makefile.mk +++ b/vcl/unx/source/gdi/makefile.mk @@ -73,12 +73,6 @@ EXCEPTIONSFILES=\ $(SLO)$/salgdi3.obj \ $(SLO)$/salcvt.obj - -.IF "$(OS)"=="MACOSX" -SLOFILES += $(SLO)$/macosxint.obj -MACOSXRC = $(MISC)$/macosxrc.txt -.ENDIF # "$(OS)"=="MACOSX" - .IF "$(USE_XPRINT)" == "TRUE" CFLAGS+=-D_USE_PRINT_EXTENSION_=1 SLOFILES+=$(SLO)$/xprintext.obj @@ -115,5 +109,3 @@ $(INCCOM)$/rtsname.hxx: $(SLO)$/salpimpl.obj : $(INCCOM)$/rtsname.hxx $(SLO)$/salprnpsp.obj : $(INCCOM)$/rtsname.hxx -$(MISC)$/macosxrc.txt : $$(@:f) - $(COPY) $< $@ diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 7b8a0f173707..4a4bccd86d2a 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -31,18 +31,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <pspgraphics.h> -#include <psprint/jobdata.hxx> -#include <psprint/printergfx.hxx> -#include <psprint/printerinfomanager.hxx> -#include <vcl/bmpacc.hxx> -#include <vcl/salbmp.hxx> -#include <vcl/glyphcache.hxx> -#include <vcl/impfont.hxx> -#include <vcl/outfont.hxx> -#include <vcl/svapp.hxx> -#include <vcl/salprn.hxx> -#include <vcl/sysdata.hxx> +#include "pspgraphics.h" +#include "vcl/jobdata.hxx" +#include "vcl/printergfx.hxx" +#include "vcl/printerinfomanager.hxx" +#include "vcl/bmpacc.hxx" +#include "vcl/salbmp.hxx" +#include "vcl/glyphcache.hxx" +#include "vcl/impfont.hxx" +#include "vcl/outfont.hxx" +#include "vcl/svapp.hxx" +#include "vcl/salprn.hxx" +#include "vcl/sysdata.hxx" #include <stdlib.h> #include <unistd.h> diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index dabce7c59b9e..1d61dbe214a2 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -33,31 +33,28 @@ #include "Xproto.h" -#include <salunx.h> -#include <saldata.hxx> -#include <saldisp.hxx> -#ifndef _SV_SALGDI_HXX -#include <salgdi.h> -#endif -#include <salframe.h> -#include <salvd.h> -#include <tools/debug.hxx> +#include "salunx.h" +#include "saldata.hxx" +#include "saldisp.hxx" +#include "salgdi.h" +#include "salframe.h" +#include "salvd.h" +#include "xrender_peer.hxx" -#ifndef _USE_PRINT_EXTENSION_ -#include <psprint/printergfx.hxx> -#include <psprint/jobdata.hxx> -#endif +#include "vcl/printergfx.hxx" +#include "vcl/jobdata.hxx" -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> -#include <basegfx/polygon/b2dpolypolygontools.hxx> -#include <basegfx/polygon/b2dpolygontools.hxx> -#include <basegfx/polygon/b2dpolygonclipper.hxx> -#include <basegfx/polygon/b2dlinegeometry.hxx> -#include <basegfx/matrix/b2dhommatrix.hxx> -#include <basegfx/polygon/b2dpolypolygoncutter.hxx> +#include "tools/debug.hxx" + +#include "basegfx/polygon/b2dpolygon.hxx" +#include "basegfx/polygon/b2dpolypolygon.hxx" +#include "basegfx/polygon/b2dpolypolygontools.hxx" +#include "basegfx/polygon/b2dpolygontools.hxx" +#include "basegfx/polygon/b2dpolygonclipper.hxx" +#include "basegfx/polygon/b2dlinegeometry.hxx" +#include "basegfx/matrix/b2dhommatrix.hxx" +#include "basegfx/polygon/b2dpolypolygoncutter.hxx" -#include "xrender_peer.hxx" #include <vector> #include <queue> #include <set> diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index c10abac60bb0..5a01b7f13d39 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -32,22 +32,20 @@ #include "precompiled_vcl.hxx" #include <stdio.h> - -#include <salunx.h> #include <poll.h> -#include <saldata.hxx> -#include <saldisp.hxx> -#include <salbmp.h> -#include <vcl/salbtype.hxx> -#include <salgdi.h> -#include <salframe.h> -#include <salvd.h> -#include <xrender_peer.hxx> - -#ifndef _USE_PRINT_EXTENSION_ -#include <psprint/printergfx.hxx> -#include <vcl/bmpacc.hxx> -#endif + +#include "salunx.h" +#include "saldata.hxx" +#include "saldisp.hxx" +#include "salbmp.h" +#include "salgdi.h" +#include "salframe.h" +#include "salvd.h" +#include "xrender_peer.hxx" + +#include "vcl/salbtype.hxx" +#include "vcl/printergfx.hxx" +#include "vcl/bmpacc.hxx" #undef SALGDI2_TESTTRANS @@ -421,9 +419,12 @@ extern "C" } -void X11SalGraphics::YieldGraphicsExpose( Display* pDisplay, SalFrame* pFrame, Drawable aWindow ) +void X11SalGraphics::YieldGraphicsExpose() { // get frame if necessary + SalFrame* pFrame = m_pFrame; + Display* pDisplay = GetXDisplay(); + XLIB_Window aWindow = GetDrawable(); if( ! pFrame ) { const std::list< SalFrame* >& rFrames = GetX11SalData()->GetDisplay()->getFrames(); @@ -446,24 +447,10 @@ void X11SalGraphics::YieldGraphicsExpose( Display* pDisplay, SalFrame* pFrame, D do { - if( ! XCheckIfEvent( pDisplay, &aEvent, GraphicsExposePredicate, (XPointer)aWindow ) ) - { - // wait for some event to arrive - struct pollfd aFD; - aFD.fd = ConnectionNumber(pDisplay); - aFD.events = POLLIN; - aFD.revents = 0; - poll( &aFD, 1, 1000 ); - if( ! XCheckIfEvent( pDisplay, &aEvent, GraphicsExposePredicate, (XPointer)aWindow ) ) - { - poll( &aFD, 1, 1000 ); // try once more for a packet of events from the Xserver - if( ! XCheckIfEvent( pDisplay, &aEvent, GraphicsExposePredicate, (XPointer)aWindow ) ) - { - // this should not happen at all; still sometimes it happens - break; - } - } - } + if( ! GetDisplay()->XIfEventWithTimeout( &aEvent, (XPointer)aWindow, GraphicsExposePredicate ) ) + // this should not happen at all; still sometimes it happens + break; + if( aEvent.type == NoExpose ) break; @@ -583,7 +570,7 @@ void X11SalGraphics::copyBits( const SalTwoRect *pPosAry, if( bNeedGraphicsExposures ) { - YieldGraphicsExpose( GetXDisplay(), m_pFrame, GetDrawable() ); + YieldGraphicsExpose(); if( pCopyGC ) XSetGraphicsExposures( GetXDisplay(), diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 55bb81ea5d6b..e2c41b52006b 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -40,42 +40,44 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> -#include <sal/alloca.h> - -#include <gcach_xpeer.hxx> -#include <xrender_peer.hxx> -#include <sal/types.h> - -#include <salunx.h> -#include <saldata.hxx> -#include <saldisp.hxx> -#include <salgdi.h> -#include <pspgraphics.h> -#include <vcl/salframe.hxx> -#include <salvd.h> -#include <vcl/outdev.h> -#include <tools/string.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> -#include <rtl/tencinfo.h> -#include <osl/file.hxx> -#include "xfont.hxx" -#include <vcl/impfont.hxx> - -#include <tools/debug.hxx> -#include <tools/stream.hxx> - -#include <psprint/printergfx.hxx> -#include <psprint/fontmanager.hxx> -#include <psprint/jobdata.hxx> -#include <psprint/printerinfomanager.hxx> -#include <vcl/svapp.hxx> +#include "gcach_xpeer.hxx" +#include "xrender_peer.hxx" +#include "salunx.h" +#include "saldata.hxx" +#include "saldisp.hxx" +#include "salgdi.h" +#include "pspgraphics.h" +#include "salvd.h" +#include "xfont.hxx" #include "xlfd_attr.hxx" #include "xlfd_smpl.hxx" #include "xlfd_extd.hxx" #include "salcvt.hxx" -#include <i18npool/mslangid.hxx> +#include "vcl/printergfx.hxx" +#include "vcl/fontmanager.hxx" +#include "vcl/jobdata.hxx" +#include "vcl/printerinfomanager.hxx" +#include "vcl/svapp.hxx" +#include "vcl/impfont.hxx" +#include "vcl/salframe.hxx" +#include "vcl/outdev.h" + +#include "sal/alloca.h" +#include "sal/types.h" + +#include "rtl/tencinfo.h" + +#include "osl/file.hxx" + +#include "tools/string.hxx" +#include "tools/debug.hxx" +#include "tools/stream.hxx" + +#include "basegfx/polygon/b2dpolypolygon.hxx" + +#include "i18npool/mslangid.hxx" #include <hash_set> @@ -795,20 +797,17 @@ CairoWrapper::CairoWrapper() if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) ) return; -#ifdef MACOSX - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" )); -#else OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" )); -#endif mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT ); if( !mpCairoLib ) return; -#if 0 +#ifdef DEBUG // check cairo version int (*p_version)(); p_version = (int(*)()) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_version" ); const int nVersion = p_version ? (*p_version)() : 0; + fprintf( stderr, "CAIRO version=%d\n", nVersion ); #endif mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int )) @@ -1391,10 +1390,8 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer(); if( rGlyphPeer.GetGlyphSet( rFont, m_nScreen ) ) DrawServerAAFontString( rLayout ); -#ifndef MACOSX /* ignore X11 fonts on MACOSX */ else if( !rGlyphPeer.ForcedAntialiasing( rFont, m_nScreen ) ) DrawServerSimpleFontString( rLayout ); -#endif // MACOSX else DrawServerAAForcedString( rLayout ); } diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 965fb2f10209..b3fdfaef56ce 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -47,20 +47,22 @@ #include <unistd.h> #include <sys/wait.h> #include <sys/stat.h> -#include <vcl/svapp.hxx> -#include <vcl/jobset.h> -#include <saldisp.hxx> -#include <salinst.h> -#include <salprn.h> -#include <vcl/print.h> -#include <vcl/salptype.hxx> -#include <salframe.h> -#include <pspgraphics.h> -#include <saldata.hxx> - -#include <rtl/ustring.hxx> -#include <osl/module.h> -#include <psprint/printerinfomanager.hxx> + +#include "saldisp.hxx" +#include "salinst.h" +#include "salprn.h" +#include "salframe.h" +#include "pspgraphics.h" +#include "saldata.hxx" +#include "vcl/svapp.hxx" +#include "vcl/jobset.h" +#include "vcl/print.h" +#include "vcl/salptype.hxx" +#include "vcl/printerinfomanager.hxx" + +#include "rtl/ustring.hxx" + +#include "osl/module.h" using namespace psp; using namespace rtl; @@ -69,7 +71,7 @@ using namespace rtl; * static helpers */ -#include <rtsname.hxx> +#include "rtsname.hxx" static oslModule driverLib = NULL; extern "C" @@ -723,58 +725,13 @@ BOOL PspSalInfoPrinter::SetData( } String aPaper; -#ifdef MACOSX - // For Mac OS X, many printers are directly attached - // USB/Serial printers with a stripped-down PPD that gives us - // problems. We need to do PS->PDF conversion for these printers - // but they are not able to handle multiple page sizes in the same - // document at all, since we must pass -o media=... to them to get - // a good printout. - // So, we must find a match between the paper size from OOo and what - // the PPD of the printer has, and pass that paper size to -o media=... - // If a match cannot be found (ie the paper size from Format->Page is - // nowhere near anything in the PPD), we default to what has been - // chosen in File->Print->Properties. - // - // For printers capable of directly accepting PostScript data, none - // of this occurs and we default to the normal OOo behavior. - const PPDKey *pCupsFilterKey; - const PPDValue *pCupsFilterValue; - BOOL bIsCUPSPrinter = TRUE; - - // Printers that need PS->PDF conversion have a "cupsFilter" key and - // a value of "application/pdf" in that key - pCupsFilterKey = aData.m_pParser->getKey( String(RTL_CONSTASCII_USTRINGPARAM("cupsFilter")) ); - pCupsFilterValue = pCupsFilterKey != NULL ? aData.m_aContext.getValue( pCupsFilterKey ) : NULL; - if ( pCupsFilterValue ) - { - // PPD had a cupsFilter key, check for PS->PDF conversion requirement - ByteString aCupsFilterString( pCupsFilterValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ); - if ( aCupsFilterString.Search("application/pdf") == 0 ) - bIsCUPSPrinter = FALSE; - } + if( pJobSetup->mePaperFormat == PAPER_USER ) + aPaper = aData.m_pParser->matchPaper( + TenMuToPt( pJobSetup->mnPaperWidth ), + TenMuToPt( pJobSetup->mnPaperHeight ) ); else - bIsCUPSPrinter = FALSE; + aPaper = String( ByteString( aPaperTab[ pJobSetup->mePaperFormat ].name ), RTL_TEXTENCODING_ISO_8859_1 ); - if ( TRUE == bIsCUPSPrinter ) - { - // If its a directly attached printer, with a - // stripped down PPD (most OS X printers are) always - // match the paper size. - aPaper = aData.m_pParser->matchPaper( - TenMuToPt( pJobSetup->mnPaperWidth ), - TenMuToPt( pJobSetup->mnPaperHeight ) ); - } - else -#endif - { - if( pJobSetup->mePaperFormat == PAPER_USER ) - aPaper = aData.m_pParser->matchPaper( - TenMuToPt( pJobSetup->mnPaperWidth ), - TenMuToPt( pJobSetup->mnPaperHeight ) ); - else - aPaper = String( ByteString( aPaperTab[ pJobSetup->mePaperFormat ].name ), RTL_TEXTENCODING_ISO_8859_1 ); - } pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) diff --git a/vcl/unx/source/gdi/xprintext.cxx b/vcl/unx/source/gdi/xprintext.cxx deleted file mode 100644 index d43185e34dea..000000000000 --- a/vcl/unx/source/gdi/xprintext.cxx +++ /dev/null @@ -1,656 +0,0 @@ -/************************************************************************ - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: xprintext.cxx,v $ - * $Revision: 1.12 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#if OSL_DEBUG_LEVEL == 0 -#define NDEBUG -#endif -#include <assert.h> - -#include <prex.h> -#include <X11/extensions/Print.h> -#include <postx.h> - -#include <salunx.h> -#include <saldata.hxx> -#include <saldisp.hxx> -#include <vcl/salinst.hxx> -#include <vcl/salprn.hxx> -#include <vcl/salgdi.hxx> -#include <salprn.h> -#include <vcl/print.h> -#include <vcl/jobset.h> -#include "i18n_im.hxx" -#include "i18n_xkb.hxx" - -// ======================================================================= -// -// ImplSalPrinterData -// -// ======================================================================= - - -class ImplSalPrinterData -{ - -private: - - SalDisplay* mpDisplay; - SalGraphics* mpGraphics; - char* mpPrinterName; - Display* mpXDisplay; - XPContext maContext; - Bool XprtConnectStatus; - - -private: - - ImplSalPrinterData( ImplSalPrinterData& rData ); - -public: - - ImplSalPrinterData(); - ~ImplSalPrinterData(); - - void Init( const SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pJobSetup ); - - SalGraphics* GetGraphics(); - void ReleaseGraphics( SalGraphics* pGraphics = NULL ); - XLIB_Window GetDrawable() const { return mpDisplay->GetRootWindow(); } - SalColormap& GetColormap() const { return mpDisplay->GetColormap(); } - Display* GetXDisplay() const { return mpXDisplay; } - XPContext GetXContext() const { return maContext; } - const char* GetPrinter() const { return mpPrinterName; } - XPContext GetContext() const { return maContext; } - Bool GetStatus() const { return XprtConnectStatus; } -}; - -ImplSalPrinterData::ImplSalPrinterData() : - mpDisplay( NULL ), - mpGraphics( NULL ), - mpXDisplay( NULL ), - maContext( NULL ), - mpPrinterName( NULL ), - XprtConnectStatus( FALSE ) -{ - Init(NULL, NULL); -} - -void ImplSalPrinterData::Init( const SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pJobSetup ) -{ - const char *printername = NULL; - - if (mpPrinterName == NULL || strcmp(mpPrinterName,printername)) { - int nCount; - XPContext aContext = NULL; - char *Xprinter = getenv("XPRINTER"); - char *XpDisplayIndex; - if (mpXDisplay == NULL && !XprtConnectStatus) { - - if (Xprinter && (XpDisplayIndex = strchr(Xprinter,'@'))) { - if (Xprinter != XpDisplayIndex && printername == NULL) { - char *defprinter = new char [XpDisplayIndex - Xprinter + 1]; - strncpy(defprinter, Xprinter, XpDisplayIndex - Xprinter); - defprinter[XpDisplayIndex - Xprinter] = '\0'; - printername = defprinter; - } - } - mpXDisplay = GetXpDisplay(); - // If GetXpDisplay() returns NULL (i.e. cannot connect to Xprint server) set XprtConnectStatus to FALSE. - if (mpXDisplay == NULL) { - fprintf(stderr, "Could not connect to Xprint server. Xprinting disabled.\n"); - XprtConnectStatus = FALSE; - } - else { - //fprintf(stderr, "Connected to Xprint server.\n"); - if( getenv( "SAL_SYNCHRONIZE" ) ) - XSynchronize( mpXDisplay, True ); - - if (printername == NULL || mpPrinterName == NULL - || strcmp(mpPrinterName,printername) || maContext == NULL) { - XpRehashPrinterList(mpXDisplay); - XPPrinterList pList = XpGetPrinterList (mpXDisplay, NULL, &nCount); - - for ( int i = 0; i < nCount; i++ ) { - //fprintf (stderr, "Printer %s: %s\n", - //pList[i].name ? pList[i].name : "(null)", - //pList[i].desc ? pList[i].desc : "(null)" ); - if(pList[i].name) - if (printername == NULL || strcmp (pList[i].name, printername) == 0) { - mpPrinterName = strdup( pList[i].name ); - maContext = XpCreateContext ( mpXDisplay, mpPrinterName ); - } - } - XpFreePrinterList (pList); - } - assert(maContext); - XpSetContext (mpXDisplay, maContext); - - // New Sal - if (mpDisplay == NULL) { - mpDisplay = new SalDisplay( mpXDisplay, NULL ); - SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod; - pInputMethod->Invalidate(); - mpDisplay->SetInputMethod( pInputMethod ); - SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( mpXDisplay ); - mpDisplay->SetKbdExtension( pKbdExtension ); - - } - // Connection to Xprint server successful so set XprtConnectStatus to TRUE. - XprtConnectStatus = TRUE; - } - mpGraphics = NULL; - } -} -} - -SalGraphics* -ImplSalPrinterData::GetGraphics() -{ - //If no Xprinter or mpGraphics already set then return NULL. - if ( mpGraphics || !XprtConnectStatus) { - return NULL; - } - mpGraphics = new SalGraphics; - mpGraphics->maGraphicsData.Init( this ); - - return mpGraphics; -} - -void -ImplSalPrinterData::ReleaseGraphics( SalGraphics* pGraphics ) -{ - if ( mpGraphics ) - { - assert( !(pGraphics && pGraphics != mpGraphics) ); - delete mpGraphics; - mpGraphics = NULL; - } -} - -ImplSalPrinterData::~ImplSalPrinterData() -{ - - if ( mpPrinterName != NULL ) - free( mpPrinterName ); - XpDestroyContext(mpXDisplay, maContext); - - delete mpGraphics; - delete mpDisplay; - - if ( mpXDisplay != NULL ) - XCloseDisplay( mpXDisplay ); -} - -// ======================================================================= -// -// SalInfoPrinterData -// -// ======================================================================= - -SalInfoPrinterData::SalInfoPrinterData() -{ - mpImplData = NULL; -} - -SalInfoPrinterData::~SalInfoPrinterData() -{ - delete mpImplData; -} - -void -SalInfoPrinterData::Init( - SalPrinterQueueInfo *pQueueInfo, - ImplJobSetup* pJobSetup ) -{ - mpImplData = new ImplSalPrinterData(); -} - -// ======================================================================= -// -// SalPrinterData -// -// ======================================================================= - -SalPrinterData::SalPrinterData() -{ - mpImplData = NULL; -} - -SalPrinterData::~SalPrinterData() -{ - delete mpImplData; -} - -void -SalPrinterData::Init( SalInfoPrinter *pInfoPrinter ) -{ - mpImplData = new ImplSalPrinterData(); -} - -// ======================================================================= -// -// SalInfoPrinter -// -// ======================================================================= - -SalInfoPrinter::SalInfoPrinter() -{ -} - -SalInfoPrinter::~SalInfoPrinter() -{ -} - -SalGraphics* -SalInfoPrinter::GetGraphics() -{ - return maPrinterData.mpImplData->GetGraphics(); -} - -void -SalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics ) -{ - maPrinterData.mpImplData->ReleaseGraphics( pGraphics ); -} - -BOOL -SalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) -{ - pJobSetup->mePaperFormat = PAPER_A4; - pJobSetup->mnPaperWidth = 21000; - pJobSetup->mnPaperHeight = 29700; - pJobSetup->meOrientation = ORIENTATION_PORTRAIT; - return TRUE; -} - -BOOL -SalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) -{ - pJobSetup->mePaperFormat = PAPER_A4; - pJobSetup->mnPaperWidth = 21000; - pJobSetup->mnPaperHeight = 29700; - pJobSetup->meOrientation = ORIENTATION_PORTRAIT; - return TRUE; -} - -BOOL -SalInfoPrinter::SetData( ULONG nSetDataFlags, ImplJobSetup* pJobSetup ) -{ - pJobSetup->mePaperFormat = PAPER_A4; - pJobSetup->mnPaperWidth = 21000; - pJobSetup->mnPaperHeight = 29700; - pJobSetup->meOrientation = ORIENTATION_PORTRAIT; - return TRUE; -} - -void -SalInfoPrinter::GetPageInfo( const ImplJobSetup* pImplJobSetup, - long& rOutWidth, long& rOutHeight, - long& rPageOffX, long& rPageOffY, - long& rPageWidth, long& rPageHeight ) -{ - rPageWidth = 2550; - rPageHeight = 3300; - rPageOffX = 75; - rPageOffY = 75; - rOutWidth = rPageWidth - rPageOffX - 75; - rOutHeight = rPageHeight- rPageOffY - 75; -} - -ULONG -SalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) -{ - return 1; -} - -XubString -SalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, - ULONG nPaperBin ) -{ - return(XubString(RTL_CONSTASCII_USTRINGPARAM("PaperBinName"))); - // return "PaperBinName"; -} - -ULONG -SalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, USHORT nType ) -{ - return 0; -} - -// ======================================================================= -// -// SalPrinter -// -// ======================================================================= - -SalPrinter::SalPrinter() -{ -} - -SalPrinter::~SalPrinter() -{ -} - -BOOL -SalPrinter::StartJob( - const XubString* pFileName, - const XubString& rJobName, - const XubString& rAppName, - ULONG nCopies, BOOL bCollate, - ImplJobSetup* pJobSetup ) -{ - Display *pDisplay = maPrinterData.mpImplData->GetXDisplay(); - XPContext aContext = maPrinterData.mpImplData->GetXContext(); - const char* pPrinterName = maPrinterData.mpImplData->GetPrinter(); - - XpSelectInput (pDisplay, aContext, XPPrintMask); - - char pJobName[ 64 ]; - snprintf (pJobName, sizeof(pJobName), "%s.job-name: XPrint%d", pPrinterName, getpid() ); - - XpStartJob( pDisplay, XPSpool ); - - return TRUE; -} - -BOOL -SalPrinter::EndJob() -{ - Display *pDisplay = maPrinterData.mpImplData->GetXDisplay(); - XEvent aEvent;; - - XpEndJob( pDisplay ); - XSync( pDisplay, False ); - // Wait until printing is done - do - { - // XNextEvent (pDisplay, &aEvent); - } - while ( 0 ); - // aEvent.type != XPPrintNotify - // && ((XPPrintEvent *) (&aEvent))->detail != XPEndJobNotify); - - return TRUE; -} - -BOOL -SalPrinter::AbortJob() -{ - return FALSE; -} - -SalGraphics* -SalPrinter::StartPage( ImplJobSetup* pJobSetup, BOOL bNewJobData ) -{ - Display *pDisplay = maPrinterData.mpImplData->GetXDisplay(); - SalGraphics *pGraphics = maPrinterData.mpImplData->GetGraphics(); - - Drawable aDrawable = pGraphics->maGraphicsData.GetDrawable(); - XPContext nContext = maPrinterData.mpImplData->GetContext(); - - unsigned short nWidth, nHeight; - XRectangle aArea; - Status nState = XpGetPageDimensions( pDisplay, nContext, - &nWidth, &nHeight, &aArea ); - //fprintf(stderr, "PageSize = %ix%i (%i,%i %ix%i)\n", nWidth, nHeight, - // aArea.x,aArea.y, aArea.width, aArea.height ); - XResizeWindow( pDisplay, aDrawable, nWidth, nHeight ); - XpStartPage ( pDisplay, aDrawable ); - - return pGraphics; -} - -BOOL -SalPrinter::EndPage() -{ - Display *pDisplay = maPrinterData.mpImplData->GetXDisplay(); - XpEndPage ( pDisplay ); - - maPrinterData.mpImplData->ReleaseGraphics(); - - return TRUE; -} - -ULONG -SalPrinter::GetErrorCode() -{ - return 0; -} - -// ======================================================================= -// -// SalInstance -// -// ======================================================================= - -SalInfoPrinter* -SalInstance::CreateInfoPrinter( - SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pSetup ) -{ - // create and initialize SalInfoPrinter - SalInfoPrinter* pPrinter = new SalInfoPrinter; - pPrinter->maPrinterData.Init( pQueueInfo, pSetup ); - - pSetup->mePaperFormat = PAPER_A4; // Papierformat - pSetup->mnPaperWidth = 21000; // Papierbreite in 100tel mm - pSetup->mnPaperHeight = 29700; // Papierhoehe in 100tel mm - - return pPrinter; -} - -void -SalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) -{ - delete pPrinter; -} - -SalPrinter* -SalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) -{ - // create and initialize SalPrinter - SalPrinter* pPrinter = new SalPrinter; - pPrinter->maPrinterData.Init( pInfoPrinter ); - - return pPrinter; -} - -void -SalInstance::DestroyPrinter( SalPrinter* pPrinter ) -{ - delete pPrinter; -} - - -void -SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) -{ - // Neuen Eintrag anlegen - int nCount; - Display *XprtDisp = GetXpDisplay(); - if (XprtDisp == NULL) { - fprintf(stderr, "Could not connect to Xprint server. Xprinting disabled.\n"); - return; - } - else { - XpRehashPrinterList(XprtDisp); - XPPrinterList XpList = XpGetPrinterList(XprtDisp, NULL, &nCount); - - SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; - String Name(XpList[0].name, RTL_TEXTENCODING_UTF8); - pInfo->maPrinterName = XubString(Name); - pInfo->maDriver = XubString(RTL_CONSTASCII_USTRINGPARAM("X Printer")); - pInfo->maLocation = XubString(RTL_CONSTASCII_USTRINGPARAM("X Printer")); - pInfo->maComment = XubString(RTL_CONSTASCII_USTRINGPARAM("X Printer")); - pInfo->mpSysData = NULL; - pList->Add( pInfo ); - - XpFreePrinterList(XpList); - } -} - -void -SalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) -{ - return; -} - -void -SalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) -{ - delete pInfo; -} - -XubString -SalInstance::GetDefaultPrinter() -{ - Display *XprtDisp = GetXpDisplay(); - int nCount; - if (XprtDisp == NULL) - return XubString(RTL_CONSTASCII_USTRINGPARAM("No Default")); - else { - XpRehashPrinterList(XprtDisp); - XPPrinterList XpList = XpGetPrinterList(XprtDisp, NULL, &nCount); - - String Name( XpList[0].name, RTL_TEXTENCODING_UTF8 ); - XpFreePrinterList(XpList); - return (XubString(Name)); - } - - //return(XubString(RTL_CONSTASCII_USTRINGPARAM("X Printer"))); - // return "X Printer"; -} - -// ======================================================================= -// -// SalGraphicsData -// -// ======================================================================= - -void SalGraphicsData::Init(ImplSalPrinterData *pPrinter) -{ -if (pPrinter->GetStatus()) { - xColormap_ = &(pPrinter->GetColormap()); - hDrawable_ = pPrinter->GetDrawable(); - //pGCCache_ = pPrinter->GetGCCache(); - - bPrinter_ = TRUE; - - nPenPixel_ = GetPixel( nPenColor_ ); - nTextPixel_ = GetPixel( nTextColor_ ); - nBrushPixel_ = GetPixel( nBrushColor_ ); -} -else - bPrinter_ = FALSE; - -} - -// ======================================================================= -// -// Utility Functions -// -// ======================================================================= - -// GetXpDisplay(). -// Finds and returns the Xprint display. First looks at environment variable XPRINTER -// which should be in the form <printername>@<host>:<display number>. If not defined, -// then environment variable XPDISPLAY is checked. It should be in the form -// <host>:<display number>. If it is not defined it is set by default to ":1". If an -// Xprint server is found then a pointer to Display is returned, otherwise NULL. This -// function can be used by other functions to determine the current Xprint server display. - -// [ed] 6/15/02 We've got some linkage errors with this function on OS X, -// perhaps due to mismatched prototypes. Let's take a quick route to the finish -// line and declare it C linkage! +++ FIXME -#ifdef MACOSX -extern "C" -#endif -Display* -GetXpDisplay() -{ - char *XpDisplayName=NULL; - Display *XpDisplay; - if (getenv("XPRINTER")) { - XpDisplayName=strchr(getenv("XPRINTER"),'@'); - if (XpDisplayName != NULL) { - XpDisplayName++; - } - } - else { - if (!getenv("XPDISPLAY")) - putenv("XPDISPLAY=:1"); - XpDisplayName=getenv("XPDISPLAY"); - } - XpDisplay=XOpenDisplay(XpDisplayName); - if (XpDisplay==NULL || !XSalIsPrinter(XpDisplay)) { - return NULL; - } - else { - return XpDisplay; - } -} - -// [ed] 6/15/02 We've got some linkage errors with this function on OS X, -// perhaps due to mismatched prototypes. Let's take a quick route to the finish -// line and declare it C linkage! +++ FIXME -#ifdef MACOSX -extern "C" -#endif -Bool -XSalIsPrinter( Display * display ) -{ - int nEventBase; - int nErrorBase; - - Bool bPrinter = XpQueryExtension( display, &nEventBase, &nErrorBase ); - return bPrinter; -} - -// [ed] 6/15/02 We've got some linkage errors with this function on OS X, -// perhaps due to mismatched prototypes. Let's take a quick route to the finish -// line and declare it C linkage! +++ FIXME -#ifdef MACOSX -extern "C" -#endif -Bool -XSalIsDisplay( Display * display ) -{ - return !XSalIsPrinter( display ); -} - diff --git a/vcl/unx/source/gdi/xrender_peer.cxx b/vcl/unx/source/gdi/xrender_peer.cxx index 9f6e583ec723..861bf0e454aa 100644 --- a/vcl/unx/source/gdi/xrender_peer.cxx +++ b/vcl/unx/source/gdi/xrender_peer.cxx @@ -82,11 +82,7 @@ void XRenderPeer::InitRenderLib() // we don't know if we are running on a system with xrender library // we don't want to install system libraries ourselves // => load them dynamically when they are there -#ifdef MACOSX - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libXrender.dylib" )); -#else OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libXrender.so.1" )); -#endif mpRenderLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT ); if( !mpRenderLib ) { #ifdef DEBUG diff --git a/psprint/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx index 99d180d49fc1..d0c7f184fb06 100644 --- a/psprint/source/printer/cupsmgr.cxx +++ b/vcl/unx/source/printer/cupsmgr.cxx @@ -29,7 +29,7 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" #ifdef ENABLE_CUPS #include <cups/cups.h> @@ -43,23 +43,19 @@ typedef void cups_option_t; #include <unistd.h> -#include <osl/thread.h> -#include <osl/diagnose.h> -#include <osl/conditn.hxx> -#include <rtl/ustrbuf.hxx> -#include <cupsmgr.hxx> +#include "cupsmgr.hxx" -#include <algorithm> +#include "osl/thread.h" +#include "osl/diagnose.h" +#include "osl/conditn.hxx" + +#include "rtl/ustrbuf.hxx" +#include <algorithm> #include <setjmp.h> #include <signal.h> -// FIXME: SAL_MODULENAME_WITH_VERSION needs to be fixed on OS X -#ifdef MACOSX -#define CUPS_LIB_NAME "libcups.2.dylib" -#else #define CUPS_LIB_NAME "libcups.so.2" -#endif namespace psp { diff --git a/psprint/source/printer/jobdata.cxx b/vcl/unx/source/printer/jobdata.cxx index a86fc82fb953..51e171d578d9 100644 --- a/psprint/source/printer/jobdata.cxx +++ b/vcl/unx/source/printer/jobdata.cxx @@ -29,12 +29,14 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" -#include <psprint/jobdata.hxx> -#include <psprint/printerinfomanager.hxx> -#include <tools/stream.hxx> -#include <sal/alloca.h> +#include "vcl/jobdata.hxx" +#include "vcl/printerinfomanager.hxx" + +#include "tools/stream.hxx" + +#include "sal/alloca.h" using namespace psp; using namespace rtl; diff --git a/psprint/source/printer/makefile.mk b/vcl/unx/source/printer/makefile.mk index 02797867d49c..df184adc00fa 100644 --- a/psprint/source/printer/makefile.mk +++ b/vcl/unx/source/printer/makefile.mk @@ -29,10 +29,10 @@ # #************************************************************************* -PRJ=..$/.. +PRJ=..$/..$/.. ENABLE_EXCEPTIONS=TRUE -PRJNAME=psprint +PRJNAME=vcl TARGET=printer # --- Settings ----------------------------------------------------- @@ -53,6 +53,7 @@ dummy: .ELSE # "$(GUIBASE)"=="aqua" SLOFILES=\ + $(SLO)$/ppdparser.obj \ $(SLO)$/printerinfomanager.obj \ $(SLO)$/jobdata.obj \ $(SLO)$/cupsmgr.obj diff --git a/psprint/source/helper/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index a76d40ff547a..1caf64ef7e2c 100644 --- a/psprint/source/helper/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -29,17 +29,18 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" + #include <stdlib.h> #include <stdio.h> #include <hash_map> -#include "psprint/ppdparser.hxx" -#include "tools/debug.hxx" -#include "psprint/strhelper.hxx" -#include "psprint/helper.hxx" +#include "vcl/ppdparser.hxx" +#include "vcl/strhelper.hxx" +#include "vcl/helper.hxx" #include "cupsmgr.hxx" +#include "tools/debug.hxx" #include "tools/urlobj.hxx" #include "tools/stream.hxx" #include "tools/zcodec.hxx" @@ -635,25 +636,6 @@ PPDParser::PPDParser( const String& rFile ) : m_nLanguageLevel = pKey->getValue( 0 )->m_aValue.ToInt32(); if( (pKey = getKey( String( RTL_CONSTASCII_USTRINGPARAM( "TTRasterizer" ) ) )) ) m_bType42Capable = pKey->getValue( 0 )->m_aValue.EqualsIgnoreCaseAscii( "Type42" ) ? true : false; - -#ifdef MACOSX - // Many Mac OS X PPDs for inkjet printers simply use CUPS to convert the output to a PDF, - // and to take advantage of that we wish to embed fonts for these printers even if its - // minimal CUPS PPD doesn't have TTRasterizer. - // To determine if this printer is supposed to take PDF input, look for the "cupsFilter" key, - // and if it exists, for the string "application/pdf" which specifies the CUPS filter to use for it - // If present, we assume that we can embed TrueType fonts and that the CUPS filter will take care - // of rasterizing them appropriately. - if ( m_bType42Capable == false ) - { - if ( ( pKey = getKey( String(RTL_CONSTASCII_USTRINGPARAM("cupsFilter")) ) ) ) - { - ByteString aCupsFilterString( pKey->getValue( 0 )->m_aValue, RTL_TEXTENCODING_ISO_8859_1 ); - if ( strstr(aCupsFilterString.GetBuffer(), "application/pdf") > 0 ) - m_bType42Capable = true; - } - } -#endif } PPDParser::~PPDParser() diff --git a/psprint/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index 41cddc6f4354..cf5a4a886c41 100644 --- a/psprint/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -29,28 +29,26 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" +#include "precompiled_vcl.hxx" #include <unistd.h> #include <sys/wait.h> #include <signal.h> -#include <tools/urlobj.hxx> -#include <tools/stream.hxx> -#include <tools/debug.hxx> -#include <tools/config.hxx> -#include <cupsmgr.hxx> -#include <psprint/fontmanager.hxx> -#include <psprint/strhelper.hxx> -#include <rtl/strbuf.hxx> - -#include <osl/thread.hxx> -#include <osl/mutex.hxx> -#include <osl/process.h> - -#ifdef MACOSX -#include <sys/stat.h> -#endif +#include "cupsmgr.hxx" +#include "vcl/fontmanager.hxx" +#include "vcl/strhelper.hxx" + +#include "tools/urlobj.hxx" +#include "tools/stream.hxx" +#include "tools/debug.hxx" +#include "tools/config.hxx" + +#include "rtl/strbuf.hxx" + +#include "osl/thread.hxx" +#include "osl/mutex.hxx" +#include "osl/process.h" // filename of configuration files #define PRINT_FILENAME "psprint.conf" @@ -1275,7 +1273,7 @@ struct SystemCommandParameters tokenHandler pHandler; }; -#if ! (defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX)) +#if ! (defined(LINUX) || defined(NETBSD) || defined(FREEBSD)) static void lpgetSysQueueTokenHandler( const std::list< rtl::OString >& i_rLines, std::list< PrinterInfoManager::SystemPrintQueue >& o_rQueues, @@ -1420,7 +1418,7 @@ static void standardSysQueueTokenHandler( static const struct SystemCommandParameters aParms[] = { - #if defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) + #if defined(LINUX) || defined(NETBSD) || defined(FREEBSD) { "/usr/sbin/lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler }, { "lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0, standardSysQueueTokenHandler }, { "LANG=C;LC_ALL=C;export LANG LC_ALL;lpstat -s", "lp -d \"(PRINTER)\"", "system for ", ": ", 1, standardSysQueueTokenHandler } diff --git a/psprint/source/printergfx/bitmap_gfx.cxx b/vcl/unx/source/printergfx/bitmap_gfx.cxx index d5889f36a0f7..b1ec82aa17e2 100644 --- a/psprint/source/printergfx/bitmap_gfx.cxx +++ b/vcl/unx/source/printergfx/bitmap_gfx.cxx @@ -29,10 +29,12 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <psprint/printergfx.hxx> -#include <psprint/strhelper.hxx> -#include <psputil.hxx> +#include "precompiled_vcl.hxx" + +#include "psputil.hxx" + +#include "vcl/printergfx.hxx" +#include "vcl/strhelper.hxx" namespace psp { diff --git a/psprint/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx index 70342de05222..632f0d70aa2f 100644 --- a/psprint/source/printergfx/common_gfx.cxx +++ b/vcl/unx/source/printergfx/common_gfx.cxx @@ -29,20 +29,20 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <psprint/printergfx.hxx> -#include <psprint/printerjob.hxx> -#include <psprint/fontmanager.hxx> -#include <psputil.hxx> -#include <glyphset.hxx> -#include <psprint/strhelper.hxx> -#include <psprint/printerinfomanager.hxx> - -#include <tools/debug.hxx> -#include <tools/color.hxx> -#ifndef _POLY_HXX -#include <tools/poly.hxx> -#endif +#include "precompiled_vcl.hxx" + +#include "psputil.hxx" +#include "glyphset.hxx" + +#include "vcl/printergfx.hxx" +#include "vcl/printerjob.hxx" +#include "vcl/fontmanager.hxx" +#include "vcl/strhelper.hxx" +#include "vcl/printerinfomanager.hxx" + +#include "tools/debug.hxx" +#include "tools/color.hxx" +#include "tools/poly.hxx" using namespace psp ; diff --git a/psprint/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx index 0982ea2d93c6..0d26a66cac2f 100644 --- a/psprint/source/printergfx/glyphset.cxx +++ b/vcl/unx/source/printergfx/glyphset.cxx @@ -29,25 +29,27 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <osl/thread.h> -#include <glyphset.hxx> -#include <psputil.hxx> -#include <psprint/printergfx.hxx> -#include <psprint/fontmanager.hxx> -#ifndef __SGI_STL_SET -#include <set> -#endif -#include <map> -#include <sal/alloca.h> -#include <rtl/ustring.hxx> -#include <rtl/strbuf.hxx> +#include "precompiled_vcl.hxx" + +#include "glyphset.hxx" +#include "psputil.hxx" -#ifndef __SUBFONT_H #define NO_LIST -#include <../fontsubset/sft.h> +#include "sft.h" #undef NO_LIST -#endif + +#include "vcl/printergfx.hxx" +#include "vcl/fontmanager.hxx" + +#include "osl/thread.h" + +#include "sal/alloca.h" + +#include "rtl/ustring.hxx" +#include "rtl/strbuf.hxx" + +#include <set> +#include <map> using namespace psp; using namespace rtl; diff --git a/psprint/source/printergfx/glyphset.hxx b/vcl/unx/source/printergfx/glyphset.hxx index aff6424d996b..f4cd15a56ae6 100644 --- a/psprint/source/printergfx/glyphset.hxx +++ b/vcl/unx/source/printergfx/glyphset.hxx @@ -31,13 +31,15 @@ #ifndef _PSPRINT_GLYPHSET_HXX_ #define _PSPRINT_GLYPHSET_HXX_ -#include <psprint/fontmanager.hxx> -#include <osl/file.hxx> -#include <rtl/string.hxx> -#include <tools/gen.hxx> -#ifndef __SGI_STL_LIST +#include "vcl/fontmanager.hxx" + +#include "osl/file.hxx" + +#include "rtl/string.hxx" + +#include "tools/gen.hxx" + #include <list> -#endif #include <hash_map> namespace psp { diff --git a/psprint/source/printergfx/makefile.mk b/vcl/unx/source/printergfx/makefile.mk index 438c591a5d67..6de3e9bfe3bb 100644 --- a/psprint/source/printergfx/makefile.mk +++ b/vcl/unx/source/printergfx/makefile.mk @@ -29,10 +29,10 @@ # #************************************************************************* -PRJ=..$/.. +PRJ=..$/..$/.. -PRJNAME=psprint -TARGET=gfx +PRJNAME=vcl +TARGET=printergfx # --- Settings ----------------------------------------------------- diff --git a/psprint/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 2823d0f928a7..783dd5ff2b47 100644 --- a/psprint/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -29,21 +29,7 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" - -#ifndef __SGI_STL_VECTOR -#include <vector> -#endif -#include <psprint/printerjob.hxx> -#include <psprint/ppdparser.hxx> -#include <psprint/strhelper.hxx> -#include <psprint/printerinfomanager.hxx> -#include <psprint/printergfx.hxx> -#include <psputil.hxx> -#include <rtl/ustring.hxx> -#include <rtl/strbuf.hxx> -#include <rtl/ustrbuf.hxx> -#include <osl/thread.h> +#include "precompiled_vcl.hxx" #include <stdio.h> #include <sys/types.h> @@ -51,12 +37,26 @@ #include <fcntl.h> #include <unistd.h> #include <pwd.h> -#include <sal/alloca.h> - -#include <algorithm> +#include "psputil.hxx" #include "glyphset.hxx" +#include "vcl/printerjob.hxx" +#include "vcl/ppdparser.hxx" +#include "vcl/strhelper.hxx" +#include "vcl/printerinfomanager.hxx" +#include "vcl/printergfx.hxx" + +#include "rtl/ustring.hxx" +#include "rtl/strbuf.hxx" +#include "rtl/ustrbuf.hxx" + +#include "osl/thread.h" +#include "sal/alloca.h" + +#include <algorithm> +#include <vector> + using namespace psp; using namespace rtl; diff --git a/psprint/source/printergfx/psheader.ps b/vcl/unx/source/printergfx/psheader.ps index 7b947b3a470b..7b947b3a470b 100644 --- a/psprint/source/printergfx/psheader.ps +++ b/vcl/unx/source/printergfx/psheader.ps diff --git a/psprint/source/printergfx/psputil.cxx b/vcl/unx/source/printergfx/psputil.cxx index 4520be0b1310..0b92f4ee423d 100644 --- a/psprint/source/printergfx/psputil.cxx +++ b/vcl/unx/source/printergfx/psputil.cxx @@ -29,11 +29,13 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include "psputil.hxx" +#include "precompiled_vcl.hxx" #include <string.h> -#include <tools/debug.hxx> + +#include "psputil.hxx" + +#include "tools/debug.hxx" namespace psp { diff --git a/psprint/source/printergfx/psputil.hxx b/vcl/unx/source/printergfx/psputil.hxx index 879d9ae4732f..b3227962e8a0 100644 --- a/psprint/source/printergfx/psputil.hxx +++ b/vcl/unx/source/printergfx/psputil.hxx @@ -31,11 +31,12 @@ #ifndef _PSPRINT_PRINTERUTIL_HXX_ #define _PSPRINT_PRINTERUTIL_HXX_ -#include <osl/file.hxx> -#include <rtl/ustring.hxx> -#include <rtl/string.hxx> -#include <rtl/tencinfo.h> -#include <rtl/textcvt.h> +#include "osl/file.hxx" + +#include "rtl/ustring.hxx" +#include "rtl/string.hxx" +#include "rtl/tencinfo.h" +#include "rtl/textcvt.h" #include <map> diff --git a/psprint/source/printergfx/text_gfx.cxx b/vcl/unx/source/printergfx/text_gfx.cxx index a0c44858ab5b..e9c173682f87 100644 --- a/psprint/source/printergfx/text_gfx.cxx +++ b/vcl/unx/source/printergfx/text_gfx.cxx @@ -29,16 +29,21 @@ ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_psprint.hxx" -#include <psprint/printergfx.hxx> -#include <psprint/fontmanager.hxx> -#include <psprint/helper.hxx> -#include "psputil.hxx" -#include <glyphset.hxx> -#include <osl/thread.h> -#include <sal/alloca.h> +#include "precompiled_vcl.hxx" + #include <math.h> +#include "psputil.hxx" +#include "glyphset.hxx" + +#include "vcl/printergfx.hxx" +#include "vcl/fontmanager.hxx" +#include "vcl/helper.hxx" + +#include "osl/thread.h" + +#include "sal/alloca.h" + using namespace psp ; namespace psp { diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 157558f28125..8f2bccebc443 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -35,42 +35,43 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include <sal/alloca.h> -#include <prex.h> +#include "prex.h" #include <X11/Xatom.h> #include <X11/keysym.h> -#include <FWS.hxx> +#include "FWS.hxx" #include <X11/extensions/shape.h> #ifndef SOLARIS #include <X11/extensions/dpms.h> #endif -#include <postx.h> - -#include <salunx.h> -#include <tools/debug.hxx> -#include <saldata.hxx> -#include <saldisp.hxx> -#include <vcl/salinst.hxx> -#include <salgdi.h> -#include <salframe.h> -#ifndef _SV_KEYCOES_HXX -#include <vcl/keycodes.hxx> -#endif -#include <soicon.hxx> -#include <dtint.hxx> -#include <sm.hxx> -#include <vcl/settings.hxx> -#include <wmadaptor.hxx> -#include <psprint/printerinfomanager.hxx> -#include <salprn.h> -#include <vcl/floatwin.hxx> -#include <vcl/sallayout.hxx> -#include <vcl/svapp.hxx> -#include <salbmp.h> -#include <i18n_ic.hxx> -#include <i18n_keysym.hxx> -#include <i18n_status.hxx> +#include "postx.h" + +#include "salunx.h" +#include "saldata.hxx" +#include "saldisp.hxx" +#include "salgdi.h" +#include "salframe.h" +#include "soicon.hxx" +#include "dtint.hxx" +#include "sm.hxx" +#include "wmadaptor.hxx" +#include "salprn.h" +#include "salbmp.h" +#include "i18n_ic.hxx" +#include "i18n_keysym.hxx" +#include "i18n_status.hxx" + +#include "vcl/salinst.hxx" +#include "vcl/floatwin.hxx" +#include "vcl/sallayout.hxx" +#include "vcl/svapp.hxx" +#include "vcl/keycodes.hxx" +#include "vcl/printerinfomanager.hxx" +#include "vcl/settings.hxx" + +#include "tools/debug.hxx" + +#include "sal/alloca.h" #include <algorithm> @@ -424,7 +425,8 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa if( IsOverrideRedirect() ) Attributes.override_redirect = True; // default icon - if( SelectAppIconPixmap( pDisplay_, m_nScreen, + if( (nStyle_ & SAL_FRAME_STYLE_INTRO) == 0 && + SelectAppIconPixmap( pDisplay_, m_nScreen, mnIconID != 1 ? mnIconID : (mpParent ? mpParent->mnIconID : 1), 32, Hints.icon_pixmap, Hints.icon_mask )) @@ -506,6 +508,10 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa XSync( GetXDisplay(), False ); setXEmbedInfo(); + XLIB_Time nUserTime = (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION | SAL_FRAME_STYLE_TOOLWINDOW) ) == 0 ? + pDisplay_->GetLastUserEventTime() : 0; + pDisplay_->getWMAdaptor()->setUserTime( this, nUserTime ); + if( ! pParentData && ! IsChildWindow() && ! Attributes.override_redirect ) { XSetWMHints( GetXDisplay(), mhWindow, &Hints ); @@ -1104,7 +1110,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight ) // Show + Pos (x,y,z) + Size (width,height) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) +void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) { if( ( bVisible && bMapped_ ) || ( !bVisible && !bMapped_ ) ) @@ -1192,6 +1198,11 @@ void X11SalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) ); } + XLIB_Time nUserTime = 0; + if( ! bNoActivate && (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) + nUserTime = pDisplay_->GetLastUserEventTime(); + GetDisplay()->getWMAdaptor()->setUserTime( this, nUserTime ); + // actually map the window if( m_bXEmbed ) askForXEmbedFocus( 0 ); @@ -1324,6 +1335,9 @@ void X11SalFrame::Show( BOOL bVisible, BOOL /*bNoActivate*/ ) XUngrabPointer( GetXDisplay(), CurrentTime ); } + // flush here; there may be a very seldom race between + // the display connection used for clipboard and our connection + Flush(); } } @@ -2780,11 +2794,7 @@ static USHORT sal_GetCode( int state ) if( state & ShiftMask ) nCode |= KEY_SHIFT; - if( (state & ControlMask ) -#ifdef MACOSX - || (state & Mod2Mask) // map Meta (aka Command key) to Ctrl -#endif - ) + if( state & ControlMask ) nCode |= KEY_MOD1; if( state & Mod1Mask ) nCode |= KEY_MOD2; @@ -3147,27 +3157,13 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) USHORT nModCode = 0; char aDummy; -#ifdef MACOSX - // map Meta (aka Command key) to Ctrl - if( pEvent->state & Mod2Mask ) - nModCode |= KEY_MOD1; - if( nKeySym == XK_Meta_L ) - nKeySym = XK_Control_L; - else if( nKeySym == XK_Meta_R ) - nKeySym = XK_Control_R; -#endif - if( pEvent->state & ShiftMask ) nModCode |= KEY_SHIFT; if( pEvent->state & ControlMask ) nModCode |= KEY_MOD1; -#ifdef MACOSX - if( pEvent->state & Mod2Mask ) - nModCode |= KEY_MOD3; -#else if( pEvent->state & Mod1Mask ) nModCode |= KEY_MOD2; -#endif + if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R || nKeySym == XK_Control_L || nKeySym == XK_Control_R || nKeySym == XK_Alt_L || nKeySym == XK_Alt_R @@ -3201,19 +3197,11 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) break; case XK_Alt_L: nExtModMask = MODKEY_LMOD2; -#ifdef MACOSX - nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_MOD3 : 0 ); -#else nModMask = KEY_MOD2; -#endif break; case XK_Alt_R: nExtModMask = MODKEY_RMOD2; -#ifdef MACOSX - nModMask = KEY_MOD2 | (pEvent->type==KeyRelease ? KEY_MOD3 : 0 ); -#else nModMask = KEY_MOD2; -#endif break; case XK_Shift_L: nExtModMask = MODKEY_LSHIFT; @@ -3616,37 +3604,6 @@ long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent ) { if( maGeometry.nX != pEvent->x || maGeometry.nY != pEvent->y ) { -#ifdef MACOSX - // #i68019#: Apple X11 doesn't draw offscreen... - // Better would be to test if the X server we are running on is Apple X11, but ... - - Size aScreenSize = GetDisplay()->GetScreenSize( m_nScreen ); - unsigned int nScreenWidth = aScreenSize.Width(); - unsigned int nScreenHeight = aScreenSize.Height(); - - // Repaint the window if it was possible to draw outside of the screen (in theory) - // 1. the window was below the screen and the window was moved up - // 2. the window was above the screen and the window was moved down - // 3. the window was out of the screen on the right side and the window was moved left - // 4. the window's left part was out of the screen and the window was moved right - if ( ( maGeometry.nY+maGeometry.nHeight > nScreenHeight && - pEvent->y < maGeometry.nY ) || - ( maGeometry.nY < 0 && pEvent->y > maGeometry.nY ) || - ( maGeometry.nX+maGeometry.nWidth > nScreenWidth && - pEvent->x < maGeometry.nX ) || - ( maGeometry.nX < 0 && pEvent->x > maGeometry.nX) ) - { - XEvent aEvent; - aEvent.xexpose.type = Expose; - aEvent.xexpose.display = pDisplay_->GetDisplay(); - aEvent.xexpose.x = 0; - aEvent.xexpose.y = 0; - aEvent.xexpose.width = maGeometry.nWidth; - aEvent.xexpose.height = maGeometry.nHeight; - aEvent.xexpose.count = 0; - HandleExposeEvent(&aEvent); - } -#endif maGeometry.nX = pEvent->x; maGeometry.nY = pEvent->y; CallCallback( SALEVENT_MOVE, NULL ); diff --git a/vcl/util/linksvp/makefile.mk b/vcl/util/linksvp/makefile.mk index ac802d769abf..8a3c840ba627 100644 --- a/vcl/util/linksvp/makefile.mk +++ b/vcl/util/linksvp/makefile.mk @@ -46,14 +46,14 @@ LINKFLAGSRUNPATH_OOO := -R/usr/sfw/lib $(LINKFLAGSRUNPATH_OOO) .IF "$(GUIBASE)" == "unx" # headless plugin LIB1TARGET=$(SLB)$/isvpplug -LIB1FILES= $(SLB)$/svpplug.lib +LIB1FILES= $(SLB)$/svpplug.lib \ + $(SLB)$/printergfx.lib SHL1TARGET=vclplug_svp$(DLLPOSTFIX) SHL1IMPLIB=isvpplug SHL1LIBS=$(LIB1TARGET) SHL1DEPN=$(LB)$/libvcl$(DLLPOSTFIX)$(DLLPOST) SHL1STDLIBS=\ $(VCLLIB)\ - -lpsp$(DLLPOSTFIX)\ $(BASEBMPLIB)\ $(BASEGFXLIB)\ $(SOTLIB) \ diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 98fe62caae26..96cf50504ef0 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -145,17 +145,18 @@ SHL18FILE= $(MISC)$/salgdi.slo .ENDIF LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1FILES= $(SLB)$/app.lib \ - $(SLB)$/gdi.lib \ - $(SLB)$/win.lib \ - $(SLB)$/ctrl.lib \ - $(SLB)$/helper.lib \ +LIB1FILES= $(SLB)$/app.lib \ + $(SLB)$/gdi.lib \ + $(SLB)$/win.lib \ + $(SLB)$/ctrl.lib \ + $(SLB)$/helper.lib \ + $(SLB)$/fontsubset.lib \ $(SLB)$/components.lib .IF "$(GUI)" == "UNX" && "$(GUIBASE)"!="aqua" -LIB1FILES+=$(SLB)$/salplug.lib -SHL1STDLIBS+=\ - $(PSPLIB) +LIB1FILES+= $(SLB)$/salplug.lib \ + $(SLB)$/fontman.lib \ + $(SLB)$/printer.lib .ELSE LIB1FILES+= \ $(SLB)$/salwin.lib \ @@ -197,7 +198,7 @@ LIB1FILES+= \ .IF "$(USE_BUILTIN_RASTERIZER)"!="" LIB1FILES += $(SLB)$/glyphs.lib - SHL1STDLIBS+= $(FREETYPELIB) $(PSPLIB) + SHL1STDLIBS+= $(FREETYPELIB) .ENDIF # USE_BUILTIN_RASTERIZER SHL1LIBS= $(LIB1TARGET) @@ -223,10 +224,6 @@ DEFLIB1NAME =vcl .IF "$(GUI)" == "WNT" -.IF "$(COM)" == "GCC" -SHL1STDLIBS += $(PSPLIB) -.ENDIF - SHL1STDLIBS += $(UWINAPILIB) \ $(GDI32LIB) \ $(GDIPLUSLIB) \ @@ -236,12 +233,7 @@ SHL1STDLIBS += $(UWINAPILIB) \ $(SHELL32LIB) \ $(ADVAPI32LIB) -.IF "$(COM)" == "GCC" SHL1STDLIBS += $(IMM32LIB) -.ELSE -SHL1STDLIBS += $(PSPLIB) \ - $(IMM32LIB) -.ENDIF .IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI" LINKFLAGSSHL += /ENTRY:LibMain@12 @@ -251,19 +243,18 @@ LINKFLAGSSHL += /ENTRY:LibMain@12 # --- OS2 ---------------------------------------------------------------- .IF "$(GUI)" == "OS2" -STDSHL1 += ft2lib.lib apsp.lib +STDSHL1 += ft2lib.lib .ENDIF # --- UNX ---------------------------------------------------------------- -SHL1STDLIBS += $(PSPLIB) - # UNX sal plugins .IF "$(GUI)" == "UNX" && "$(GUIBASE)" != "aqua" # basic pure X11 plugin LIB2TARGET=$(SLB)$/ipure_x LIB2FILES= \ + $(SLB)$/printergfx.lib \ $(SLB)$/salwin.lib \ $(SLB)$/salgdi.lib \ $(SLB)$/salapp.lib @@ -275,7 +266,6 @@ SHL2DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) # libs for generic plugin SHL2STDLIBS=\ $(VCLLIB)\ - $(PSPLIB)\ $(SOTLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ @@ -356,7 +346,6 @@ SHL4NOCHECK=TRUE SHL4STDLIBS+=-l$(SHL2TARGET) SHL4STDLIBS+=\ $(VCLLIB) \ - $(PSPLIB) \ $(SOTLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ @@ -391,7 +380,6 @@ SHL5STDLIBS=$(KDE_LIBS) SHL5STDLIBS+=-l$(SHL2TARGET) SHL5STDLIBS+=\ $(VCLLIB) \ - $(PSPLIB) \ $(TOOLSLIB) \ $(VOSLIB) \ $(SALLIB) diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index de08f1c25b50..70701e2ee19a 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -33,53 +33,47 @@ #include <string.h> #include <malloc.h> -#include <osl/module.h> -#include <tools/svwin.h> -#include <rtl/logfile.hxx> -#include <rtl/tencinfo.h> -#ifndef _OSL_FILE_HXX -#include <osl/file.hxx> -#endif -#ifndef _OSL_THREAD_HXX -#include <osl/thread.hxx> -#endif -#ifndef _OSL_PROCESS_HXX -#include <osl/process.h> -#endif -#include <vcl/svapp.hxx> -#include <wincomp.hxx> -#include <saldata.hxx> -#include <salgdi.h> -#include <vcl/outfont.hxx> -#include <vcl/font.hxx> -#include <vcl/sallayout.hxx> -#include <tools/poly.hxx> -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolypolygon.hxx> -#include <basegfx/matrix/b2dhommatrix.hxx> - - -#include <tools/debug.hxx> -#ifndef __SUBFONT_H -#include <psprint/list.h> -#include <psprint/sft.h> -#endif -#include <rtl/textcvt.h> + +#include "tools/svwin.h" + +#include "wincomp.hxx" +#include "saldata.hxx" +#include "salgdi.h" + +#include "vcl/svapp.hxx" +#include "vcl/outfont.hxx" +#include "vcl/font.hxx" +#include "vcl/sallayout.hxx" + +#include "rtl/logfile.hxx" +#include "rtl/tencinfo.h" +#include "rtl/textcvt.h" +#include "rtl/bootstrap.hxx" + + +#include "osl/module.h" +#include "osl/file.hxx" +#include "osl/thread.hxx" +#include "osl/process.h" + +#include "tools/poly.hxx" +#include "tools/debug.hxx" +#include "tools/stream.hxx" + +#include "basegfx/polygon/b2dpolygon.hxx" +#include "basegfx/polygon/b2dpolypolygon.hxx" +#include "basegfx/matrix/b2dhommatrix.hxx" + +#include <list.h> +#include <sft.h> #ifdef GCP_KERN_HACK #include <algorithm> #endif -#include <tools/stream.hxx> -#include <rtl/bootstrap.hxx> - #include <vector> #include <set> - -//#ifndef INCLUDED_MAP #include <map> -//#define INCLUDED_MAP -//#endif static const int MAXFONTHEIGHT = 2048; diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 24f45d6cba1e..34900aaa951a 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -30,15 +30,22 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include <tools/svwin.h> -#include <rtl/ustring.hxx> -#include <osl/module.h> -#include <osl/file.h> +#include "tools/svwin.h" + +#include "salgdi.h" +#include "saldata.hxx" +// for GetMirroredChar +#include "sft.h" + +#include "vcl/sallayout.hxx" +#include "vcl/svapp.hxx" + +#include "rtl/ustring.hxx" + +#include "osl/module.h" +#include "osl/file.h" -#include <salgdi.h> -#include <saldata.hxx> -#include <vcl/sallayout.hxx> #include <cstdio> #include <malloc.h> @@ -50,9 +57,6 @@ #include <algorithm> #endif // GCP_KERN_HACK -#include <psprint/sft.h> -// for GetMirroredChar -#include <vcl/svapp.hxx> #define USE_UNISCRIBE #ifdef USE_UNISCRIBE @@ -62,8 +66,9 @@ #endif // USE_UNISCRIBE #include <hash_map> -typedef std::hash_map<int,int> IntMap; #include <set> + +typedef std::hash_map<int,int> IntMap; typedef std::set<int> IntSet; #define DROPPED_OUTGLYPH 0xFFFF @@ -1060,6 +1065,7 @@ public: public: bool IsEmpty() const { return (mnEndGlyphPos <= 0); } + bool IsRTL() const { return mpScriptItem->a.fRTL; } bool HasKashidas() const { return mbHasKashidas; } }; @@ -1520,7 +1526,7 @@ bool UniscribeLayout::LayoutText( ImplLayoutArgs& rArgs ) // fallback request is limited to the characters in the original request // => this is handled in ImplLayoutArgs::PrepareFallback() rArgs.NeedFallback( rVisualItem.mnMinCharPos, rVisualItem.mnEndCharPos, - rVisualItem.mpScriptItem->a.fRTL ); + rVisualItem.IsRTL() ); // don't bother to do a default layout in a fallback level if( 0 != (rArgs.mnFlags & SAL_LAYOUT_FOR_FALLBACK) ) @@ -1574,7 +1580,7 @@ bool UniscribeLayout::LayoutText( ImplLayoutArgs& rArgs ) mpOutGlyphs[ i + rVisualItem.mnMinGlyphPos ] = DROPPED_OUTGLYPH; // request fallback for the whole cell that resulted in a NotDef glyph // TODO: optimize algorithm - bool bRTL = rVisualItem.mpScriptItem->a.fRTL; + const bool bRTL = rVisualItem.IsRTL(); if( !bRTL ) { // request fallback for the left-to-right cell @@ -1762,23 +1768,22 @@ bool UniscribeLayout::GetItemSubrange( const VisualItem& rVisualItem, nMaxGlyphPos = n; } - // account for multiple glyphs at rightmost character - // test only needed when rightmost glyph isn't referenced - if( rEndGlyphPos > nMaxGlyphPos + 1 ) + // extend the glyph range to account for all glyphs in referenced clusters + if( !rVisualItem.IsRTL() ) // LTR-item { - // find the end of the glyph cluster - // TODO: optimize for case when LTR/RTL correspond to monotonous glyph indexes - for( int i = rVisualItem.mnMinCharPos; i < rVisualItem.mnEndCharPos; ++i ) - { - int n = mpLogClusters[ i ] + rVisualItem.mnMinGlyphPos; - if( (rEndGlyphPos > n) && (n > nMaxGlyphPos) ) - { - rEndGlyphPos = n; - if( n-1 <= nMaxGlyphPos ) - break; - } - } + // extend to rightmost glyph of rightmost referenced cluster + for( i = nMaxGlyphPos; ++i < rVisualItem.mnEndGlyphPos; nMaxGlyphPos = i ) + if( mpVisualAttrs[i].fClusterStart ) + break; } + else // RTL-item + { + // extend to leftmost glyph of leftmost referenced cluster + for( i = rMinGlyphPos; --i >= rVisualItem.mnMinGlyphPos; rMinGlyphPos = i ) + if( mpVisualAttrs[i].fClusterStart ) + break; + } + rEndGlyphPos = nMaxGlyphPos + 1; return true; } @@ -1864,7 +1869,7 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, // adjust the nXOffset relative to glyph cluster start int c = mnMinCharPos; - if( !pVI->mpScriptItem->a.fRTL ) + if( !pVI->IsRTL() ) // LTR-case { // LTR case: subtract the remainder of the cell from xoffset int nTmpIndex = mpLogClusters[c]; @@ -1872,7 +1877,7 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, && (nTmpIndex == mpLogClusters[c]) ) nXOffset -= mpCharWidths[c]; } - else + else // RTL-case { // RTL case: add the remainder of the cell from xoffset int nTmpIndex = mpLogClusters[ pVI->mnEndCharPos - 1 ]; @@ -1994,7 +1999,7 @@ int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, // RTL-justified glyph positioning is not easy // simplify the code by just returning only one glyph at a time - if( mpJustifications && pVI->mpScriptItem->a.fRTL ) + if( mpJustifications && pVI->IsRTL() ) break; // stop when the x-position of the next glyph is unexpected @@ -2191,7 +2196,7 @@ void UniscribeLayout::DrawText( SalGraphics& ) const if( nBaseGlyphPos < 0 ) { // adjust draw position relative to cluster start - if( rVisualItem.mpScriptItem->a.fRTL ) + if( rVisualItem.IsRTL() ) nBaseGlyphPos = nEndGlyphPos - 1; else nBaseGlyphPos = nMinGlyphPos; @@ -2207,7 +2212,7 @@ void UniscribeLayout::DrawText( SalGraphics& ) const && (nBaseGlyphPos == mpLogClusters[i]) ) nBaseClusterOffset += mpCharWidths[i]; - if( !rVisualItem.mpScriptItem->a.fRTL ) + if( !rVisualItem.IsRTL() ) nBaseClusterOffset = -nBaseClusterOffset; } @@ -2341,7 +2346,7 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const { int j = mpLogClusters[ i ] + rVisualItem.mnMinGlyphPos; int nCurrIdx = i * 2; - if( !rVisualItem.mpScriptItem->a.fRTL ) + if( !rVisualItem.IsRTL() ) { // normal positions for LTR case pCaretXArray[ nCurrIdx ] = pGlyphPos[ j ]; @@ -2433,7 +2438,7 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs ) // if needed prepare special handling for arabic justification rVisualItem.mbHasKashidas = false; - if( rVisualItem.mpScriptItem->a.fRTL ) + if( rVisualItem.IsRTL() ) { for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i ) if ( (1U << mpVisualAttrs[i].uJustification) & 0xFF89 ) // any Arabic justification ? @@ -2499,7 +2504,7 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs ) // workaround needed for older USP versions: // right align the justification-adjusted glyphs in their cells for RTL-items // unless the right alignment is done by inserting kashidas - if( bManualCellAlign && rVisualItem.mpScriptItem->a.fRTL && !rVisualItem.HasKashidas() ) + if( bManualCellAlign && rVisualItem.IsRTL() && !rVisualItem.HasKashidas() ) { for( i = nMinGlyphPos; i < nEndGlyphPos; ++i ) { diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk index 82edf8617891..83abbbf4e6bf 100644 --- a/vcl/workben/makefile.mk +++ b/vcl/workben/makefile.mk @@ -147,7 +147,7 @@ $(BIN)$/applicat.rdb : makefile.mk $(UNOUCRRDB) rm -f $@ $(GNUCOPY) $(UNOUCRRDB) $@ cd $(BIN) && \ - regcomp -register -r applicat.rdb \ + $(REGCOMP) -register -r applicat.rdb \ -c i18nsearch.uno$(DLLPOST) \ -c i18npool.uno$(DLLPOST) |