diff options
77 files changed, 406 insertions, 221 deletions
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index af1a2f9ccd4d..af1a2f9ccd4d 100644..100755 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx diff --git a/comphelper/inc/comphelper/anycompare.hxx b/comphelper/inc/comphelper/anycompare.hxx index 03f41e108ba9..03f41e108ba9 100644..100755 --- a/comphelper/inc/comphelper/anycompare.hxx +++ b/comphelper/inc/comphelper/anycompare.hxx diff --git a/comphelper/inc/comphelper/componentguard.hxx b/comphelper/inc/comphelper/componentguard.hxx index 820b901a5c55..820b901a5c55 100644..100755 --- a/comphelper/inc/comphelper/componentguard.hxx +++ b/comphelper/inc/comphelper/componentguard.hxx diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx index a86174daf08e..a86174daf08e 100644..100755 --- a/comphelper/source/misc/anycompare.cxx +++ b/comphelper/source/misc/anycompare.cxx diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index 0d9235747fd6..aaac0e83a4eb 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -159,7 +159,7 @@ static PageDesc aDinTab[] = static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]); -#define MAXSLOPPY 11 +#define MAXSLOPPY 21 bool PaperInfo::doSloppyFit() { diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index e300fe26f16d..8ce6098d21a9 100644..100755 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -102,6 +102,14 @@ namespace fs HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); return std::string(tmp.getStr()); } +#ifdef WNT + wchar_t const * native_file_string_w() const + { + ::rtl::OUString ustrSystemPath; + osl::File::getSystemPathFromFileURL(data, ustrSystemPath); + return ustrSystemPath.getStr(); + } +#endif std::string native_directory_string() const { return native_file_string(); } std::string toUTF8() const { diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index a39b5399e38d..c20d9f108ced 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -45,6 +45,15 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Date; + +/** + When this tool is used with long path names on Windows, that is paths which start + with \\?\, then the caller must make sure that the path is unique. This is achieved + by removing '.' and '..' from the path. Paths which are created by + osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because + lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene + module. + */ public class HelpIndexerTool { public HelpIndexerTool() diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 4e3a4cedbe6f..036208520ede 100644..100755 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -118,7 +118,13 @@ void IndexerPreProcessor::processDocument { fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL; std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsCaptionPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsCaptionPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeCaption->content ); @@ -135,8 +141,13 @@ void IndexerPreProcessor::processDocument if( pResNodeContent ) { fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL; - std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string(); - FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile_docURL = _wfopen( + fsContentPureTextFile_docURL.native_file_string_w(), L"w" ); +#else + FILE* pFile_docURL = fopen( + fsContentPureTextFile_docURL.native_file_string().c_str(), "w" ); +#endif if( pFile_docURL ) { fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); @@ -226,9 +237,13 @@ public: } } - void dump_DBHelp( const std::string& rFileName ) + void dump_DBHelp( const fs::path& rFileName ) { - FILE* pFile = fopen( rFileName.c_str(), "wb" ); +#ifdef WNT //We need _wfopen to support long file paths on Windows XP + FILE* pFile = _wfopen( rFileName.native_file_string_w(), L"wb" ); +#else + FILE* pFile = fopen( rFileName.native_file_string().c_str(), "wb" ); +#endif if( pFile == NULL ) return; @@ -430,9 +445,15 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileHelpText_DBHelp = _wfopen + ( helpTextFileName_DBHelp.native_file_string_w(), L"wb" ); +#else + FILE* pFileHelpText_DBHelp = fopen ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" ); - +#endif DB* dbBase(0); #ifndef DBHELP_ONLY fs::path dbBaseFileName(indexDirParentName / (mod + ".db")); @@ -442,8 +463,14 @@ void HelpLinker::link() throw( HelpProcessingException ) #endif fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db"))); +#ifdef WNT + //We need _wfopen to support long file paths on Windows XP + FILE* pFileDbBase_DBHelp = _wfopen + ( dbBaseFileName_DBHelp.native_file_string_w(), L"wb" ); +#else FILE* pFileDbBase_DBHelp = fopen ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" ); +#endif #ifndef DBHELP_ONLY DB* keyWord(0); @@ -692,7 +719,7 @@ void HelpLinker::link() throw( HelpProcessingException ) if( pFileDbBase_DBHelp != NULL ) fclose( pFileDbBase_DBHelp ); - helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() ); + helpKeyword.dump_DBHelp( keyWordFileName_DBHelp); if( !bExtensionMode ) { diff --git a/rsc/source/rscpp/cpp4.c b/rsc/source/rscpp/cpp4.c index b8f90ab4f7ed..04d715f35351 100644 --- a/rsc/source/rscpp/cpp4.c +++ b/rsc/source/rscpp/cpp4.c @@ -629,7 +629,7 @@ void dumpparm(char* why) nargs, parmp - parm, why); for (i = 0; i < nargs; i++) { fprintf( pCppOut, "parm[%d] (%d) = \"%s\"\n", - i + 1, strlen(parlist[i]), parlist[i]); + i + 1, (int)strlen(parlist[i]), parlist[i]); } } #endif diff --git a/svl/inc/svl/nfkeytab.hxx b/svl/inc/svl/nfkeytab.hxx index 7c3fef4b88cc..34d483ab4d86 100644 --- a/svl/inc/svl/nfkeytab.hxx +++ b/svl/inc/svl/nfkeytab.hxx @@ -28,6 +28,7 @@ #ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX #define INCLUDED_SVTOOLS_NFKEYTAB_HXX +#include <vector> #include <tools/string.hxx> //! For ImpSvNumberformatScan: first the short symbols, then the long symbols! @@ -111,7 +112,18 @@ enum NfKeywordIndex NF_KEYWORD_ENTRIES_COUNT }; -typedef String NfKeywordTable [NF_KEYWORD_ENTRIES_COUNT]; +class NfKeywordTable +{ + typedef ::std::vector<String> Keywords_t; + Keywords_t m_keywords; + +public: + NfKeywordTable() : m_keywords(NF_KEYWORD_ENTRIES_COUNT) {}; + virtual ~NfKeywordTable() {} + + String & operator[] (Keywords_t::size_type n) { return m_keywords[n]; } + const String & operator[] (Keywords_t::size_type n) const { return m_keywords[n]; } +}; #endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx index 3d2c46af496c..57a26c3109ec 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.hxx @@ -35,6 +35,7 @@ #include <boost/scoped_ptr.hpp> #include <vector> +#include <limits> //==================================================================== diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index ebc1fa673fe2..d4d0f8550907 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -939,10 +939,10 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang ) { ChangeIntl( eLang ); - const String* pTable = pFormatScanner->GetKeywords(); + const NfKeywordTable & rTable = pFormatScanner->GetKeywords(); for ( sal_uInt16 i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i ) { - rKeywords[i] = pTable[i]; + rKeywords[i] = rTable[i]; } } @@ -950,9 +950,9 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords, String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ) { ChangeIntl(eLnge); - const String* pTable = pFormatScanner->GetKeywords(); - if ( pTable && nIndex < NF_KEYWORD_ENTRIES_COUNT ) - return pTable[nIndex]; + const NfKeywordTable & rTable = pFormatScanner->GetKeywords(); + if ( nIndex < NF_KEYWORD_ENTRIES_COUNT ) + return rTable[nIndex]; DBG_ERROR("GetKeyword: invalid index"); return String(); @@ -2589,8 +2589,8 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi CLOffset + SetIndexTable( NF_FRACTION_2, ZF_STANDARD_FRACTION+1 )); // Week of year must be appended here because of nNewExtended - const String* pKeyword = pFormatScanner->GetKeywords(); - aSingleFormatCode.Code = pKeyword[NF_KEY_WW]; + const NfKeywordTable & rKeyword = pFormatScanner->GetKeywords(); + aSingleFormatCode.Code = rKeyword[NF_KEY_WW]; ImpInsertNewStandardFormat( aSingleFormatCode, CLOffset + SetIndexTable( NF_DATE_WW, nNewExtended++ ), SV_NUMBERFORMATTER_VERSION_NF_DATE_WW ); diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 92398792077d..9b01c2ee91be 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1149,7 +1149,7 @@ short SvNumberformat::ImpNextSymbol(String& rString, xub_StrLen nLen = rString.Len(); ScanState eState = SsStart; sSymbol.Erase(); - const String* pKeywords = rScan.GetKeywords(); + const NfKeywordTable & rKeywords = rScan.GetKeywords(); while (nPos < nLen && eState != SsStop) { cToken = rString.GetChar(nPos); @@ -1267,9 +1267,9 @@ short SvNumberformat::ImpNextSymbol(String& rString, BRACKET_SYMBOLTYPE_DBNUM1 - (cDBNum - '1')); eState = SsGetPrefix; } - else if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H - cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M - cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S + else if (cUpper == rKeywords[NF_KEY_H].GetChar(0) || // H + cUpper == rKeywords[NF_KEY_MI].GetChar(0) || // M + cUpper == rKeywords[NF_KEY_S].GetChar(0) ) // S { sSymbol += cToken; eState = SsGetTime; @@ -1306,9 +1306,9 @@ short SvNumberformat::ImpNextSymbol(String& rString, else { sal_Unicode cUpper = rChrCls().toUpper( rString, nPos-1, 1 ).GetChar(0); - if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H - cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M - cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S + if (cUpper == rKeywords[NF_KEY_H].GetChar(0) || // H + cUpper == rKeywords[NF_KEY_MI].GetChar(0) || // M + cUpper == rKeywords[NF_KEY_S].GetChar(0) ) // S { if (cLetter == cToken) { @@ -4230,10 +4230,10 @@ String SvNumberformat::GetMappedFormatstring( const String& rColorName = NumFor[n].GetColorName(); if ( rColorName.Len() ) { - const String* pKey = rScan.GetKeywords() + NF_KEY_FIRSTCOLOR; - for ( int j=NF_KEY_FIRSTCOLOR; j<=NF_KEY_LASTCOLOR; j++, pKey++ ) + const NfKeywordTable & rKey = rScan.GetKeywords(); + for ( int j=NF_KEY_FIRSTCOLOR; j<=NF_KEY_LASTCOLOR; j++ ) { - if ( *pKey == rColorName ) + if ( rKey[j] == rColorName ) { aPrefix += '['; aPrefix += rKeywords[j]; diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 000649a6de80..83dbd512a4e2 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -473,10 +473,10 @@ void ImpSvNumberformatScan::ChangeStandardPrec(sal_uInt16 nPrec) Color* ImpSvNumberformatScan::GetColor(String& sStr) { String sString = pFormatter->GetCharClass()->upper(sStr); - const String* pKeyword = GetKeywords(); + const NfKeywordTable & rKeyword = GetKeywords(); size_t i = 0; while (i < NF_MAX_DEFAULT_COLORS && - sString != pKeyword[NF_KEY_FIRSTCOLOR+i] ) + sString != rKeyword[NF_KEY_FIRSTCOLOR+i] ) i++; if ( i >= NF_MAX_DEFAULT_COLORS ) { @@ -492,7 +492,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr) Color* pResult = NULL; if (i >= NF_MAX_DEFAULT_COLORS) { - const String& rColorWord = pKeyword[NF_KEY_COLOR]; + const String& rColorWord = rKeyword[NF_KEY_COLOR]; xub_StrLen nPos = sString.Match(rColorWord); if (nPos > 0) { @@ -529,7 +529,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr) pFormatter->ChangeIntl(eTmpLnge); } else - sStr = pKeyword[NF_KEY_FIRSTCOLOR+i]; + sStr = rKeyword[NF_KEY_FIRSTCOLOR+i]; pResult = &(StandardColor[i]); } @@ -540,16 +540,16 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr) short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos ) { String sString = pFormatter->GetCharClass()->toUpper( sSymbol, nPos, sSymbol.Len() - nPos ); - const String* pKeyword = GetKeywords(); + const NfKeywordTable & rKeyword = GetKeywords(); // #77026# for the Xcl perverts: the GENERAL keyword is recognized anywhere - if ( sString.Search( pKeyword[NF_KEY_GENERAL] ) == 0 ) + if ( sString.Search( rKeyword[NF_KEY_GENERAL] ) == 0 ) return NF_KEY_GENERAL; //! MUST be a reverse search to find longer strings first short i = NF_KEYWORD_ENTRIES_COUNT-1; sal_Bool bFound = sal_False; for ( ; i > NF_KEY_LASTKEYWORD_SO5; --i ) { - bFound = sString.Search(pKeyword[i]) == 0; + bFound = sString.Search(rKeyword[i]) == 0; if ( bFound ) { break; @@ -559,15 +559,15 @@ short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos if ( !bFound ) { // skip the gap of colors et al between new and old keywords and search on i = NF_KEY_LASTKEYWORD; - while ( i > 0 && sString.Search(pKeyword[i]) != 0 ) + while ( i > 0 && sString.Search(rKeyword[i]) != 0 ) i--; - if ( i > NF_KEY_LASTOLDKEYWORD && sString != pKeyword[i] ) + if ( i > NF_KEY_LASTOLDKEYWORD && sString != rKeyword[i] ) { // found something, but maybe it's something else? // e.g. new NNN is found in NNNN, for NNNN we must search on short j = i - 1; - while ( j > 0 && sString.Search(pKeyword[j]) != 0 ) + while ( j > 0 && sString.Search(rKeyword[j]) != 0 ) j--; - if ( j && pKeyword[j].Len() > pKeyword[i].Len() ) + if ( j && rKeyword[j].Len() > rKeyword[i].Len() ) return j; } } diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 9b04921cb7f4..a1372866a46e 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -66,7 +66,7 @@ public: const LocaleDataWrapper& GetLoc() const { return *pFormatter->GetLocaleData(); } CalendarWrapper& GetCal() const { return *pFormatter->GetCalendar(); } - const String* GetKeywords() const + const NfKeywordTable & GetKeywords() const { if ( bKeywordsNeedInit ) InitKeywords(); diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index af22c04c79ff..fae0250e9002 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -711,7 +711,7 @@ sal_uInt16 SfxUndoManager::GetUndoActionId() const DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" ); if ( m_pData->pActUndoArray->nCurUndoAction == 0 ) - return NULL; + return 0; return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId(); } diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx index 94f03b684e64..94f03b684e64 100644..100755 --- a/svtools/inc/svtools/table/tablemodel.hxx +++ b/svtools/inc/svtools/table/tablemodel.hxx diff --git a/svtools/inc/svtools/table/tablesort.hxx b/svtools/inc/svtools/table/tablesort.hxx index 1690b4d51344..1690b4d51344 100644..100755 --- a/svtools/inc/svtools/table/tablesort.hxx +++ b/svtools/inc/svtools/table/tablesort.hxx diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx index 286ca505bb30..286ca505bb30 100644..100755 --- a/svtools/source/table/cellvalueconversion.cxx +++ b/svtools/source/table/cellvalueconversion.cxx diff --git a/svtools/source/table/cellvalueconversion.hxx b/svtools/source/table/cellvalueconversion.hxx index 4d6b8c8d6aac..4d6b8c8d6aac 100644..100755 --- a/svtools/source/table/cellvalueconversion.hxx +++ b/svtools/source/table/cellvalueconversion.hxx diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx index 20d505e911e9..20d505e911e9 100644..100755 --- a/svtools/source/table/mousefunction.cxx +++ b/svtools/source/table/mousefunction.cxx diff --git a/svtools/source/table/mousefunction.hxx b/svtools/source/table/mousefunction.hxx index 2149026a0923..2149026a0923 100644..100755 --- a/svtools/source/table/mousefunction.hxx +++ b/svtools/source/table/mousefunction.hxx diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 8e481d27d993..8e481d27d993 100644..100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index bc1ac55fbe51..bc1ac55fbe51 100644..100755 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx diff --git a/svtools/source/uno/unogridcolumnfacade.cxx b/svtools/source/uno/unogridcolumnfacade.cxx index d2f5e7b565fd..d2f5e7b565fd 100644..100755 --- a/svtools/source/uno/unogridcolumnfacade.cxx +++ b/svtools/source/uno/unogridcolumnfacade.cxx diff --git a/svtools/source/uno/unogridcolumnfacade.hxx b/svtools/source/uno/unogridcolumnfacade.hxx index 7499621ba8af..7499621ba8af 100644..100755 --- a/svtools/source/uno/unogridcolumnfacade.hxx +++ b/svtools/source/uno/unogridcolumnfacade.hxx diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index a60a210e8fa7..18af2c696a8c 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -80,6 +80,7 @@ SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com:: if ( pParent ) { pWindow = new MultiLineEdit( pParent, nWinBits|WB_IGNORETAB); + static_cast< MultiLineEdit* >( pWindow )->DisableSelectionOnFocus(); *ppNewComp = new VCLXMultiLineEdit; } else diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index 17b958aeace9..9c0ffa3b78fb 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -30,12 +30,13 @@ #include <toolkit/controls/controlmodelcontainerbase.hxx> #include <com/sun/star/awt/XTopWindow.hpp> -#include <com/sun/star/awt/XDialog.hpp> +#include <com/sun/star/awt/XDialog2.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> #include "toolkit/helper/servicenames.hxx" #include "toolkit/helper/macros.hxx" #include <toolkit/controls/unocontrolcontainer.hxx> #include <cppuhelper/basemutex.hxx> +#include <cppuhelper/implbase3.hxx> #include <list> // ---------------------------------------------------- @@ -64,10 +65,12 @@ public: }; -class UnoDialogControl :public ControlContainerBase, - public ::com::sun::star::awt::XTopWindow, - public ::com::sun::star::awt::XDialog, - public ::com::sun::star::awt::XWindowListener +typedef ::cppu::AggImplInheritanceHelper3 < ControlContainerBase + , ::com::sun::star::awt::XTopWindow + , ::com::sun::star::awt::XDialog2 + , ::com::sun::star::awt::XWindowListener + > UnoDialogControl_Base; +class UnoDialogControl : public UnoDialogControl_Base { private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar; @@ -80,11 +83,6 @@ public: ~UnoDialogControl(); ::rtl::OUString GetComponentServiceName(); - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); } - ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } - void SAL_CALL release() throw() { OWeakAggObject::release(); } - void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); @@ -102,16 +100,16 @@ public: virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException); sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException); void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XControl sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/inc/toolkit/helper/formpdfexport.hxx b/toolkit/inc/toolkit/helper/formpdfexport.hxx index 502f25520145..cafcb5d00d38 100644 --- a/toolkit/inc/toolkit/helper/formpdfexport.hxx +++ b/toolkit/inc/toolkit/helper/formpdfexport.hxx @@ -28,22 +28,21 @@ #ifndef _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX #define _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX -#ifndef TOOLKIT_DLLAPI_H #include <toolkit/dllapi.h> -#endif /** === begin UNO includes === **/ -#ifndef _COM_SUN_STAR_AWT_XCONTROL_HPP_ #include <com/sun/star/awt/XControl.hpp> -#endif /** === end UNO includes === **/ -#ifndef _VCL_PDFWRITER_HXX #include <vcl/pdfwriter.hxx> -#endif #include <memory> +namespace vcl +{ + class PDFExtOutDevData; +} + //........................................................................ namespace toolkitform { @@ -53,7 +52,8 @@ namespace toolkitform */ void TOOLKIT_DLLPUBLIC describePDFControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl, - ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor + ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor, + ::vcl::PDFExtOutDevData& i_pdfExportData ) SAL_THROW(()); //........................................................................ diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java index d4f2329d8f31..d4f2329d8f31 100644..100755 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java index edd84651d45e..edd84651d45e 100644..100755 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java diff --git a/toolkit/qa/complex/toolkit/Assert.java b/toolkit/qa/complex/toolkit/Assert.java index 93b1a2c490e1..93b1a2c490e1 100644..100755 --- a/toolkit/qa/complex/toolkit/Assert.java +++ b/toolkit/qa/complex/toolkit/Assert.java diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java index a06a52342417..a06a52342417 100644..100755 --- a/toolkit/qa/complex/toolkit/GridControl.java +++ b/toolkit/qa/complex/toolkit/GridControl.java diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java index 7dca37ce18b7..7dca37ce18b7 100644..100755 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent.java diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java index 14debda92cd8..14debda92cd8 100644..100755 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext.java diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java index 535c7ce36c68..535c7ce36c68 100644..100755 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java index 551b00acada7..551b00acada7 100644..100755 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent.java diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java index a12d93a2d9e2..a12d93a2d9e2 100644..100755 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleText.java diff --git a/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java index 11e4a4b19f80..11e4a4b19f80 100644..100755 --- a/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java +++ b/toolkit/qa/complex/toolkit/awtgrid/DummyColumn.java diff --git a/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java index c31f27796cf1..c31f27796cf1 100644..100755 --- a/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java +++ b/toolkit/qa/complex/toolkit/awtgrid/GridDataListener.java diff --git a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java index c550dd9a047d..c550dd9a047d 100644..100755 --- a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java +++ b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java diff --git a/toolkit/qa/complex/toolkit/makefile.mk b/toolkit/qa/complex/toolkit/makefile.mk index ecb173f9bdac..ecb173f9bdac 100644..100755 --- a/toolkit/qa/complex/toolkit/makefile.mk +++ b/toolkit/qa/complex/toolkit/makefile.mk diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index f037f10bbe31..25f30cb88d34 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -427,7 +427,7 @@ Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames( static Sequence< ::rtl::OUString >* pNamesSeq = NULL; if ( !pNamesSeq ) { - pNamesSeq = new Sequence< ::rtl::OUString >( 23 ); + pNamesSeq = new Sequence< ::rtl::OUString >( 24 ); ::rtl::OUString* pNames = pNamesSeq->getArray(); pNames[0] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlEditModel ); pNames[1] = ::rtl::OUString::createFromAscii( szServiceName2_UnoControlFormattedFieldModel ); @@ -452,7 +452,7 @@ Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames( pNames[20] = ::rtl::OUString::createFromAscii( szServiceName_TreeControlModel ); pNames[21] = ::rtl::OUString::createFromAscii( szServiceName_GridControlModel ); pNames[22] = ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel ); - + pNames[23] = ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageModel ); } return *pNamesSeq; } diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 8f400ff1945c..556acbf5d0d2 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -165,7 +165,7 @@ Reference< XPropertySetInfo > UnoControlDialogModel::getPropertySetInfo( ) thro // ============================================================================ UnoDialogControl::UnoDialogControl( const uno::Reference< lang::XMultiServiceFactory >& i_factory ) - :ControlContainerBase( i_factory ) + :UnoDialogControl_Base( i_factory ) ,maTopWindowListeners( *this ) ,mbWindowListener(false) { @@ -188,25 +188,6 @@ UnoDialogControl::~UnoDialogControl() return ::rtl::OUString::createFromAscii( "TabPage" ); } -// XInterface -Any UnoDialogControl::queryAggregation( const Type & rType ) throw(RuntimeException) -{ - uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XTopWindow*, this ) ); - if ( !aRet.hasValue() ) - aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XDialog*, this ) ); - if ( !aRet.hasValue() ) - aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XWindowListener*, this ) ); - return (aRet.hasValue() ? aRet : ControlContainerBase::queryAggregation( rType )); -} - - //lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( UnoDialogControl) - getCppuType( ( uno::Reference< awt::XTopWindow>* ) NULL ), - getCppuType( ( uno::Reference< awt::XDialog>* ) NULL ), - getCppuType( ( uno::Reference< awt::XWindowListener>* ) NULL ), - ControlContainerBase::getTypes() -IMPL_XTYPEPROVIDER_END - void UnoDialogControl::dispose() throw(RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -409,18 +390,30 @@ throw (::com::sun::star::uno::RuntimeException) } } -void SAL_CALL UnoDialogControl::windowShown( const ::com::sun::star::lang::EventObject& e ) -throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoDialogControl::windowShown( const EventObject& e ) throw (RuntimeException) { (void)e; } -void SAL_CALL UnoDialogControl::windowHidden( const ::com::sun::star::lang::EventObject& e ) -throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoDialogControl::windowHidden( const EventObject& e ) throw (RuntimeException) { (void)e; } +void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->endDialog( i_result ); +} + +void SAL_CALL UnoDialogControl::setHelpId( const rtl::OUString& i_id ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->setHelpId( i_id ); +} + void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); diff --git a/toolkit/source/controls/grid/grideventforwarder.cxx b/toolkit/source/controls/grid/grideventforwarder.cxx index c3760b8315a3..c3760b8315a3 100644..100755 --- a/toolkit/source/controls/grid/grideventforwarder.cxx +++ b/toolkit/source/controls/grid/grideventforwarder.cxx diff --git a/toolkit/source/controls/grid/grideventforwarder.hxx b/toolkit/source/controls/grid/grideventforwarder.hxx index 5a8b03f57037..5a8b03f57037 100644..100755 --- a/toolkit/source/controls/grid/grideventforwarder.hxx +++ b/toolkit/source/controls/grid/grideventforwarder.hxx diff --git a/toolkit/source/controls/grid/initguard.hxx b/toolkit/source/controls/grid/initguard.hxx index b2dddd2e5987..b2dddd2e5987 100644..100755 --- a/toolkit/source/controls/grid/initguard.hxx +++ b/toolkit/source/controls/grid/initguard.hxx diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 77a2ffa1637b..77a2ffa1637b 100644..100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index 50f08d3a7113..50f08d3a7113 100644..100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 7fbac44035c6..38f2fd7c2603 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -92,17 +92,6 @@ static const LanguageDependentProp aLanguageDependentProp[] = { 0, 0 } }; -WorkWindow* lcl_GetDefaultWindow() -{ - static WorkWindow* pW = NULL; - if ( !pW ) - { - pW = new WorkWindow( NULL, 0 ); - pW->EnableChildTransparentMode(); - } - return pW; -} - static Sequence< ::rtl::OUString> lcl_ImplGetPropertyNames( const Reference< XMultiPropertySet > & rxModel ) { Sequence< ::rtl::OUString> aNames; @@ -238,14 +227,15 @@ Reference< XWindowPeer > UnoControl::ImplGetCompatiblePeer( sal_Bool bAcceptE Reference< XControl > xMe; OWeakAggObject::queryInterface( ::getCppuType( &xMe ) ) >>= xMe; - WorkWindow* pWW; + Window* pParentWindow( NULL ); { osl::Guard< vos::IMutex > aGuard( Application::GetSolarMutex() ); - pWW = lcl_GetDefaultWindow(); + pParentWindow = dynamic_cast< Window* >( Application::GetDefaultDevice() ); + ENSURE_OR_THROW( pParentWindow != NULL, "could obtain a default parent window!" ); } try { - xMe->createPeer( NULL, pWW->GetComponentInterface( sal_True ) ); + xMe->createPeer( NULL, pParentWindow->GetComponentInterface( sal_True ) ); } catch( const Exception& ) { diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index bff2d6008d10..1bde6f66a3c0 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -28,58 +28,27 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_toolkit.hxx" -#ifndef _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX #include <toolkit/helper/formpdfexport.hxx> -#endif /** === begin UNO includes === **/ -#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ #include <com/sun/star/container/XIndexAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include <com/sun/star/container/XNameAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ #include <com/sun/star/container/XNameContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XFORM_HPP_ #include <com/sun/star/form/XForm.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ #include <com/sun/star/container/XChild.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ #include <com/sun/star/lang/XServiceInfo.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMCOMPONENTTYPE_HPP_ #include <com/sun/star/form/FormComponentType.hpp> -#endif -#ifndef _COM_SUN_STAR_AWT_TEXTALIGN_HPP_ #include <com/sun/star/awt/TextAlign.hpp> -#endif -#ifndef _COM_SUN_STAR_STYLE_VERTICALALIGNMENT_HPP_ #include <com/sun/star/style/VerticalAlignment.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMBUTTONTYPE_HPP_ #include <com/sun/star/form/FormButtonType.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_SUBMITMETHOD_HPP_ #include <com/sun/star/form/FormSubmitMethod.hpp> -#endif /** === end UNO includes === **/ -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> -#endif -#ifndef _VCL_PDFEXTOUTDEVDATA_HXX +#include <tools/diagnose_ex.h> #include <vcl/pdfextoutdevdata.hxx> -#endif -#ifndef _SV_OUTDEV_HXX #include <vcl/outdev.hxx> -#endif #include <functional> #include <algorithm> @@ -315,7 +284,8 @@ namespace toolkitform //-------------------------------------------------------------------- /** creates a PDF compatible control descriptor for the given control */ - void TOOLKIT_DLLPUBLIC describePDFControl( const Reference< XControl >& _rxControl, ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor ) SAL_THROW(()) + void TOOLKIT_DLLPUBLIC describePDFControl( const Reference< XControl >& _rxControl, + ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor, ::vcl::PDFExtOutDevData& i_pdfExportData ) SAL_THROW(()) { _rpDescriptor.reset( NULL ); OSL_ENSURE( _rxControl.is(), "describePDFControl: invalid (NULL) control!" ); @@ -529,7 +499,25 @@ namespace toolkitform } else if ( eButtonType == FormButtonType_URL ) { - OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= pButtonWidget->URL); + ::rtl::OUString sURL; + OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= sURL ); + const bool bDocumentLocalTarget = ( sURL.getLength() > 0 ) && ( sURL.getStr()[0] == '#' ); + if ( bDocumentLocalTarget ) + { + const ::rtl::OUString sDestinationName( sURL.copy(1) ); + // Register the destination for for future handling ... + pButtonWidget->Dest = i_pdfExportData.RegisterDest(); + + // and put it into the bookmarks, to ensure the future handling really happens + ::std::vector< ::vcl::PDFExtOutDevBookmarkEntry >& rBookmarks( i_pdfExportData.GetBookmarks() ); + ::vcl::PDFExtOutDevBookmarkEntry aBookmark; + aBookmark.nDestId = pButtonWidget->Dest; + aBookmark.aBookmark = sURL; + rBookmarks.push_back( aBookmark ); + } + else + pButtonWidget->URL = sURL; + pButtonWidget->Submit = false; } @@ -630,7 +618,7 @@ namespace toolkitform } catch( const Exception& ) { - OSL_ENSURE( sal_False, "describePDFControl: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/tools/inc/tools/debug.hxx b/tools/inc/tools/debug.hxx index 4d640642c69d..63a94555a8c1 100644 --- a/tools/inc/tools/debug.hxx +++ b/tools/inc/tools/debug.hxx @@ -80,7 +80,7 @@ typedef void (*DbgTestSolarMutexProc)(); #define DBG_OUT_MSGBOX 4 #define DBG_OUT_TESTTOOL 5 #define DBG_OUT_DEBUGGER 6 -#define DBG_OUT_COREDUMP 7 +#define DBG_OUT_ABORT 7 #define DBG_OUT_COUNT 8 @@ -137,6 +137,7 @@ struct DbgDataType #define DBG_FUNC_GETPRINTMSGBOX 17 #define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967 #define DBG_FUNC_UPDATEOSLHOOK 19 +#define DBG_FUNC_SET_ABORT 20 TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL ); @@ -180,6 +181,11 @@ inline void DbgSetPrintTestTool( DbgPrintLine pProc ) DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc ); } +inline void DbgSetAbort( DbgPrintLine pProc ) +{ + DbgFunc( DBG_FUNC_SET_ABORT, (void*)(long)pProc ); +} + typedef sal_uInt16 DbgChannelId; /** registers a user-defined channel for emitting the diagnostic messages diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index fd6f499b4036..bbde4efe6d9e 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -152,6 +152,7 @@ struct DebugData DbgPrintLine pDbgPrintMsgBox; DbgPrintLine pDbgPrintWindow; DbgPrintLine pDbgPrintTestTool; + DbgPrintLine pDbgAbort; ::std::vector< DbgPrintLine > aDbgPrintUserChannels; PointerList* pProfList; @@ -163,9 +164,10 @@ struct DebugData DebugData() :bInit( sal_False ) - ,pDbgPrintMsgBox( sal_False ) + ,pDbgPrintMsgBox( NULL ) ,pDbgPrintWindow( NULL ) ,pDbgPrintTestTool( NULL ) + ,pDbgAbort( NULL ) ,pProfList( NULL ) ,pXtorList( NULL ) ,pDbgTestSolarMutex( NULL ) @@ -420,7 +422,7 @@ namespace { const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] ); } @@ -471,26 +473,30 @@ namespace if ( nValueLen ) *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False; } - void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + void lcl_matchOutputChannel( sal_Char const * i_buffer, sal_uIntPtr* o_value ) { + if ( i_buffer == NULL ) + return; const sal_Char* names[ DBG_OUT_COUNT ] = { - "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "coredump" + "dev/null", "file", "window", "shell", "messagebox", "testtool", "debugger", "abort" }; - sal_Char aBuf[20]; - size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); - if ( nValueLen ) + for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) { - for ( sal_uIntPtr name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name ) + if ( strcmp( i_buffer, names[ name ] ) == 0 ) { - if ( strcmp( aBuf, names[ name ] ) == 0 ) - { - *_out_pnValue = name; - return; - } + *o_value = name; + return; } } } + void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) + { + sal_Char aBuf[20]; + size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) ); + if ( nValueLen ) + lcl_matchOutputChannel( aBuf, _out_pnValue ); + } void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag ) { sal_Char aBuf[2]; @@ -811,6 +817,13 @@ static DebugData* GetDebugData() FileClose( pIniFile ); } + else + { + lcl_matchOutputChannel( getenv( "DBGSV_TRACE_OUT" ), &aDebugData.aDbgData.nTraceOut ); + lcl_matchOutputChannel( getenv( "DBGSV_WARNING_OUT" ), &aDebugData.aDbgData.nWarningOut ); + lcl_matchOutputChannel( getenv( "DBGSV_ERROR_OUT" ), &aDebugData.aDbgData.nErrorOut ); + + } getcwd( aCurPath, sizeof( aCurPath ) ); @@ -1199,6 +1212,10 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) pDebugData->pDbgPrintTestTool = (DbgPrintLine)(long)pParam; break; + case DBG_FUNC_SET_ABORT: + pDebugData->pDbgAbort = (DbgPrintLine)(long)pParam; + break; + case DBG_FUNC_SAVEDATA: { const DbgData* pData = static_cast< const DbgData* >( pParam ); @@ -1706,10 +1723,11 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa nOut = DBG_OUT_DEBUGGER; } - if ( nOut == DBG_OUT_COREDUMP ) + if ( nOut == DBG_OUT_ABORT ) { - if ( !ImplCoreDump() ) - nOut = DBG_OUT_DEBUGGER; + if ( pData->pDbgAbort != NULL ) + pData->pDbgAbort( aBufOut ); + abort(); } if ( nOut == DBG_OUT_DEBUGGER ) diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index a1d51376aa0b..ed80110cacc6 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -834,12 +834,24 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData ) for( unsigned int i = 0; i < nPapers; i++ ) { NSString* pPaper = [pPaperNames objectAtIndex: i]; - NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; - if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + // first try to match the name + rtl::OString aPaperName( [pPaper UTF8String] ); + Paper ePaper = PaperInfo::fromPSName( aPaperName ); + if( ePaper != PAPER_USER ) { - PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), - PtTo10Mu( aPaperSize.height ) ); - m_aPaperFormats.push_back( aInfo ); + m_aPaperFormats.push_back( PaperInfo( ePaper ) ); + } + else + { + NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; + if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + { + PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), + PtTo10Mu( aPaperSize.height ) ); + if( aInfo.getPaper() == PAPER_USER ) + aInfo.doSloppyFit(); + m_aPaperFormats.push_back( aInfo ); + } } } } diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index 1130db5bd4a2..1130db5bd4a2 100644..100755 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx index f1e203a84431..bf2a09c1dd42 100644 --- a/vcl/inc/vcl/pdfextoutdevdata.hxx +++ b/vcl/inc/vcl/pdfextoutdevdata.hxx @@ -52,8 +52,24 @@ namespace vcl */ struct PDFExtOutDevBookmarkEntry { + /** ID of the link pointing to the bookmark, or -1 if the entry denotes a destination instead of a link. + */ sal_Int32 nLinkId; + + /** ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a named destination. + */ + sal_Int32 nDestId; + + /** link target name, respectively destination name + */ rtl::OUString aBookmark; + + PDFExtOutDevBookmarkEntry() + :nLinkId( -1 ) + ,nDestId( -1 ) + ,aBookmark() + { + } }; /* @@ -195,6 +211,24 @@ public : -1 if page id does not exist */ sal_Int32 CreateNamedDest( const String& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + + /** registers a destination for which a destinatin ID needs to be known immediately, instead of later on setting it via + SetLinkDest. + + This is used in contexts where a destination is referenced by means other than a link. + + Later in the export process, a call to DescribeRegisteredDest must be made, providing the information about + the destination. + + @return + the unique Id of the destination + */ + sal_Int32 RegisterDest(); + + /** provides detailed information about a destination range which previously has been registered using RegisterDest. + */ + void DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + //<---i56629 /** Create a new destination to be used in a link diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx index 4e792ef40f57..09a8a08d5aca 100644 --- a/vcl/inc/vcl/pdfwriter.hxx +++ b/vcl/inc/vcl/pdfwriter.hxx @@ -939,6 +939,29 @@ The following structure describes the permissions used in PDF security -1 if page id does not exist */ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 ); + + /** creates a destination which is not intended to be referred to by a link, but by a public destination Id. + + Form widgets, for instance, might refer to a destination, without ever actually creating a source link to + point to this destination. In such cases, a public destination Id will be assigned to the form widget, + and later on, the concrete destination data for this public Id will be registered using RegisterDestReference. + + @param rRect + target rectangle on page to be displayed if dest is jumped to + + @param nPageNr + number of page the dest is on (as returned by NewPage) + or -1 in which case the current page is used + + @param eType + what dest type to use + + @returns + the internal destination Id. + */ + sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ ); + + /** Set the destination for a link <p>will change a URL type link to a dest link if necessary</p> diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx index fce105bfa8f8..fce105bfa8f8 100644..100755 --- a/vcl/inc/vcl/region.hxx +++ b/vcl/inc/vcl/region.hxx diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 1a9b9ccaea59..1a9b9ccaea59 100644..100755 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index a50c8aeec149..6649f19e0030 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -346,8 +346,8 @@ static const sal_Char* pDbgHelpText[] = "Attempt to activate the debugger and produce the message there, in order to " "always obtain the corresponding stack trace in the debugger.\n", "\n", -"CoreDump\n", -"Causes a crash\n", +"Abort\n", +"Aborts the application\n", "\n", "\n", "Reroute osl messages - Checkbox\n", @@ -1083,7 +1083,7 @@ DbgDialog::DbgDialog() : maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maTraceBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maTraceBox ); ImplSelectChannel( maTraceBox, pData->nTraceOut, 0 ); maTraceBox.Show(); @@ -1106,7 +1106,7 @@ DbgDialog::DbgDialog() : maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maWarningBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maWarningBox ); ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 ); maWarningBox.Show(); @@ -1135,7 +1135,7 @@ DbgDialog::DbgDialog() : maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "MessageBox" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "TestTool" ) ) ); maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Debugger" ) ) ); - maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "CoreDump" ) ) ); + maErrorBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) ) ); ImplAppendUserDefinedChannels( maErrorBox ); ImplSelectChannel( maErrorBox, pData->nErrorOut, mnErrorOff ); maErrorBox.Show(); @@ -1962,6 +1962,14 @@ void DbgPrintWindow( const char* pLine ) bIn = sal_False; } +// ----------------------------------------------------------------------- + +void DbgAbort( char const * i_message ) +{ + ::rtl::OUString const message( i_message, strlen( i_message ), osl_getThreadTextEncoding() ); + Application::Abort( message ); +} + // ======================================================================= void ImplDbgTestSolarMutex() @@ -1977,6 +1985,7 @@ void DbgGUIInit() DbgSetPrintMsgBox( DbgPrintMsgBox ); DbgSetPrintWindow( DbgPrintWindow ); DbgSetTestSolarMutex( ImplDbgTestSolarMutex ); + DbgSetAbort( DbgAbort ); } // ----------------------------------------------------------------------- @@ -1986,6 +1995,7 @@ void DbgGUIDeInit() DbgSetPrintMsgBox( NULL ); DbgSetPrintWindow( NULL ); DbgSetTestSolarMutex( NULL ); + DbgSetAbort( NULL ); DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin; if ( pDbgWindow ) diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index c075e1b108f3..115d0afbb24d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -370,7 +370,9 @@ void DeInitVCL() aBuf.append( rtl::OUStringToOString( pWin->GetText(), osl_getThreadTextEncoding() ) ); aBuf.append( "\" type = \"" ); aBuf.append( typeid(*pWin).name() ); - aBuf.append( "\"\n" ); + aBuf.append( "\", ptr = 0x" ); + aBuf.append( sal_Int64( pWin ), 16 ); + aBuf.append( "\n" ); } } DBG_ASSERT( nBadTopWindows==0, aBuf.getStr() ); diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 594b76684a1a..49b949bdefdc 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -290,8 +290,15 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n ) Image aImage = mpImplLB->GetEntryList()->GetEntryImage( nChanged ); mpImplWin->SetImage( aImage ); } - mpImplWin->Invalidate(); } + else + { + mpImplWin->SetItemPos( LISTBOX_ENTRY_NOTFOUND ); + mpImplWin->SetString( ImplGetSVEmptyStr() ); + Image aImage; + mpImplWin->SetImage( aImage ); + } + mpImplWin->Invalidate(); } return 1; } diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index b5ecb0761949..b5ecb0761949 100644..100755 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 77458d2b26fd..c47b034e1011 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -31,22 +31,25 @@ #include "vcl/graph.hxx" #include "vcl/outdev.hxx" #include "vcl/gfxlink.hxx" +#include "vcl/dllapi.h" #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolygontools.hxx" #include <boost/shared_ptr.hpp> #include <set> +#include <map> namespace vcl { -struct PDFExtOutDevDataSync +struct SAL_DLLPRIVATE PDFExtOutDevDataSync { enum Action{ CreateNamedDest, CreateDest, CreateLink, SetLinkDest, SetLinkURL, + RegisterDest, CreateOutlineItem, SetOutlineItemParent, SetOutlineItemText, @@ -73,7 +76,15 @@ struct PDFExtOutDevDataSync Action eAct; }; -struct GlobalSyncData +struct SAL_DLLPRIVATE PDFLinkDestination +{ + Rectangle mRect; + MapMode mMapMode; + sal_Int32 mPageNr; + PDFWriter::DestAreaType mAreaType; +}; + +struct SAL_DLLPRIVATE GlobalSyncData { std::deque< PDFExtOutDevDataSync::Action > mActions; std::deque< MapMode > mParaMapModes; @@ -84,6 +95,7 @@ struct GlobalSyncData std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes; std::deque< PDFNote > mParaPDFNotes; std::deque< PDFWriter::PageTransition > mParaPageTransitions; + ::std::map< sal_Int32, PDFLinkDestination > mFutureDestinations; sal_Int32 GetMappedId(); sal_Int32 GetMappedStructId( sal_Int32 ); @@ -145,7 +157,7 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter ) { switch( *aIter ) { - case PDFExtOutDevDataSync::CreateNamedDest : //i56629 + case PDFExtOutDevDataSync::CreateNamedDest : //i56629 { rWriter.Push( PUSH_MAPMODE ); rWriter.SetMapMode( mParaMapModes.front() ); @@ -197,6 +209,21 @@ void GlobalSyncData::PlayGlobalActions( PDFWriter& rWriter ) mParaOUStrings.pop_front(); } break; + case PDFExtOutDevDataSync::RegisterDest : + { + const sal_Int32 nDestId = mParaInts.front(); + mParaInts.pop_front(); + OSL_ENSURE( mFutureDestinations.find( nDestId ) != mFutureDestinations.end(), + "GlobalSyncData::PlayGlobalActions: DescribeRegisteredRequest has not been called for that destination!" ); + + PDFLinkDestination& rDest = mFutureDestinations[ nDestId ]; + + rWriter.Push( PUSH_MAPMODE ); + rWriter.SetMapMode( rDest.mMapMode ); + mParaIds.push_back( rWriter.RegisterDestReference( nDestId, rDest.mRect, rDest.mPageNr, rDest.mAreaType ) ); + rWriter.Pop(); + } + break; case PDFExtOutDevDataSync::CreateOutlineItem : { sal_Int32 nParent = GetMappedId(); @@ -459,6 +486,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM case PDFExtOutDevDataSync::CreateLink: case PDFExtOutDevDataSync::SetLinkDest: case PDFExtOutDevDataSync::SetLinkURL: + case PDFExtOutDevDataSync::RegisterDest: case PDFExtOutDevDataSync::CreateOutlineItem: case PDFExtOutDevDataSync::SetOutlineItemParent: case PDFExtOutDevDataSync::SetOutlineItemText: @@ -617,9 +645,28 @@ sal_Int32 PDFExtOutDevData::CreateNamedDest(const String& sDestName, const Rect mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() ); mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr ); mpGlobalSyncData->mParaDestAreaTypes.push_back( eType ); + return mpGlobalSyncData->mCurId++; } //<---i56629 +sal_Int32 PDFExtOutDevData::RegisterDest() +{ + const sal_Int32 nLinkDestID = mpGlobalSyncData->mCurId++; + mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::RegisterDest ); + mpGlobalSyncData->mParaInts.push_back( nLinkDestID ); + + return nLinkDestID; +} +void PDFExtOutDevData::DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) +{ + OSL_PRECOND( nDestId != -1, "PDFExtOutDevData::DescribeRegisteredDest: invalid destination Id!" ); + PDFLinkDestination aLinkDestination; + aLinkDestination.mRect = rRect; + aLinkDestination.mMapMode = mrOutDev.GetMapMode(); + aLinkDestination.mPageNr = nPageNr == -1 ? mnPage : nPageNr; + aLinkDestination.mAreaType = eType; + mpGlobalSyncData->mFutureDestinations[ nDestId ] = aLinkDestination; +} sal_Int32 PDFExtOutDevData::CreateDest( const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) { mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateDest ); diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index 445365e83dd4..d6c5aed6b52a 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -420,6 +420,10 @@ sal_Int32 PDFWriter::CreateLink( const Rectangle& rRect, sal_Int32 nPageNr ) { return ((PDFWriterImpl*)pImplementation)->createLink( rRect, nPageNr ); } +sal_Int32 PDFWriter::RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, DestAreaType eType ) +{ + return ((PDFWriterImpl*)pImplementation)->registerDestReference( nDestId, rRect, nPageNr, eType ); +} //--->i56629 sal_Int32 PDFWriter::CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 4a37d3a5d601..f8a2bbc051a0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5613,7 +5613,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() if(!m_bIsPDF_A1) { OStringBuffer aDest; - if( rWidget.m_nDest != -1 && appendDest( rWidget.m_nDest, aDest ) ) + if( rWidget.m_nDest != -1 && appendDest( m_aDestinationIdTranslation[ rWidget.m_nDest ], aDest ) ) { aLine.append( "/AA<</D<</Type/Action/S/GoTo/D " ); aLine.append( aDest.makeStringAndClear() ); @@ -10839,6 +10839,11 @@ sal_Int32 PDFWriterImpl::createDest( const Rectangle& rRect, sal_Int32 nPageNr, return nRet; } +sal_Int32 PDFWriterImpl::registerDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType ) +{ + return m_aDestinationIdTranslation[ nDestId ] = createDest( rRect, nPageNr, eType ); +} + sal_Int32 PDFWriterImpl::setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId ) { if( nLinkId < 0 || nLinkId >= (sal_Int32)m_aLinks.size() ) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index c73be7c037e5..5cfe1be8d0f1 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -613,6 +613,9 @@ private: dest id is always the dest's position in this vector */ std::vector<PDFDest> m_aDests; + /** contains destinations accessible via a public Id, instead of being linked to by an ordinary link + */ + ::std::map< sal_Int32, sal_Int32 > m_aDestinationIdTranslation; /* contains all links ever set during PDF creation, link id is always the link's position in this vector */ @@ -1279,6 +1282,7 @@ public: // links sal_Int32 createLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 ); sal_Int32 createDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); + sal_Int32 registerDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ ); sal_Int32 setLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId ); sal_Int32 setLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL ); void setLinkPropertyId( sal_Int32 nLinkId, sal_Int32 nPropertyId ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index c917ea8aa718..3873cdc6cb14 100755 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -333,30 +333,13 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr // setup printer - // if no specific printer is already set, create one - - // #i108686# - // in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs - // however if no printer was already set by the print job's originator, - // and this is an API job, then use the system default location (because - // this is the only sensible default available if the user has no means of changing - // the destination + // #i114306# changed behavior back from persistence + // if no specific printer is already set, create the default printer if( ! pController->getPrinter() ) { rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() ); - bool bSetJobSetup = true; - if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() ) - { - // get printer name from configuration - SettingsConfigItem* pItem = SettingsConfigItem::get(); - aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) ); - bSetJobSetup = false; - } - boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) ); - if( bSetJobSetup ) - pPrinter->SetJobSetup( i_rInitSetup ); + pPrinter->SetJobSetup( i_rInitSetup ); pController->setPrinter( pPrinter ); } diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 96e67aaabffa..96e67aaabffa 100644..100755 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 98e93e748737..d38128e04f1e 100755 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2107,6 +2107,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); + preparePreview( true, false ); } else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) { diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 9cb38756e770..795bea17a3b9 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1646,7 +1646,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight ) // #i42750# presentation wants to be informed about resize // as early as possible WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow->ImplGetWindowImpl()->mpClientWindow); - if( pWorkWindow && pWorkWindow->IsPresentationMode() ) + if( ! pWorkWindow || pWorkWindow->IsPresentationMode() ) + bStartTimer = false; + } + else + { + WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pWindow); + if( ! pWorkWindow || pWorkWindow->IsPresentationMode() ) bStartTimer = false; } } diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 42d1f820acff..3333dc3faef4 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -127,7 +127,7 @@ enum SalRGB { RGB, RBG, RGBA, RBGA, GBRA, GRBA, BGRA, BRGA, - other }; + otherSalRGB }; // -=-= SalVisual =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= class SalVisual : public XVisualInfo diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index 91f6934f27f0..39d2803720c8 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -912,7 +912,7 @@ void SalDisplay::Init() // 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 // doesn't harm. #57791# start maximized if possible - if( (otherwm == eWindowManager_) + if( (otherwm == eWindowManager_) || (olwm == eWindowManager_ )) { eWindowManager_ = fvwm; // ??? @@ -2790,44 +2790,44 @@ SalVisual::SalVisual( const XVisualInfo* pXVI ) if( blue_mask == 0xFF ) eRGBMode_ = RGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = RBG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( blue_mask == 0xFF ) eRGBMode_ = GRB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = GBR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( blue_mask == 0xFF0000 ) if( red_mask == 0xFF00 ) if( green_mask == 0xFF ) eRGBMode_ = BRG; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else if( green_mask == 0xFF00 ) if( red_mask == 0xFF ) eRGBMode_ = BGR; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; else - eRGBMode_ = other; + eRGBMode_ = otherSalRGB; } } @@ -2851,7 +2851,7 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2, int &n3 ) switch( GetMode() ) { - case other: + case otherSalRGB: return sal_False; case SALCOLOR: break; @@ -2886,7 +2886,7 @@ sal_Bool SalVisual::Convert( int &n0, int &n1, int &n2 ) switch( GetMode() ) { - case other: + case otherSalRGB: return sal_False; case SALCOLOR: break; @@ -2939,7 +2939,7 @@ SalColor SalVisual::GetTCColor( Pixel nPixel ) const Pixel g = nPixel & green_mask; Pixel b = nPixel & blue_mask; - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return MAKE_SALCOLOR( r >> nRedShift_, g >> nGreenShift_, b >> nBlueShift_ ); @@ -2970,7 +2970,7 @@ Pixel SalVisual::GetTCPixel( SalColor nSalColor ) const if( SALCOLORREVERSE == eRGBMode_ ) return (b << 16) | (g << 8) | (r); - if( other != eRGBMode_ ) // 8+8+8=24 + if( otherSalRGB != eRGBMode_ ) // 8+8+8=24 return (r << nRedShift_) | (g << nGreenShift_) | (b << nBlueShift_); if( nRedShift_ > 0 ) r <<= nRedShift_; else r >>= -nRedShift_; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index dc1ec968d859..df23220ea6d5 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1217,6 +1217,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double aPolygon.transform( basegfx::tools::createTranslateB2DHomMatrix(+fHalfWidth,+fHalfWidth) ); // shortcut for hairline drawing to improve performance + bool bDrawnOk = true; if( bIsHairline ) { // hairlines can benefit from a simplified tesselation @@ -1225,17 +1226,13 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() ); // draw tesselation result - if( ! aB2DTrapVector.empty() ) - { - const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); + const int nTrapCount = aB2DTrapVector.size(); + if( nTrapCount > 0 ) + bDrawnOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); - // restore the original brush GC - nBrushColor_ = aKeepBrushColor; - return bDrawOk; - } - else - return true; + // restore the original brush GC + nBrushColor_ = aKeepBrushColor; + return bDrawnOk; } // get the area polygon for the line polygon @@ -1258,19 +1255,18 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double // draw each area polypolygon component individually // to emulate the polypolygon winding rule "non-zero" - bool bDrawOk = true; const int nPolyCount = aAreaPolyPoly.count(); for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) ); - bDrawOk = drawPolyPolygon( aOnePoly, fTransparency ); - if( !bDrawOk ) + bDrawnOk = drawPolyPolygon( aOnePoly, fTransparency ); + if( !bDrawnOk ) break; } // restore the original brush GC nBrushColor_ = aKeepBrushColor; - return bDrawOk; + return bDrawnOk; } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 73d93d42dd03..73d93d42dd03 100644..100755 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx index dc3368c26912..dc3368c26912 100644..100755 --- a/vcl/win/source/gdi/salgdi2.cxx +++ b/vcl/win/source/gdi/salgdi2.cxx diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index a235d6785706..a235d6785706 100644..100755 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx |