From 1086d8c4ec1339dc7be45e497f676d8f282360b8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 26 Aug 2010 15:02:13 +0200 Subject: impress200: #i114123# fix graphics context refcount for drawEPS --- vcl/aqua/source/gdi/salgdi.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 8a4744d1efcd..ca3fcc04769a 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1453,16 +1453,24 @@ BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, // prepare the target context NSGraphicsContext* pOrigNSCtx = [NSGraphicsContext currentContext]; + [pOrigNSCtx retain]; + + // create new context NSGraphicsContext* pDrawNSCtx = [NSGraphicsContext graphicsContextWithGraphicsPort: mrContext flipped: IsFlipped()]; + // set it, setCurrentContext also releases the prviously set one [NSGraphicsContext setCurrentContext: pDrawNSCtx]; + // draw the EPS const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}}; const BOOL bOK = [xEpsImage drawInRect: aDstRect]; + + // restore the NSGraphicsContext + [NSGraphicsContext setCurrentContext: pOrigNSCtx]; + [pOrigNSCtx release]; // restore the original retain count + CGContextRestoreGState( mrContext ); // mark the destination rectangle as updated RefreshRect( aDstRect ); - // restore the NSGraphicsContext, TODO: do we need this? - [NSGraphicsContext setCurrentContext: pOrigNSCtx]; return bOK; } -- cgit v1.2.3 From 01554964f184b98fe79ecd52200a71cae33968bf Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Thu, 26 Aug 2010 14:17:29 +0200 Subject: impress200: #i113884# check for overflow in ScTable::SetDrawPageSize --- sc/source/core/data/table2.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index d54e16b8cbd7..4223c05c4f83 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3100,10 +3100,13 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if( pDrawLayer ) { - long x = GetColOffset( MAXCOL + 1 ); - long y = GetRowOffset( MAXROW + 1 ); - x = (long) ((double) x * HMM_PER_TWIPS); - y = (long) ((double) y * HMM_PER_TWIPS); + double fValX = GetColOffset( MAXCOL + 1 ) * HMM_PER_TWIPS; + double fValY = GetRowOffset( MAXROW + 1 ) * HMM_PER_TWIPS; + const long nMax = ::std::numeric_limits::max(); + // #i113884# Avoid int32 overflow with possible negative results than can cause bad effects. + // If the draw page size is smaller than all rows, only the bottom of the sheet is affected. + long x = ( fValX > (double)nMax ) ? nMax : (long) fValX; + long y = ( fValY > (double)nMax ) ? nMax : (long) fValY; if ( IsLayoutRTL() ) // IsNegativePage x = -x; -- cgit v1.2.3 From afdd5d014cceee0796c9caa297ab2489a24da616 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 26 Aug 2010 16:36:49 +0200 Subject: impress200: #i101006# Prevent multiple master pages with identical names. --- sd/source/ui/toolpanel/controls/DocumentHelper.cxx | 93 +++++++++++++++------- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx index b9040e72283f..c5919b7aa7ee 100755 --- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx +++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx @@ -503,45 +503,78 @@ SdPage* DocumentHelper::ProvideMasterPage ( SdPage* pMasterPage, const ::boost::shared_ptr >& rpPageList) { - SdPage* pMasterPageInDocument = NULL; - - // Get notes master page. + // Make sure that both the master page and its notes master exist + // in the source document. If one is missing then return without + // making any changes. + if (pMasterPage == NULL) + { + // The caller should make sure that the master page is valid. + OSL_ASSERT(pMasterPage != NULL); + return NULL; + } SdDrawDocument* pSourceDocument = static_cast(pMasterPage->GetModel()); + if (pSourceDocument == NULL) + return NULL; SdPage* pNotesMasterPage = static_cast( - pSourceDocument->GetMasterPage (pMasterPage->GetPageNum()+1)); - if (pNotesMasterPage != NULL) + pSourceDocument->GetMasterPage(pMasterPage->GetPageNum()+1)); + if (pNotesMasterPage == NULL) { - // When the given master page or its associated notes master page do - // not already belong to the document we have to create copies of - // them and insert them into the document. - - // Determine the position where the new master pages are inserted. - // By default they are inserted at the end. When we assign to a - // master page then insert after the last of the (selected) pages. - USHORT nInsertionIndex = rTargetDocument.GetMasterPageCount(); - if (rpPageList->front()->IsMasterPage()) + // The model is not in a valid state. Maybe a new master page + // is being (not finished yet) created? Return without making + // any changes. + return NULL; + } + + SdPage* pMasterPageInDocument = NULL; + // Search for a master page with the same name as the given one in + // the target document. + const XubString sMasterPageLayoutName (pMasterPage->GetLayoutName()); + for (USHORT nIndex=0,nCount=rTargetDocument.GetMasterPageCount(); nIndex(rTargetDocument.GetMasterPage(nIndex)); + if (pCandidate!=NULL + && sMasterPageLayoutName==pCandidate->GetLayoutName()) { - nInsertionIndex = rpPageList->back()->GetPageNum(); + // The requested master page does already exist in the + // target document, return it. + return pCandidate; } + } - if (pMasterPage->GetModel() != &rTargetDocument) - { - pMasterPageInDocument = AddMasterPage (rTargetDocument, pMasterPage, nInsertionIndex); - if( rTargetDocument.IsUndoEnabled() ) + // The given master page does not already belong to the target + // document so we have to create copies and insert them into the + // targer document. + + // Determine the position where the new master pages are inserted. + // By default they are inserted at the end. When we assign to a + // master page then insert after the last of the (selected) pages. + USHORT nInsertionIndex = rTargetDocument.GetMasterPageCount(); + if (rpPageList->front()->IsMasterPage()) + { + nInsertionIndex = rpPageList->back()->GetPageNum(); + } + + // Clone the master page. + if (pMasterPage->GetModel() != &rTargetDocument) + { + pMasterPageInDocument = AddMasterPage (rTargetDocument, pMasterPage, nInsertionIndex); + if( rTargetDocument.IsUndoEnabled() ) rTargetDocument.AddUndo( rTargetDocument.GetSdrUndoFactory().CreateUndoNewPage(*pMasterPageInDocument)); - } - else - pMasterPageInDocument = pMasterPage; - if (pNotesMasterPage->GetModel() != &rTargetDocument) - { - SdPage* pClonedNotesMasterPage - = AddMasterPage (rTargetDocument, pNotesMasterPage, nInsertionIndex+1); - if( rTargetDocument.IsUndoEnabled() ) - rTargetDocument.AddUndo( - rTargetDocument.GetSdrUndoFactory().CreateUndoNewPage(*pClonedNotesMasterPage)); - } } + else + pMasterPageInDocument = pMasterPage; + + // Clone the notes master. + if (pNotesMasterPage->GetModel() != &rTargetDocument) + { + SdPage* pClonedNotesMasterPage + = AddMasterPage (rTargetDocument, pNotesMasterPage, nInsertionIndex+1); + if( rTargetDocument.IsUndoEnabled() ) + rTargetDocument.AddUndo( + rTargetDocument.GetSdrUndoFactory().CreateUndoNewPage(*pClonedNotesMasterPage)); + } + return pMasterPageInDocument; } -- cgit v1.2.3 From 42388c96d2d15b636507fc14f75f827916ef24b9 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 20 Aug 2010 09:32:17 +0200 Subject: jl158 #i114008# extension can now contain compiled help. Then XPackage::getRegistrationDataURL points to the help folder within the extension --- .../source/deployment/registry/help/dp_help.cxx | 406 ++++++++++++--------- 1 file changed, 233 insertions(+), 173 deletions(-) diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index bc17a1f7163d..5a5efe825cfb 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -80,6 +80,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend ::rtl::Reference const & abortChannel, Reference const & xCmdEnv ); + bool extensionContainsCompiledHelp(); public: PackageImpl( ::rtl::Reference const & myBackend, @@ -100,7 +101,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference const & xCmdEnv ); void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, - Reference const & xCmdEnv); + bool compiledHelp, Reference const & xCmdEnv); void implCollectXhpFiles( const rtl::OUString& aDir, std::vector< rtl::OUString >& o_rXhpFileVector ); @@ -259,6 +260,57 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const return pBackend; } + +bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() +{ + bool bCompiled = true; + rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl(getURL()); + + ::osl::Directory helpFolder(aExpandedHelpURL); + if ( helpFolder.open() == ::osl::File::E_None) + { + //iterate over the contents of the help folder + //We assume that all folders withing the help folder contain language specific + //help files. If just one of them does not contain compiled help then this + //function returns false. + ::osl::DirectoryItem item; + ::osl::File::RC errorNext = ::osl::File::E_None; + while ((errorNext = helpFolder.getNextItem(item)) == ::osl::File::E_None) + { + //No find the language folders + ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileName |FileStatusMask_FileURL); + if (item.getFileStatus(stat) == ::osl::File::E_None) + { + if (stat.getFileType() != ::osl::FileStatus::Directory) + continue; + + //look if there is the folder help.idxl in the language folder + OUString compUrl(stat.getFileURL() + OUSTR("/help.idxl")); + ::osl::Directory compiledFolder(compUrl); + if (compiledFolder.open() != ::osl::File::E_None) + { + bCompiled = false; + break; + } + } + else + { + //Error + OSL_ASSERT(0); + bCompiled = false; + break; + } + } + if (errorNext != ::osl::File::E_NOENT + && errorNext != ::osl::File::E_None) + { + //Error + OSL_ASSERT(0); + bCompiled = false; + } + } + return bCompiled; +} //______________________________________________________________________________ beans::Optional< beans::Ambiguous > BackendImpl::PackageImpl::isRegistered_( @@ -289,7 +341,8 @@ void BackendImpl::PackageImpl::processPackage_( BackendImpl* that = getMyBackend(); Reference< deployment::XPackage > xThisPackage( this ); - that->implProcessHelp( xThisPackage, doRegisterPackage, xCmdEnv); + that->implProcessHelp( xThisPackage, doRegisterPackage, + extensionContainsCompiledHelp(), xCmdEnv); } beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() @@ -316,213 +369,220 @@ static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) ); void BackendImpl::implProcessHelp -( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, +( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp, Reference const & xCmdEnv) { OSL_ASSERT(xPackage.is()); if (doRegisterPackage) { HelpBackendDb::Data data; - const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); - data.dataUrl = sHelpFolder; - - Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); - rtl::OUString aHelpURL = xPackage->getURL(); - rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); - rtl::OUString aName = xPackage->getName(); - if( !xSFA->isFolder( aExpandedHelpURL ) ) + + if (compiledHelp) { - rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); - aErrStr += rtl::OUString::createFromAscii( "No help folder" ); - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + data.dataUrl = xPackage->getURL(); } - - Reference const & xContext = getComponentContext(); - Reference< script::XInvocation > xInvocation; - if( xContext.is() ) + else { - try + const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); + data.dataUrl = sHelpFolder; + + Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); + rtl::OUString aHelpURL = xPackage->getURL(); + rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); + rtl::OUString aName = xPackage->getName(); + if( !xSFA->isFolder( aExpandedHelpURL ) ) { - xInvocation = Reference< script::XInvocation >( - xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); + aErrStr += rtl::OUString::createFromAscii( "No help folder" ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); } - catch (Exception &) + + Reference const & xContext = getComponentContext(); + Reference< script::XInvocation > xInvocation; + if( xContext.is() ) { - // i98680: Survive missing lucene + try + { + xInvocation = Reference< script::XInvocation >( + xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( + "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + } + catch (Exception &) + { + // i98680: Survive missing lucene + } } - } - // Scan languages - Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); - sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); - const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); - for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) - { - rtl::OUString aLangURL = pSeq[iLang]; - if( xSFA->isFolder( aLangURL ) ) + // Scan languages + Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); + sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); + const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); + for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) { - std::vector< rtl::OUString > aXhpFileVector; - - // calculate jar file URL - sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); - // for example "/en" - OUString langFolderURLSegment( - aLangURL.copy( - indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); - - //create the folder in the "temporary folder" - ::ucbhelper::Content langFolderContent; - const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); - const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); - ::dp_misc::create_folder( - &langFolderContent, - langFolderDest, xCmdEnv); - - rtl::OUString aJarFile( - makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + - OUSTR(".jar"))); - aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); - - rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( - aJarFile, rtl_UriCharClassPchar, - rtl_UriEncodeIgnoreEscapes, - RTL_TEXTENCODING_UTF8 ); - rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); - aDestBasePath += aEncodedJarFilePath; - aDestBasePath += rtl::OUString::createFromAscii( "/" ); - - sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; - - Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); - sal_Int32 nSubLangCount = aSubLangSeq.getLength(); - const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); - for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + rtl::OUString aLangURL = pSeq[iLang]; + if( xSFA->isFolder( aLangURL ) ) { - rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; - if( !xSFA->isFolder( aSubFolderURL ) ) - continue; + std::vector< rtl::OUString > aXhpFileVector; + + // calculate jar file URL + sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); + // for example "/en" + OUString langFolderURLSegment( + aLangURL.copy( + indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); + + //create the folder in the "temporary folder" + ::ucbhelper::Content langFolderContent; + const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); + const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); + ::dp_misc::create_folder( + &langFolderContent, + langFolderDest, xCmdEnv); + + rtl::OUString aJarFile( + makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + + OUSTR(".jar"))); + aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); + + rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( + aJarFile, rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); + aDestBasePath += aEncodedJarFilePath; + aDestBasePath += rtl::OUString::createFromAscii( "/" ); + + sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; + + Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); + sal_Int32 nSubLangCount = aSubLangSeq.getLength(); + const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); + for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + { + rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; + if( !xSFA->isFolder( aSubFolderURL ) ) + continue; - implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); + implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); - // Copy to package (later: move?) - rtl::OUString aDestPath = aDestBasePath; - rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); - aDestPath += aPureFolderName; - xSFA->copy( aSubFolderURL, aDestPath ); - } + // Copy to package (later: move?) + rtl::OUString aDestPath = aDestBasePath; + rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); + aDestPath += aPureFolderName; + xSFA->copy( aSubFolderURL, aDestPath ); + } - // Call compiler - sal_Int32 nXhpFileCount = aXhpFileVector.size(); - rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - { - rtl::OUString aXhpFile = aXhpFileVector[iXhp]; - rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); - pXhpFiles[iXhp] = aXhpRelFile; - } + // Call compiler + sal_Int32 nXhpFileCount = aXhpFileVector.size(); + rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; + for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) + { + rtl::OUString aXhpFile = aXhpFileVector[iXhp]; + rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); + pXhpFiles[iXhp] = aXhpRelFile; + } - rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); - rtl::OUString aOfficeHelpPathFileURL; - ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); + rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); + rtl::OUString aOfficeHelpPathFileURL; + ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); - HelpProcessingErrorInfo aErrorInfo; - bool bSuccess = compileExtensionHelp( - aOfficeHelpPathFileURL, aHelpStr, aLangURL, - nXhpFileCount, pXhpFiles, - langFolderDestExpanded, aErrorInfo ); + HelpProcessingErrorInfo aErrorInfo; + bool bSuccess = compileExtensionHelp( + aOfficeHelpPathFileURL, aHelpStr, aLangURL, + nXhpFileCount, pXhpFiles, + langFolderDestExpanded, aErrorInfo ); - if( bSuccess && xInvocation.is() ) - { - Sequence aParamsSeq( 6 ); - - aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); - - rtl::OUString aLang; - sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); - if( nLastSlash != -1 ) - aLang = aLangURL.copy( nLastSlash + 1 ); - else - aLang = rtl::OUString::createFromAscii( "en" ); - aParamsSeq[1] = uno::makeAny( aLang ); - - aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); - aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); - - aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); - rtl::OUString aSystemPath; - osl::FileBase::getSystemPathFromFileURL( - langFolderDestExpanded, aSystemPath ); - aParamsSeq[5] = uno::makeAny( aSystemPath ); - - Sequence< sal_Int16 > aOutParamIndex; - Sequence< uno::Any > aOutParam; - uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), - aParamsSeq, aOutParamIndex, aOutParam ); - } - - if( !bSuccess ) - { - USHORT nErrStrId = 0; - switch( aErrorInfo.m_eErrorClass ) + if( bSuccess && xInvocation.is() ) { - case HELPPROCESSING_GENERAL_ERROR: - case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; - case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; - default: ; - }; - - rtl::OUString aErrStr; - if( nErrStrId != 0 ) + Sequence aParamsSeq( 6 ); + + aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); + + rtl::OUString aLang; + sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); + if( nLastSlash != -1 ) + aLang = aLangURL.copy( nLastSlash + 1 ); + else + aLang = rtl::OUString::createFromAscii( "en" ); + aParamsSeq[1] = uno::makeAny( aLang ); + + aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); + aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); + + aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); + rtl::OUString aSystemPath; + osl::FileBase::getSystemPathFromFileURL( + langFolderDestExpanded, aSystemPath ); + aParamsSeq[5] = uno::makeAny( aSystemPath ); + + Sequence< sal_Int16 > aOutParamIndex; + Sequence< uno::Any > aOutParam; + uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), + aParamsSeq, aOutParamIndex, aOutParam ); + } + + if( !bSuccess ) { - aErrStr = getResourceString( nErrStrId ); - - // Remoce CR/LF - rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); - sal_Unicode nCR = 13, nLF = 10; - sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); - sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); - sal_Int32 nCopy; - if( nSearchCR != -1 || nSearchLF != -1 ) + USHORT nErrStrId = 0; + switch( aErrorInfo.m_eErrorClass ) { - if( nSearchCR == -1 ) - nCopy = nSearchLF; - else if( nSearchLF == -1 ) - nCopy = nSearchCR; - else - nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; - - aErrMsg = aErrMsg.copy( 0, nCopy ); - } - aErrStr += aErrMsg; - if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) + case HELPPROCESSING_GENERAL_ERROR: + case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; + case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; + default: ; + }; + + rtl::OUString aErrStr; + if( nErrStrId != 0 ) { - aErrStr += rtl::OUString::createFromAscii( " in " ); - - rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, - rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - aErrStr += aDecodedFile; - if( aErrorInfo.m_nXMLParsingLine != -1 ) + aErrStr = getResourceString( nErrStrId ); + + // Remoce CR/LF + rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); + sal_Unicode nCR = 13, nLF = 10; + sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); + sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); + sal_Int32 nCopy; + if( nSearchCR != -1 || nSearchLF != -1 ) { - aErrStr += rtl::OUString::createFromAscii( ", line " ); - aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + if( nSearchCR == -1 ) + nCopy = nSearchLF; + else if( nSearchLF == -1 ) + nCopy = nSearchCR; + else + nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; + + aErrMsg = aErrMsg.copy( 0, nCopy ); + } + aErrStr += aErrMsg; + if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) + { + aErrStr += rtl::OUString::createFromAscii( " in " ); + + rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, + rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); + aErrStr += aDecodedFile; + if( aErrorInfo.m_nXMLParsingLine != -1 ) + { + aErrStr += rtl::OUString::createFromAscii( ", line " ); + aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + } } } - } - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + } } } } - //Writing the data entry replaces writing the flag file. If we got to this //point the registration was successful. addDataToDb(xPackage->getURL(), data); - } + } //if (doRegisterPackage) else { deleteDataFromDb(xPackage->getURL()); -- cgit v1.2.3 From e70c9b5e20258f3e19ce2c364f8050d019a582d1 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 23 Aug 2010 12:49:12 +0200 Subject: jl158 #i114008# helplinker -extlangsrc -extlangdest implemented. This allows processing of the extension help files by using the helplinker executable. --- l10ntools/source/help/HelpLinker.cxx | 117 ++++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 22 deletions(-) diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 94139f89de1e..411859bfe994 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -269,6 +269,8 @@ private: fs::path idxContentStylesheet; fs::path zipdir; fs::path outputFile; + std::string extsource; + std::string extdestination; std::string module; std::string lang; std::string hid; @@ -762,18 +764,9 @@ void HelpLinker::main( std::vector &args, const rtl::OUString* pOfficeHelpPath ) throw( HelpProcessingException ) { - rtl::OUString aOfficeHelpPath; - bExtensionMode = false; - if( pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath ) - { - helpFiles.clear(); - bExtensionMode = true; - extensionPath = *pExtensionPath; - sourceRoot = fs::path(extensionPath); - extensionDestination = *pDestination; - aOfficeHelpPath = *pOfficeHelpPath; - } + helpFiles.clear(); + if (args.size() > 0 && args[0][0] == '@') { std::vector stringList; @@ -793,10 +786,34 @@ void HelpLinker::main( std::vector &args, } size_t i = 0; - + bool bSrcOption = false; while (i < args.size()) { - if (args[i].compare("-src") == 0) + if (args[i].compare("-extlangsrc") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "extension source missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + extsource = args[i]; + } + else if (args[i].compare("-extlangdest") == 0) + { + //If this argument is not provided then the location provided in -extsource will + //also be the destination + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "extension destination missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + extdestination = args[i]; + } + else if (args[i].compare("-src") == 0) { ++i; if (i >= args.size()) @@ -805,9 +822,8 @@ void HelpLinker::main( std::vector &args, aStrStream << "sourceroot missing" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - - if( !bExtensionMode ) - sourceRoot = fs::path(args[i], fs::native); + bSrcOption = true; + sourceRoot = fs::path(args[i], fs::native); } else if (args[i].compare("-sty") == 0) { @@ -933,21 +949,70 @@ void HelpLinker::main( std::vector &args, ++i; } + //We can be called from the helplinker executable or the extension manager + //In the latter case extsource is not used. + if( (pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath) + || !extsource.empty()) + { + bExtensionMode = true; + if (!extsource.empty()) + { + //called from helplinker.exe, pExtensionPath and pOfficeHelpPath + //should be NULL + sourceRoot = fs::path(extsource, fs::native); + extensionPath = sourceRoot.toUTF8(); + + if (extdestination.empty()) + { + std::stringstream aStrStream; + aStrStream << "-extlangdest is missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + else + { + //Convert from system path to file URL!!! + fs::path p(extdestination, fs::native); + extensionDestination = p.toUTF8(); + } + } + else + { //called from extension manager + extensionPath = *pExtensionPath; + sourceRoot = fs::path(extensionPath); + extensionDestination = *pDestination; + } + //check if -src option was used. This option must not be used + //when extension help is compiled. + if (bSrcOption) + { + std::stringstream aStrStream; + aStrStream << "-src must not be used together with -extsource missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + } + if (!bExtensionMode && zipdir.empty()) { std::stringstream aStrStream; aStrStream << "no index dir given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - if (!bExtensionMode && idxCaptionStylesheet.empty()) + + if (!bExtensionMode && idxCaptionStylesheet.empty() + || !extsource.empty() && idxCaptionStylesheet.empty()) { + //No extension mode and extension mode using commandline + //!extsource.empty indicates extension mode using commandline + // -idxcaption paramter is required std::stringstream aStrStream; aStrStream << "no index caption stylesheet given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - else if ( bExtensionMode ) + else if ( bExtensionMode && extsource.empty()) { - rtl::OUString aIdxCaptionPathFileURL( aOfficeHelpPath ); + //This part is used when compileExtensionHelp is called from the extensions manager. + //If extension help is compiled using helplinker in the build process + rtl::OUString aIdxCaptionPathFileURL( *pOfficeHelpPath ); aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" ); rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString @@ -956,15 +1021,23 @@ void HelpLinker::main( std::vector &args, idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL ); } - if (!bExtensionMode && idxContentStylesheet.empty()) + + if (!bExtensionMode && idxContentStylesheet.empty() + || !extsource.empty() && idxContentStylesheet.empty()) { + //No extension mode and extension mode using commandline + //!extsource.empty indicates extension mode using commandline + // -idxcontent paramter is required std::stringstream aStrStream; aStrStream << "no index content stylesheet given" << std::endl; throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); } - else if ( bExtensionMode ) + else if ( bExtensionMode && extsource.empty()) { - rtl::OUString aIdxContentPathFileURL( aOfficeHelpPath ); + //If extension help is compiled using helplinker in the build process + //then -idxcontent must be supplied + //This part is used when compileExtensionHelp is called from the extensions manager. + rtl::OUString aIdxContentPathFileURL( *pOfficeHelpPath ); aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" ); rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString -- cgit v1.2.3 From bd31d439a08f6677b481fbd37791d7d53c971a55 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 23 Aug 2010 16:44:43 +0200 Subject: jl158 #i114008# HelpIndexerTool -extension ... implemented. This allows processing of the extension help files by using the java class in the build environment --- l10ntools/source/help/HelpIndexerTool.java | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java index 2a49f964d48f..a39b5399e38d 100644 --- a/l10ntools/source/help/HelpIndexerTool.java +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -72,6 +72,9 @@ public class HelpIndexerTool String aSegmentName = ""; // Scan arguments + //If this tool is invoked in the build process for extensions help, + //then -extension must be set. + boolean bExtension = false; boolean bLang = false; boolean bMod = false; boolean bZipDir = false; @@ -83,7 +86,11 @@ public class HelpIndexerTool int nArgCount = args.length; for( int i = 0 ; i < nArgCount ; i++ ) { - if( "-lang".equals(args[i]) ) + if( "-extension".equals(args[i]) ) + { + bExtension = true; + } + else if( "-lang".equals(args[i]) ) { if( i + 1 < nArgCount ) { @@ -142,20 +149,21 @@ public class HelpIndexerTool bSegmentName = true; } i++; - if (!(bCfsName && bSegmentName)) - { - System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)"); - System.exit( -1 ); - } + if (!(bCfsName && bSegmentName)) + { + System.out.println("Usage: HelpIndexer -checkcfsandsegname _0 _3 (2 arguments needed)"); + System.exit( -1 ); + } } } - if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode) ) + if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode && !bExtension) ) { if( bExtensionMode ) return; System.out.println("Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -zipdir TempZipDir -o OutputZipFile"); + System.out.println("Usage: HelpIndexer -extension -lang ISOLangCode -mod HelpModule -zipdir PathToLangDir"); System.exit( -1 ); } @@ -199,7 +207,7 @@ public class HelpIndexerTool System.out.println( "Checking segment file " + aSegmentName+ ": " + (bSegmentFileOk ? "Found" : "Not found") ); } - if( bExtensionMode ) + if( bExtensionMode || bExtension) { if( !bSrcDir ) { -- cgit v1.2.3 From 96a48f7977616c3484d590c2bc3f70298af0cc94 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Aug 2010 16:14:14 +0200 Subject: dba33h: #i114022# properly handle new/empty images --- forms/source/component/ImageControl.cxx | 12 +++++++++--- forms/source/component/imgprod.cxx | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index f74e82135708..13155d54cf48 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -523,7 +523,13 @@ Any OImageControlModel::translateDbColumnToControlValue() { switch ( lcl_getImageStoreType( getFieldType() ) ) { - case ImageStoreBinary: return makeAny( m_xColumn->getBinaryStream() ); + case ImageStoreBinary: + { + Reference< XInputStream > xImageStream( m_xColumn->getBinaryStream() ); + if ( m_xColumn->wasNull() ) + xImageStream.clear(); + return makeAny( xImageStream ); + } case ImageStoreLink: { ::rtl::OUString sImageLink( m_xColumn->getString() ); @@ -634,10 +640,10 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException) //------------------------------------------------------------------------------ IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic ) { - ENSURE_OR_RETURN( i_pGraphic, "OImageControlModel::OnImageImportDone: illegal graphic!", 0L ); + const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : NULL ); setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ), - makeAny( Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() ) + makeAny( xGraphic ) ); return 1L; } diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index 7e0293be334e..07abd703281d 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -351,6 +351,9 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept // delete interfaces in temporary list for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() ) delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons; + + if ( maDoneHdl.IsSet() ) + maDoneHdl.Call( NULL ); } } } -- cgit v1.2.3 From 93f90c4e7d40e142b57e6c8c08dc080ccf4b478e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Aug 2010 12:02:20 +0200 Subject: dba33h: #i112659# ensure bound image controls never embed their image in the surrounding document --- forms/source/component/ImageControl.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 13155d54cf48..b433dec92d70 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -800,6 +800,11 @@ bool OImageControlControl::implInsertGraphics() implClearGraphics( sal_False ); sal_Bool bIsLink = sal_False; xController->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bIsLink; + // Force bIsLink to be TRUE if we're bound to a field. Though we initialized the file picker with IsLink=TRUE + // in this case, and disabled the respective control, there might be picker implementations which do not + // respect this, and return IsLink=FALSE here. In this case, "normalize" the flag. + // #i112659# / 2010-08-26 / frank.schoenheit@oracle.com + bIsLink |= bHasField; if ( !bIsLink ) { Graphic aGraphic; -- cgit v1.2.3 From e4a1230f6b6d387e87ff29ebd743609701e11c6f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Aug 2010 15:24:03 +0200 Subject: dba33h: #i113991# handle ImageURL and Graphic properties ourselves, do not leave this to the aggregate. Otherwise, both the aggregate and we try to sync those, which is good for some problems ... --- forms/source/component/FormComponent.cxx | 104 ++++++++++------------------- forms/source/component/ImageControl.cxx | 109 ++++++++++++++++++------------- forms/source/component/ImageControl.hxx | 14 ++-- forms/source/inc/FormComponent.hxx | 22 +++++++ forms/source/inc/frm_strings.hxx | 1 + forms/source/inc/property.hrc | 2 +- forms/source/misc/property.cxx | 1 + 7 files changed, 134 insertions(+), 119 deletions(-) diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 148e4c9aa298..f9d3ffab9709 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -507,14 +507,12 @@ DBG_NAME(OControlModel) //------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getImplementationId() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getImplementationId" ); return OImplementationIds::getImplementationId(getTypes()); } //------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getTypes() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getTypes" ); TypeBag aTypes( _getTypes() ); Reference< XTypeProvider > xProv; @@ -527,7 +525,6 @@ Sequence SAL_CALL OControlModel::getTypes() throw(RuntimeException) //------------------------------------------------------------------------------ Sequence OControlModel::_getTypes() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" ); return TypeBag( OComponentHelper::getTypes(), OPropertySetAggregationHelper::getTypes(), OControlModel_BASE::getTypes() @@ -537,7 +534,6 @@ Sequence OControlModel::_getTypes() //------------------------------------------------------------------ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" ); // base class 1 Any aReturn(OComponentHelper::queryAggregation(_rType)); @@ -561,7 +557,6 @@ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeE //------------------------------------------------------------------------------ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XObjectInputStream >& _rxInStream) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readHelpTextCompatibly" ); ::rtl::OUString sHelpText; ::comphelper::operator>>( _rxInStream, sHelpText); try @@ -578,7 +573,6 @@ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XOb //------------------------------------------------------------------------------ void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XObjectOutputStream >& _rxOutStream) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeHelpTextCompatibly" ); ::rtl::OUString sHelpText; try { @@ -609,7 +603,6 @@ OControlModel::OControlModel( // the native look is ugly .... // #i37342# / 2004-11-19 / frank.schoenheit@sun.com { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel" ); DBG_CTOR(OControlModel, NULL); if (_rUnoControlModelTypeName.getLength()) // the is a model we have to aggregate { @@ -651,7 +644,6 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference< ,m_nTabIndex( FRM_DEFAULT_TABINDEX ) ,m_nClassId( FormComponentType::CONTROL ) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel(copy)" ); DBG_CTOR( OControlModel, NULL ); DBG_ASSERT( _pOriginal, "OControlModel::OControlModel: invalid original!" ); @@ -696,14 +688,12 @@ OControlModel::~OControlModel() //------------------------------------------------------------------ void OControlModel::clonedFrom( const OControlModel* /*_pOriginal*/ ) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::clonedFrom" ); // nothing to do in this base class } //------------------------------------------------------------------------------ void OControlModel::doResetDelegator() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doResetDelegator" ); if (m_xAggregate.is()) m_xAggregate->setDelegator(NULL); } @@ -711,7 +701,6 @@ void OControlModel::doResetDelegator() //------------------------------------------------------------------------------ void OControlModel::doSetDelegator() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doSetDelegator" ); increment(m_refCount); if (m_xAggregate.is()) { @@ -724,14 +713,12 @@ void OControlModel::doSetDelegator() //------------------------------------------------------------------------------ InterfaceRef SAL_CALL OControlModel::getParent() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getParent" ); return m_xParent; } //------------------------------------------------------------------------------ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setParent" ); osl::MutexGuard aGuard(m_aMutex); Reference xComp(m_xParent, UNO_QUERY); @@ -749,7 +736,6 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL OControlModel::getName() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getName" ); ::rtl::OUString aReturn; OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= aReturn; return aReturn; @@ -758,7 +744,6 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com: //------------------------------------------------------------------------------ void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setName" ); setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName)); } @@ -766,7 +751,6 @@ void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(Runtim //------------------------------------------------------------------------------ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceName) throw ( RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::supportsService" ); Sequence aSupported = getSupportedServiceNames(); const rtl::OUString* pSupported = aSupported.getConstArray(); for (sal_Int32 i=0; i OControlModel::getAggregateServiceNames() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getAggregateServiceNames" ); Sequence< ::rtl::OUString > aAggServices; Reference< XServiceInfo > xInfo; if ( query_aggregation( m_xAggregate, xInfo ) ) @@ -789,7 +772,6 @@ Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames() //------------------------------------------------------------------------------ Sequence SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames" ); return ::comphelper::concatSequences( getAggregateServiceNames(), getSupportedServiceNames_Static() @@ -799,7 +781,6 @@ Sequence SAL_CALL OControlModel::getSupportedServiceNames() throw //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException ) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" ); Sequence< ::rtl::OUString > aServiceNames( 2 ); aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT; aServiceNames[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.FormControlModel" ); @@ -810,7 +791,6 @@ Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Sta //------------------------------------------------------------------------------ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); // release the parent if (_rSource.Source == m_xParent) { @@ -832,7 +812,6 @@ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& //----------------------------------------------------------------------------- void OControlModel::disposing() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); OPropertySetAggregationHelper::disposing(); Reference xComp; @@ -847,7 +826,6 @@ void OControlModel::disposing() //------------------------------------------------------------------------------ void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutStream ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeAggregate" ); Reference< XPersistObject > xPersist; if ( query_aggregation( m_xAggregate, xPersist ) ) xPersist->write( _rxOutStream ); @@ -856,7 +834,6 @@ void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxO //------------------------------------------------------------------------------ void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInStream ) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readAggregate" ); Reference< XPersistObject > xPersist; if ( query_aggregation( m_xAggregate, xPersist ) ) xPersist->read( _rxInStream ); @@ -866,7 +843,6 @@ void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInS void SAL_CALL OControlModel::write(const Reference& _rxOutStream) throw(stario::IOException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::write" ); osl::MutexGuard aGuard(m_aMutex); // 1. Schreiben des UnoControls @@ -912,7 +888,6 @@ void SAL_CALL OControlModel::write(const Reference& //------------------------------------------------------------------------------ void OControlModel::read(const Reference& InStream) throw (::com::sun::star::io::IOException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::read" ); osl::MutexGuard aGuard(m_aMutex); Reference xMark(InStream, UNO_QUERY); @@ -966,7 +941,6 @@ void OControlModel::read(const Reference& InStream) //------------------------------------------------------------------------------ PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle ) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyStateByHandle" ); // simply compare the current and the default value Any aCurrentValue = getPropertyDefaultByHandle( _nHandle ); Any aDefaultValue; getFastPropertyValue( aDefaultValue, _nHandle ); @@ -983,7 +957,6 @@ PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle ) //------------------------------------------------------------------------------ void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyToDefaultByHandle" ); Any aDefault = getPropertyDefaultByHandle( _nHandle ); Any aConvertedValue, aOldValue; @@ -997,7 +970,6 @@ void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle) //------------------------------------------------------------------------------ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyDefaultByHandle" ); Any aReturn; switch ( _nHandle ) { @@ -1030,7 +1002,6 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const //------------------------------------------------------------------------------ void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getFastPropertyValue" ); switch ( _nHandle ) { case PROPERTY_ID_NAME: @@ -1062,7 +1033,6 @@ sal_Bool OControlModel::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue) throw (com::sun::star::lang::IllegalArgumentException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" ); sal_Bool bModified(sal_False); switch (_nHandle) { @@ -1092,7 +1062,6 @@ sal_Bool OControlModel::convertFastPropertyValue( void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue) throw (Exception) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" ); switch (_nHandle) { case PROPERTY_ID_NAME: @@ -1125,7 +1094,6 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A //------------------------------------------------------------------------------ void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedProperties" ); BEGIN_DESCRIBE_BASE_PROPERTIES( 4 ) DECL_PROP2 (CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1 (NAME, ::rtl::OUString, BOUND); @@ -1137,7 +1105,6 @@ void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) con //------------------------------------------------------------------------------ void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ _rAggregateProps ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeAggregateProperties" ); if ( m_xAggregateSet.is() ) { Reference< XPropertySetInfo > xPSI( m_xAggregateSet->getPropertySetInfo() ); @@ -1149,14 +1116,12 @@ void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] //------------------------------------------------------------------------------ ::osl::Mutex& OControlModel::getMutex() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getMutex" ); return m_aMutex; } //------------------------------------------------------------------------------ void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _out_rFixedProperties, Sequence< Property >& _out_rAggregateProperties ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedAndAggregateProperties" ); describeFixedProperties( _out_rFixedProperties ); describeAggregateProperties( _out_rAggregateProperties ); } @@ -1164,49 +1129,42 @@ void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _ //------------------------------------------------------------------------------ Reference< XMultiPropertySet > OControlModel::getPropertiesInterface() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertiesInterface" ); return Reference< XMultiPropertySet >( *this, UNO_QUERY ); } //------------------------------------------------------------------------------ Reference< XPropertySetInfo> SAL_CALL OControlModel::getPropertySetInfo() throw( RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertySetInfo" ); return createPropertySetInfo( getInfoHelper() ); } //------------------------------------------------------------------------------ ::cppu::IPropertyArrayHelper& OControlModel::getInfoHelper() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getInfoHelper" ); return m_aPropertyBagHelper.getInfoHelper(); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::addProperty" ); m_aPropertyBagHelper.addProperty( _rName, _nAttributes, _rInitialValue ); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::removeProperty" ); m_aPropertyBagHelper.removeProperty( _rName ); } //-------------------------------------------------------------------- Sequence< PropertyValue > SAL_CALL OControlModel::getPropertyValues() throw (RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyValues" ); return m_aPropertyBagHelper.getPropertyValues(); } //-------------------------------------------------------------------- void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& _rProps ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyValues" ); m_aPropertyBagHelper.setPropertyValues( _rProps ); } @@ -1249,7 +1207,6 @@ Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (R Any aReturn( OControlModel::queryAggregation(_rType) ); if (!aReturn.hasValue()) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" ); aReturn = OBoundControlModel_BASE1::queryInterface(_rType); if ( !aReturn.hasValue() && m_bCommitable ) @@ -1426,11 +1383,20 @@ void OBoundControlModel::implInitValuePropertyListening( ) const } } +//----------------------------------------------------------------------------- +void OBoundControlModel::initOwnValueProperty( const ::rtl::OUString& i_rValuePropertyName ) +{ + OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle, + "OBoundControlModel::initOwnValueProperty: value property is already initialized!" ); + OSL_ENSURE( i_rValuePropertyName.getLength(), "OBoundControlModel::initOwnValueProperty: invalid property name!" ); + m_sValuePropertyName = i_rValuePropertyName; +} + //----------------------------------------------------------------------------- void OBoundControlModel::initValueProperty( const ::rtl::OUString& _rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle ) { OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle, - "OBoundControlModel::initValueProperty: already called before!" ); + "OBoundControlModel::initValueProperty: value property is already initialized!" ); OSL_ENSURE( _rValuePropertyName.getLength(), "OBoundControlModel::initValueProperty: invalid property name!" ); OSL_ENSURE( _nValuePropertyExternalHandle != -1, "OBoundControlModel::initValueProperty: invalid property handle!" ); @@ -1495,7 +1461,6 @@ Sequence< Type > OBoundControlModel::_getTypes() //----------------------------------------------------------------------------- void OBoundControlModel::disposing() { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" ); OControlModel::disposing(); ::osl::ClearableMutexGuard aGuard(m_aMutex); @@ -1532,6 +1497,29 @@ void OBoundControlModel::disposing() disconnectValidator( ); } +//------------------------------------------------------------------------------ +void OBoundControlModel::onValuePropertyChange( ControlModelLock& i_rControLock ) +{ + if ( hasExternalValueBinding() ) + { // the control value changed, while we have an external value binding + // -> forward the value to it + if ( m_eControlValueChangeInstigator != eExternalBinding ) + transferControlValueToExternal( i_rControLock ); + } + else if ( !m_bCommitable && m_xColumnUpdate.is() ) + { // the control value changed, while we are bound to a database column, + // but not committable (which means changes in the control have to be reflected to + // the underlying database column immediately) + // -> forward the value to the database column + if ( m_eControlValueChangeInstigator != eDbColumnBinding ) + commitControlValueToDbColumn( false ); + } + + // validate the new value + if ( m_bSupportsValidation ) + recheckValidity( true ); +} + //------------------------------------------------------------------------------ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) throw ( RuntimeException ) { @@ -1543,26 +1531,8 @@ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) th "OBoundControlModel::_propertyChanged: where did this come from (2)?" ); if ( _rEvt.PropertyName == m_sValuePropertyName ) - { // our control value changed - - if ( hasExternalValueBinding() ) - { // the control value changed, while we have an external value binding - // -> forward the value to it - if ( m_eControlValueChangeInstigator != eExternalBinding ) - transferControlValueToExternal( aLock ); - } - else if ( !m_bCommitable && m_xColumnUpdate.is() ) - { // the control value changed, while we are bound to a database column, - // but not committable (which means changes in the control have to be reflected to - // the underlying database column immediately) - // -> forward the value to the database column - if ( m_eControlValueChangeInstigator != eDbColumnBinding ) - commitControlValueToDbColumn( false ); - } - - // validate the new value - if ( m_bSupportsValidation ) - recheckValidity( true ); + { + onValuePropertyChange( aLock ); } } @@ -1673,7 +1643,6 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj //------------------------------------------------------------------------------ StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" ); return ::comphelper::concatSequences( getAggregateServiceNames(), getSupportedServiceNames_Static() @@ -1696,7 +1665,6 @@ Sequence< ::rtl::OUString > SAL_CALL OBoundControlModel::getSupportedServiceName //------------------------------------------------------------------------------ void SAL_CALL OBoundControlModel::write( const Reference& _rxOutStream ) throw(stario::IOException, RuntimeException) { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" ); OControlModel::write(_rxOutStream); osl::MutexGuard aGuard(m_aMutex); @@ -1797,7 +1765,6 @@ void SAL_CALL OBoundControlModel::read( const Reference< stario::XObjectInputStr //------------------------------------------------------------------------------ void OBoundControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OBoundControlModel::getFastPropertyValue" ); switch (nHandle) { case PROPERTY_ID_INPUT_REQUIRED: @@ -1866,7 +1833,6 @@ sal_Bool OBoundControlModel::convertFastPropertyValue( //------------------------------------------------------------------------------ Any OBoundControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const { - // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" ); Any aDefault; switch ( _nHandle ) { diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index b433dec92d70..6d9fad98c6ca 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -152,10 +152,12 @@ OImageControlModel::OImageControlModel(const Reference& _r // use the old control name for compytibility reasons ,m_pImageProducer( NULL ) ,m_bReadOnly( sal_False ) + ,m_sImageURL() + ,m_xGraphic() { DBG_CTOR( OImageControlModel, NULL ); m_nClassId = FormComponentType::IMAGECONTROL; - initValueProperty( PROPERTY_IMAGE_URL, PROPERTY_ID_IMAGE_URL); + initOwnValueProperty( PROPERTY_IMAGE_URL ); implConstruct(); } @@ -165,22 +167,19 @@ OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, co :OBoundControlModel( _pOriginal, _rxFactory ) // use the old control name for compytibility reasons ,m_pImageProducer( NULL ) + ,m_bReadOnly( _pOriginal->m_bReadOnly ) + ,m_sImageURL( _pOriginal->m_sImageURL ) + ,m_xGraphic( _pOriginal->m_xGraphic ) { DBG_CTOR( OImageControlModel, NULL ); implConstruct(); - m_bReadOnly = _pOriginal->m_bReadOnly; osl_incrementInterlockedCount( &m_refCount ); { // simulate a propertyChanged event for the ImageURL // 2003-05-15 - #109591# - fs@openoffice.org - Any aImageURL; - getFastPropertyValue( aImageURL, PROPERTY_ID_IMAGE_URL ); - ::rtl::OUString sImageURL; - aImageURL >>= sImageURL; - ::osl::MutexGuard aGuard( m_aMutex ); - impl_handleNewImageURL_lck( sImageURL, eOther ); + impl_handleNewImageURL_lck( eOther ); } osl_decrementInterlockedCount( &m_refCount ); } @@ -244,32 +243,20 @@ sal_Bool OImageControlModel::approveDbColumnType( sal_Int32 _nColumnType ) return ImageStoreInvalid != lcl_getImageStoreType( _nColumnType ); } - -//------------------------------------------------------------------------------ -void OImageControlModel::_propertyChanged( const PropertyChangeEvent& _rEvent ) - throw( RuntimeException ) -{ - if ( m_xColumnUpdate.is() ) - { - OBoundControlModel::_propertyChanged( _rEvent ); - } - else - { // we're not bound. In this case, we have to manually care for updating the - // image producer, since the base class will not do this - ::rtl::OUString sImageURL; - _rEvent.NewValue >>= sImageURL; - - ::osl::MutexGuard aGuard( m_aMutex ); - impl_handleNewImageURL_lck( sImageURL, eOther ); - } -} - //------------------------------------------------------------------------------ void OImageControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const { switch (nHandle) { - case PROPERTY_ID_READONLY : rValue <<= (sal_Bool)m_bReadOnly; break; + case PROPERTY_ID_READONLY: + rValue <<= (sal_Bool)m_bReadOnly; + break; + case PROPERTY_ID_IMAGE_URL: + rValue <<= m_sImageURL; + break; + case PROPERTY_ID_GRAPHIC: + rValue <<= m_xGraphic; + break; default: OBoundControlModel::getFastPropertyValue(rValue, nHandle); } @@ -285,8 +272,24 @@ void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, con m_bReadOnly = getBOOL(rValue); break; + case PROPERTY_ID_IMAGE_URL: + OSL_VERIFY( rValue >>= m_sImageURL ); + impl_handleNewImageURL_lck( eOther ); + { + ControlModelLock aLock( *this ); + // that's a fake ... onValuePropertyChange expects to receive the only lock to our instance, + // but we're already called with our mutex locked ... + onValuePropertyChange( aLock ); + } + break; + + case PROPERTY_ID_GRAPHIC: + OSL_VERIFY( rValue >>= m_xGraphic ); + break; + default: OBoundControlModel::setFastPropertyValue_NoBroadcast(nHandle, rValue); + break; } } @@ -299,6 +302,12 @@ sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any& case PROPERTY_ID_READONLY : return tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bReadOnly); + case PROPERTY_ID_IMAGE_URL: + return tryPropertyValue( rConvertedValue, rOldValue, rValue, m_sImageURL ); + + case PROPERTY_ID_GRAPHIC: + return tryPropertyValue( rConvertedValue, rOldValue, rValue, m_xGraphic ); + default: return OBoundControlModel::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue); } @@ -307,12 +316,24 @@ sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any& //------------------------------------------------------------------------------ void OImageControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const { - BEGIN_DESCRIBE_PROPERTIES( 2, OBoundControlModel ) - DECL_BOOL_PROP1 ( READONLY, BOUND ); - DECL_PROP1 ( TABINDEX, sal_Int16, BOUND ); + BEGIN_DESCRIBE_PROPERTIES( 4, OBoundControlModel ) + DECL_IFACE_PROP2( GRAPHIC, XGraphic, BOUND, TRANSIENT ); + DECL_PROP1 ( IMAGE_URL, ::rtl::OUString, BOUND ); + DECL_BOOL_PROP1 ( READONLY, BOUND ); + DECL_PROP1 ( TABINDEX, sal_Int16, BOUND ); END_DESCRIBE_PROPERTIES(); } +//------------------------------------------------------------------------------ +void OImageControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ o_rAggregateProperties ) const +{ + OBoundControlModel::describeAggregateProperties( o_rAggregateProperties ); + // remove ImageULR and Graphic properties, we "overload" them. This is because our aggregate synchronizes those + // two, but we have an own sychronization mechanism. + RemoveProperty( o_rAggregateProperties, PROPERTY_IMAGE_URL ); + RemoveProperty( o_rAggregateProperties, PROPERTY_GRAPHIC ); +} + //------------------------------------------------------------------------------ ::rtl::OUString OImageControlModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException) { @@ -411,18 +432,18 @@ sal_Bool OImageControlModel::impl_updateStreamForURL_lck( const ::rtl::OUString& } //------------------------------------------------------------------------------ -sal_Bool OImageControlModel::impl_handleNewImageURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator ) +sal_Bool OImageControlModel::impl_handleNewImageURL_lck( ValueChangeInstigator _eInstigator ) { switch ( lcl_getImageStoreType( getFieldType() ) ) { case ImageStoreBinary: - if ( impl_updateStreamForURL_lck( _rURL, _eInstigator ) ) + if ( impl_updateStreamForURL_lck( m_sImageURL, _eInstigator ) ) return sal_True; break; case ImageStoreLink: { - ::rtl::OUString sCommitURL( _rURL ); + ::rtl::OUString sCommitURL( m_sImageURL ); if ( m_sDocumentURL.getLength() ) sCommitURL = URIHelper::simpleNormalizedMakeRelative( m_sDocumentURL, sCommitURL ); OSL_ENSURE( m_xColumnUpdate.is(), "OImageControlModel::impl_handleNewImageURL_lck: no bound field, but ImageStoreLink?!" ); @@ -435,7 +456,7 @@ sal_Bool OImageControlModel::impl_handleNewImageURL_lck( const ::rtl::OUString& break; case ImageStoreInvalid: - OSL_ENSURE( false, "OImageControlModel::impl_handleNewImageURL_lck: invalid current field type!" ); + OSL_ENSURE( false, "OImageControlModel::impl_handleNewImageURL_lck: image storage type type!" ); break; } @@ -462,10 +483,7 @@ sal_Bool OImageControlModel::commitControlValueToDbColumn( bool _bPostReset ) else { ::osl::MutexGuard aGuard(m_aMutex); - - ::rtl::OUString sImageURL; - m_xAggregateSet->getPropertyValue( PROPERTY_IMAGE_URL ) >>= sImageURL; - return impl_handleNewImageURL_lck( sImageURL, eDbColumnBinding ); + return impl_handleNewImageURL_lck( eDbColumnBinding ); } return sal_True; @@ -544,6 +562,12 @@ Any OImageControlModel::translateDbColumnToControlValue() return Any(); } +//------------------------------------------------------------------------------ +Any OImageControlModel::getControlValue( ) const +{ + return makeAny( m_sImageURL ); +} + //------------------------------------------------------------------------------ void OImageControlModel::doSetControlValue( const Any& _rValue ) { @@ -599,11 +623,6 @@ void OImageControlModel::doSetControlValue( const Any& _rValue ) void SAL_CALL OImageControlModel::disposing() { OBoundControlModel::disposing(); - - { - ::osl::MutexGuard aGuard( m_aMutex ); // setControlValue expects this - setControlValue( Any(), eOther ); - } } //------------------------------------------------------------------------------ diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index c31216fc8aca..75bc48dd9c8e 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,9 @@ class OImageControlModel ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer; ImageProducer* m_pImageProducer; sal_Bool m_bReadOnly; + ::rtl::OUString m_sImageURL; + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > + m_xGraphic; ::rtl::OUString m_sDocumentURL; protected: @@ -86,9 +90,6 @@ public: // OComponentHelper virtual void SAL_CALL disposing(); - // OPropertyChangeListener - virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException); - // XPersistObject virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); @@ -103,6 +104,9 @@ public: virtual void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException); // OControlModel's property handling + virtual void describeAggregateProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps + ) const; virtual void describeFixedProperties( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps ) const; @@ -119,6 +123,8 @@ protected: translateDbColumnToControlValue( ); virtual sal_Bool commitControlValueToDbColumn( bool _bPostReset ); + virtual ::com::sun::star::uno::Any + getControlValue( ) const; virtual void doSetControlValue( const ::com::sun::star::uno::Any& _rValue ); virtual sal_Bool approveDbColumnType(sal_Int32 _nColumnType); @@ -134,7 +140,7 @@ protected: @precond our own mutex is locked */ - sal_Bool impl_handleNewImageURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator ); + sal_Bool impl_handleNewImageURL_lck( ValueChangeInstigator _eInstigator ); /** updates the binary stream, created from loading the file which the given URL points to, into our bound field, or the control itself if there is no bound field diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx index de72e2b392e8..0c8b421008a3 100644 --- a/forms/source/inc/FormComponent.hxx +++ b/forms/source/inc/FormComponent.hxx @@ -759,6 +759,18 @@ protected: sal_Int32 _nValuePropertyExternalHandle ); + /** initializes the part of the class which is related to the control value. + +

In opposite to ->initValueProperty, this method is to be used for value properties which are not + implemented by our aggregate, but by ourselves.

+ +

Certain functionality is not available when using own value properties. This includes binding to an external + value and external validation. (This is not a conceptual limit, but simply missing implementation.)

+ */ + void initOwnValueProperty( + const ::rtl::OUString& i_rValuePropertyName + ); + /** suspends listening at the value property

As long as this listening is suspended, changes in the value property will not be @@ -782,6 +794,16 @@ protected: */ void resumeValueListening( ); + /** (to be) called when the value property changed + + Normally, this is done automatically, since the value property is a property of our aggregate, and we're + a listener at this property. + However, in some cases the value property might not be an aggregate property, but a property of the + delegator instance. In this case, you'll need to call onValuePropertyChange whenever this + property changes. + */ + void onValuePropertyChange( ControlModelLock& i_rControLock ); + /** starts listening at the aggregate, for changes in the given property

The OBoundControlModel automatically registers a multiplexer which listens for diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx index 8a8105d2e1a7..1e3b1b1bd312 100644 --- a/forms/source/inc/frm_strings.hxx +++ b/forms/source/inc/frm_strings.hxx @@ -141,6 +141,7 @@ namespace frm FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_METHOD, "SubmitMethod" ); FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_ENCODING, "SubmitEncoding" ); FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_URL, "ImageURL" ); + FORMS_CONSTASCII_STRING( PROPERTY_GRAPHIC, "Graphic" ); FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition" ); FORMS_CONSTASCII_STRING( PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull" ); FORMS_CONSTASCII_STRING( PROPERTY_LISTSOURCETYPE, "ListSourceType" ); diff --git a/forms/source/inc/property.hrc b/forms/source/inc/property.hrc index c1064e6d56b9..0582ce36c6ee 100644 --- a/forms/source/inc/property.hrc +++ b/forms/source/inc/property.hrc @@ -61,7 +61,7 @@ namespace frm #define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20) #define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21) #define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 22) - // free +#define PROPERTY_ID_GRAPHIC (PROPERTY_ID_START + 23) // free // free // free diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx index 04bc9c8c8911..fffb7557ad5e 100644 --- a/forms/source/misc/property.cxx +++ b/forms/source/misc/property.cxx @@ -134,6 +134,7 @@ void PropertyInfoService::initialize() ADD_PROP_ASSIGNMENT(SUBMIT_METHOD); ADD_PROP_ASSIGNMENT(SUBMIT_ENCODING); ADD_PROP_ASSIGNMENT(IMAGE_URL); + ADD_PROP_ASSIGNMENT(GRAPHIC); ADD_PROP_ASSIGNMENT(EMPTY_IS_NULL); ADD_PROP_ASSIGNMENT(LISTSOURCETYPE); ADD_PROP_ASSIGNMENT(LISTSOURCE); -- cgit v1.2.3 From 33ddb6e91decfac211b833931be57180e18cc11b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 26 Aug 2010 17:14:25 +0200 Subject: dba33h: #i114122# don't set GraphicObject-URLs at the image control/model, instead, just set the XGraphic, and let the implementation manage the respective XGraphicObject instance and its life time --- forms/source/component/ImageControl.cxx | 65 +++++++++++++++++++++++++-------- forms/source/component/ImageControl.hxx | 7 ++-- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 6d9fad98c6ca..3a7e05404d75 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -151,9 +151,10 @@ OImageControlModel::OImageControlModel(const Reference& _r :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL, sal_False, sal_False, sal_False ) // use the old control name for compytibility reasons ,m_pImageProducer( NULL ) + ,m_bExternalGraphic( true ) ,m_bReadOnly( sal_False ) ,m_sImageURL() - ,m_xGraphic() + ,m_xGraphicObject() { DBG_CTOR( OImageControlModel, NULL ); m_nClassId = FormComponentType::IMAGECONTROL; @@ -167,9 +168,10 @@ OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, co :OBoundControlModel( _pOriginal, _rxFactory ) // use the old control name for compytibility reasons ,m_pImageProducer( NULL ) + ,m_bExternalGraphic( true ) ,m_bReadOnly( _pOriginal->m_bReadOnly ) ,m_sImageURL( _pOriginal->m_sImageURL ) - ,m_xGraphic( _pOriginal->m_xGraphic ) + ,m_xGraphicObject( _pOriginal->m_xGraphicObject ) { DBG_CTOR( OImageControlModel, NULL ); implConstruct(); @@ -255,7 +257,7 @@ void OImageControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) co rValue <<= m_sImageURL; break; case PROPERTY_ID_GRAPHIC: - rValue <<= m_xGraphic; + rValue <<= m_xGraphicObject.is() ? m_xGraphicObject->getGraphic() : Reference< XGraphic >(); break; default: OBoundControlModel::getFastPropertyValue(rValue, nHandle); @@ -284,8 +286,35 @@ void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, con break; case PROPERTY_ID_GRAPHIC: - OSL_VERIFY( rValue >>= m_xGraphic ); - break; + { + Reference< XGraphic > xGraphic; + OSL_VERIFY( rValue >>= xGraphic ); + if ( !xGraphic.is() ) + m_xGraphicObject.clear(); + else + { + m_xGraphicObject = GraphicObject::create( m_aContext.getUNOContext() ); + m_xGraphicObject->setGraphic( xGraphic ); + } + + if ( m_bExternalGraphic ) + { + // if that's an external graphic, i.e. one which has not been loaded by ourselves in response to a + // new image URL, then also adjust our ImageURL. + ::rtl::OUString sNewImageURL; + if ( m_xGraphicObject.is() ) + { + sNewImageURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ); + sNewImageURL = sNewImageURL + m_xGraphicObject->getUniqueID(); + } + m_sImageURL = sNewImageURL; + // TODO: speaking strictly, this would need to be notified, since ImageURL is a bound property. However, + // this method here is called with a locked mutex, so we cannot simply call listeners ... + // I think the missing notification (and thus clients which potentially cannot observe the change) + // is less severe than the potential deadlock ... + } + } + break; default: OBoundControlModel::setFastPropertyValue_NoBroadcast(nHandle, rValue); @@ -306,7 +335,10 @@ sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any& return tryPropertyValue( rConvertedValue, rOldValue, rValue, m_sImageURL ); case PROPERTY_ID_GRAPHIC: - return tryPropertyValue( rConvertedValue, rOldValue, rValue, m_xGraphic ); + { + const Reference< XGraphic > xGraphic( getFastPropertyValue( PROPERTY_ID_GRAPHIC ), UNO_QUERY ); + return tryPropertyValue( rConvertedValue, rOldValue, rValue, xGraphic ); + } default: return OBoundControlModel::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue); @@ -660,10 +692,16 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException) IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic ) { const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : NULL ); - setPropertyValue( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ), - makeAny( xGraphic ) - ); + m_bExternalGraphic = false; + try + { + setPropertyValue( PROPERTY_GRAPHIC, makeAny( xGraphic ) ); + } + catch ( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + m_bExternalGraphic = true; return 1L; } @@ -828,12 +866,7 @@ bool OImageControlControl::implInsertGraphics() { Graphic aGraphic; aDialog.GetGraphic( aGraphic ); - - Reference< graphic::XGraphicObject > xGrfObj = graphic::GraphicObject::create( m_aContext.getUNOContext() ); - xGrfObj->setGraphic( aGraphic.GetXGraphic() ); - rtl::OUString sObjectID( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ); - sObjectID = sObjectID + xGrfObj->getUniqueID(); - xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( sObjectID ) ) ); + xSet->setPropertyValue( PROPERTY_GRAPHIC, makeAny( aGraphic.GetXGraphic() ) ); } else xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( aDialog.GetPath() ) ) ); diff --git a/forms/source/component/ImageControl.hxx b/forms/source/component/ImageControl.hxx index 75bc48dd9c8e..853c4aadffbf 100644 --- a/forms/source/component/ImageControl.hxx +++ b/forms/source/component/ImageControl.hxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -58,10 +58,11 @@ class OImageControlModel { ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer; ImageProducer* m_pImageProducer; + bool m_bExternalGraphic; sal_Bool m_bReadOnly; ::rtl::OUString m_sImageURL; - ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > - m_xGraphic; + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > + m_xGraphicObject; ::rtl::OUString m_sDocumentURL; protected: -- cgit v1.2.3 From 0cd40f9bffa9fa97bd44a7a2e43e40f11af1b2db Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 26 Aug 2010 21:50:11 +0200 Subject: impress200: #i114089# clear user any after they are applied to the shape --- editeng/inc/editeng/unoipset.hxx | 1 + editeng/source/uno/unoipset.cxx | 21 ++++++++++++--------- svx/source/unodraw/unoshape.cxx | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx index 3cd3053e4c3e..8a28df5cbe28 100644 --- a/editeng/inc/editeng/unoipset.hxx +++ b/editeng/inc/editeng/unoipset.hxx @@ -64,6 +64,7 @@ public: sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); } ::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const; void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID); + void ClearAllUsrAny(); com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const; const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;} diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 39ab3507c5d3..6ba232010390 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -71,15 +71,7 @@ SvxItemPropertySet::SvxItemPropertySet( const SfxItemPropertyMapEntry* pMap, Sfx //---------------------------------------------------------------------- SvxItemPropertySet::~SvxItemPropertySet() { -/* - if(pItemPool) - delete pItemPool; - pItemPool = NULL; -*/ - - if(pCombiList) - delete pCombiList; - pCombiList = NULL; + ClearAllUsrAny(); } //---------------------------------------------------------------------- @@ -111,6 +103,17 @@ void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID) pCombiList->Insert(pNew); } +//---------------------------------------------------------------------- + +void SvxItemPropertySet::ClearAllUsrAny() +{ + if(pCombiList) + delete pCombiList; + pCombiList = NULL; +} + +//---------------------------------------------------------------------- + sal_Bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) { sal_Bool bConvert = sal_True; // the default is that all metric items must be converted diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index d860f4973fd2..9c5affc38f9b 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -708,6 +708,7 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& // next entry ++aSrcIt; } + const_cast< SvxItemPropertySet& >(rPropSet).ClearAllUsrAny(); } } -- cgit v1.2.3 From 0f9a82f53bfb0f06bd592a462f16abdfe3200b51 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:21:15 +0200 Subject: dba33h: #i112652#: math.cxx: indent stuff a bit and clean up whitespace --- sal/rtl/source/math.cxx | 257 ++++++++++++++++++++++++------------------------ 1 file changed, 131 insertions(+), 126 deletions(-) diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index 7d0e3cea0c0d..83f34aa6acd1 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -737,157 +737,162 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, } CharT const * p = p0; - // leading zeros and group separators may be safely ignored - while (p != pEnd && (*p == CharT('0') || *p == cGroupSeparator)) - ++p; - - long nValExp = 0; // carry along exponent of mantissa - - // integer part of mantissa - for (; p != pEnd; ++p) - { - CharT c = *p; - if (isDigit(c)) - { - fVal = fVal * 10.0 + static_cast< double >( c - CharT('0') ); - ++nValExp; - } - else if (c != cGroupSeparator) - break; - } - - // fraction part of mantissa - if (p != pEnd && *p == cDecSeparator) { - ++p; - double fFrac = 0.0; - long nFracExp = 0; - while (p != pEnd && *p == CharT('0')) - { - --nFracExp; + // leading zeros and group separators may be safely ignored + while (p != pEnd && (*p == CharT('0') || *p == cGroupSeparator)) ++p; - } - if ( nValExp == 0 ) - nValExp = nFracExp - 1; // no integer part => fraction exponent - // one decimal digit needs ld(10) ~= 3.32 bits - static const int nSigs = (DBL_MANT_DIG / 3) + 1; - int nDigs = 0; + + long nValExp = 0; // carry along exponent of mantissa + + // integer part of mantissa for (; p != pEnd; ++p) { CharT c = *p; - if (!isDigit(c)) - break; - if ( nDigs < nSigs ) - { // further digits (more than nSigs) don't have any significance - fFrac = fFrac * 10.0 + static_cast< double >( c - CharT('0') ); - --nFracExp; - ++nDigs; + if (isDigit(c)) + { + fVal = fVal * 10.0 + static_cast< double >( c - CharT('0') ); + ++nValExp; } + else if (c != cGroupSeparator) + break; } - if ( fFrac != 0.0 ) - fVal += rtl::math::pow10Exp( fFrac, nFracExp ); - else if ( nValExp < 0 ) - nValExp = 0; // no digit other than 0 after decimal point - } - if ( nValExp > 0 ) - --nValExp; // started with offset +1 at the first mantissa digit - - // Exponent - if (p != p0 && p != pEnd && (*p == CharT('E') || *p == CharT('e'))) - { - ++p; - bool bExpSign; - if (p != pEnd && *p == CharT('-')) + // fraction part of mantissa + if (p != pEnd && *p == cDecSeparator) { - bExpSign = true; ++p; - } - else - { - bExpSign = false; - if (p != pEnd && *p == CharT('+')) - ++p; - } - if ( fVal == 0.0 ) - { // no matter what follows, zero stays zero, but carry on the offset - while (p != pEnd && isDigit(*p)) + double fFrac = 0.0; + long nFracExp = 0; + while (p != pEnd && *p == CharT('0')) + { + --nFracExp; ++p; - } - else - { - bool bOverFlow = false; - long nExp = 0; + } + if ( nValExp == 0 ) + nValExp = nFracExp - 1; // no integer part => fraction exponent + // one decimal digit needs ld(10) ~= 3.32 bits + static const int nSigs = (DBL_MANT_DIG / 3) + 1; + int nDigs = 0; for (; p != pEnd; ++p) { CharT c = *p; if (!isDigit(c)) break; - int i = c - CharT('0'); - if ( long10Overflow( nExp, i ) ) - bOverFlow = true; - else - nExp = nExp * 10 + i; - } - if ( nExp ) - { - if ( bExpSign ) - nExp = -nExp; - long nAllExp = ( bOverFlow ? 0 : nExp + nValExp ); - if ( nAllExp > DBL_MAX_10_EXP || (bOverFlow && !bExpSign) ) - { // overflow - fVal = HUGE_VAL; - eStatus = rtl_math_ConversionStatus_OutOfRange; + if ( nDigs < nSigs ) + { // further digits (more than nSigs) don't have any + // significance + fFrac = fFrac * 10.0 + static_cast(c - CharT('0')); + --nFracExp; + ++nDigs; } - else if ( nAllExp < DBL_MIN_10_EXP || (bOverFlow && bExpSign) ) - { // underflow - fVal = 0.0; - eStatus = rtl_math_ConversionStatus_OutOfRange; - } - else if ( nExp > DBL_MAX_10_EXP || nExp < DBL_MIN_10_EXP ) - { // compensate exponents - fVal = rtl::math::pow10Exp( fVal, -nValExp ); - fVal = rtl::math::pow10Exp( fVal, nAllExp ); - } - else - fVal = rtl::math::pow10Exp( fVal, nExp ); // normal } + if ( fFrac != 0.0 ) + fVal += rtl::math::pow10Exp( fFrac, nFracExp ); + else if ( nValExp < 0 ) + nValExp = 0; // no digit other than 0 after decimal point } - } - else if (p - p0 == 2 && p != pEnd && p[0] == CharT('#') - && p[-1] == cDecSeparator && p[-2] == CharT('1')) - { - if (pEnd - p >= 4 && p[1] == CharT('I') && p[2] == CharT('N') - && p[3] == CharT('F')) + + if ( nValExp > 0 ) + --nValExp; // started with offset +1 at the first mantissa digit + + // Exponent + if (p != p0 && p != pEnd && (*p == CharT('E') || *p == CharT('e'))) { - // "1.#INF", "+1.#INF", "-1.#INF" - p += 4; - fVal = HUGE_VAL; - eStatus = rtl_math_ConversionStatus_OutOfRange; - // Eat any further digits: - while (p != pEnd && isDigit(*p)) + ++p; + bool bExpSign; + if (p != pEnd && *p == CharT('-')) + { + bExpSign = true; ++p; + } + else + { + bExpSign = false; + if (p != pEnd && *p == CharT('+')) + ++p; + } + if ( fVal == 0.0 ) + { // no matter what follows, zero stays zero, but carry on the + // offset + while (p != pEnd && isDigit(*p)) + ++p; + } + else + { + bool bOverFlow = false; + long nExp = 0; + for (; p != pEnd; ++p) + { + CharT c = *p; + if (!isDigit(c)) + break; + int i = c - CharT('0'); + if ( long10Overflow( nExp, i ) ) + bOverFlow = true; + else + nExp = nExp * 10 + i; + } + if ( nExp ) + { + if ( bExpSign ) + nExp = -nExp; + long nAllExp = ( bOverFlow ? 0 : nExp + nValExp ); + if ( nAllExp > DBL_MAX_10_EXP || (bOverFlow && !bExpSign) ) + { // overflow + fVal = HUGE_VAL; + eStatus = rtl_math_ConversionStatus_OutOfRange; + } + else if ((nAllExp < DBL_MIN_10_EXP) || + (bOverFlow && bExpSign) ) + { // underflow + fVal = 0.0; + eStatus = rtl_math_ConversionStatus_OutOfRange; + } + else if ( nExp > DBL_MAX_10_EXP || nExp < DBL_MIN_10_EXP ) + { // compensate exponents + fVal = rtl::math::pow10Exp( fVal, -nValExp ); + fVal = rtl::math::pow10Exp( fVal, nAllExp ); + } + else + fVal = rtl::math::pow10Exp( fVal, nExp ); // normal + } + } } - else if (pEnd - p >= 4 && p[1] == CharT('N') && p[2] == CharT('A') - && p[3] == CharT('N')) + else if (p - p0 == 2 && p != pEnd && p[0] == CharT('#') + && p[-1] == cDecSeparator && p[-2] == CharT('1')) { - // "1.#NAN", "+1.#NAN", "-1.#NAN" - p += 4; - rtl::math::setNan( &fVal ); - if (bSign) + if (pEnd - p >= 4 && p[1] == CharT('I') && p[2] == CharT('N') + && p[3] == CharT('F')) { - union { - double sd; - sal_math_Double md; - } m; - m.sd = fVal; - m.md.w32_parts.msw |= 0x80000000; // create negative NaN - fVal = m.sd; - bSign = false; // don't negate again + // "1.#INF", "+1.#INF", "-1.#INF" + p += 4; + fVal = HUGE_VAL; + eStatus = rtl_math_ConversionStatus_OutOfRange; + // Eat any further digits: + while (p != pEnd && isDigit(*p)) + ++p; + } + else if (pEnd - p >= 4 && p[1] == CharT('N') && p[2] == CharT('A') + && p[3] == CharT('N')) + { + // "1.#NAN", "+1.#NAN", "-1.#NAN" + p += 4; + rtl::math::setNan( &fVal ); + if (bSign) + { + union { + double sd; + sal_math_Double md; + } m; + m.sd = fVal; + m.md.w32_parts.msw |= 0x80000000; // create negative NaN + fVal = m.sd; + bSign = false; // don't negate again + } + // Eat any further digits: + while (p != pEnd && isDigit(*p)) + ++p; } - // Eat any further digits: - while (p != pEnd && isDigit(*p)) - ++p; } } -- cgit v1.2.3 From 92dafe9862d693ce9d79269627c3e6832422874e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:22:23 +0200 Subject: dba33h: #i112652#: rtl/math.h: string<->double conversion and XMLSchema-2: rtl_math_doubleTo{,U}String produce XMLSchema-2 values "NaN", "INF", "-INF". rtl_math_stringToDouble and rtl_math_uStringToDouble support XMLSchema-2 values in addition to deprecated previously supported values. --- sal/inc/rtl/math.h | 20 ++++++++++---------- sal/rtl/source/math.cxx | 45 ++++++++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h index 872d526b8835..985ce700b049 100644 --- a/sal/inc/rtl/math.h +++ b/sal/inc/rtl/math.h @@ -140,9 +140,8 @@ enum rtl_math_DecimalPlaces /** Conversions analogous to sprintf() using internal rounding. - +/-HUGE_VAL are converted to "1.#INF" and "-1.#INF", NAN values are - converted to "1.#NAN" and "-1.#NAN", of course using cDecSeparator instead - of '.'. + +/-HUGE_VAL are converted to "INF" and "-INF", NAN values are + converted to "NaN". @param pResult Returns the resulting byte string. Must itself not be null, and must point @@ -216,9 +215,8 @@ void SAL_CALL rtl_math_doubleToString(rtl_String ** pResult, /** Conversions analogous to sprintf() using internal rounding. - +/-HUGE_VAL are converted to "1.#INF" and "-1.#INF", NAN values are - converted to "1.#NAN" and "-1.#NAN", of course using cDecSeparator instead - of '.'. + +/-HUGE_VAL are converted to "INF" and "-INF", NAN values are + converted to "NaN". @param pResult Returns the resulting Unicode string. Must itself not be null, and must @@ -296,8 +294,9 @@ void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult, Leading tabs (0x09) and spaces (0x20) are eaten. Overflow returns +/-HUGE_VAL, underflow 0. In both cases pStatus is set to rtl_math_ConversionStatus_OutOfRange, otherwise to - rtl_math_ConversionStatus_Ok. "+/-1.#INF" is recognized as +/-HUGE_VAL, - pStatus is set to rtl_math_ConversionStatus_OutOfRange. "+/-1.#NAN" is + rtl_math_ConversionStatus_Ok. "INF", "-INF" and "+/-1.#INF" are + recognized as +/-HUGE_VAL, pStatus is set to + rtl_math_ConversionStatus_OutOfRange. "NaN" and "+/-1.#NAN" are recognized and the value is set to +/-NAN, pStatus is set to rtl_math_ConversionStatus_Ok. @@ -333,8 +332,9 @@ double SAL_CALL rtl_math_stringToDouble( Leading tabs (U+0009) and spaces (U+0020) are eaten. Overflow returns +/-HUGE_VAL, underflow 0. In both cases pStatus is set to rtl_math_ConversionStatus_OutOfRange, otherwise to - rtl_math_ConversionStatus_Ok. "+/-1.#INF" is recognized as +/-HUGE_VAL, - pStatus is set to rtl_math_ConversionStatus_OutOfRange. "+/-1.#NAN" is + rtl_math_ConversionStatus_Ok. "INF", "-INF" and "+/-1.#INF" are + recognized as +/-HUGE_VAL, pStatus is set to + rtl_math_ConversionStatus_OutOfRange. "NaN" and "+/-1.#NAN" are recognized and the value is set to +/-NAN, pStatus is set to rtl_math_ConversionStatus_Ok. diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index 83f34aa6acd1..d983c5726230 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -318,44 +318,37 @@ inline void doubleToString(StringT ** pResult, if ( rtl::math::isNan( fValue ) ) { - sal_Int32 nCapacity = RTL_CONSTASCII_LENGTH("-1.#NAN"); + // #i112652# XMLSchema-2 + sal_Int32 nCapacity = RTL_CONSTASCII_LENGTH("NaN"); if (pResultCapacity == 0) { pResultCapacity = &nCapacity; T::createBuffer(pResult, pResultCapacity); nResultOffset = 0; } - - if ( bSign ) - T::appendAscii(pResult, pResultCapacity, &nResultOffset, - RTL_CONSTASCII_STRINGPARAM("-")); T::appendAscii(pResult, pResultCapacity, &nResultOffset, - RTL_CONSTASCII_STRINGPARAM("1")); - T::appendChar(pResult, pResultCapacity, &nResultOffset, cDecSeparator); - T::appendAscii(pResult, pResultCapacity, &nResultOffset, - RTL_CONSTASCII_STRINGPARAM("#NAN")); + RTL_CONSTASCII_STRINGPARAM("NaN")); + return; } bool bHuge = fValue == HUGE_VAL; // g++ 3.0.1 requires it this way... if ( bHuge || rtl::math::isInf( fValue ) ) { - sal_Int32 nCapacity = RTL_CONSTASCII_LENGTH("-1.#INF"); + // #i112652# XMLSchema-2 + sal_Int32 nCapacity = RTL_CONSTASCII_LENGTH("-INF"); if (pResultCapacity == 0) { pResultCapacity = &nCapacity; T::createBuffer(pResult, pResultCapacity); nResultOffset = 0; } - if ( bSign ) T::appendAscii(pResult, pResultCapacity, &nResultOffset, RTL_CONSTASCII_STRINGPARAM("-")); T::appendAscii(pResult, pResultCapacity, &nResultOffset, - RTL_CONSTASCII_STRINGPARAM("1")); - T::appendChar(pResult, pResultCapacity, &nResultOffset, cDecSeparator); - T::appendAscii(pResult, pResultCapacity, &nResultOffset, - RTL_CONSTASCII_STRINGPARAM("#INF")); + RTL_CONSTASCII_STRINGPARAM("INF")); + return; } @@ -736,7 +729,29 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, ++p0; } CharT const * p = p0; + bool bDone = false; + + // #i112652# XMLSchema-2 + if (3 >= (pEnd - p)) + { + if ((CharT('N') == p[0]) && (CharT('a') == p[1]) + && (CharT('N') == p[2])) + { + p += 3; + rtl::math::setNan( &fVal ); + bDone = true; + } + else if ((CharT('I') == p[0]) && (CharT('N') == p[1]) + && (CharT('F') == p[2])) + { + p += 3; + fVal = HUGE_VAL; + eStatus = rtl_math_ConversionStatus_OutOfRange; + bDone = true; + } + } + if (!bDone) // do not recognize e.g. NaN1.23 { // leading zeros and group separators may be safely ignored while (p != pEnd && (*p == CharT('0') || *p == cGroupSeparator)) -- cgit v1.2.3 From 2a44c3167e5f24b5e8fa620be479c506c8a607be Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:23:43 +0200 Subject: dba33h: #i112652#: reportbuilder: write XMLSchema-2 conformant NaN --- .../star/report/pentaho/layoutprocessor/TableCellLayoutController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java index 74fe1728fc5f..506ea6347d4a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -81,7 +81,8 @@ public class TableCellLayoutController extends SectionLayoutController } else if ( "float".equals(valueType)) { - attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE, "1.#NAN"); + attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, + FormatValueUtility.VALUE, "NaN"); } } catch (Exception e) -- cgit v1.2.3 From caefe9e5f6df6c51d000afc940d2e2eb983471d6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:25:34 +0200 Subject: dba33h: #i112652#: SwTblBoxValue: items with NaN should compare equal --- sw/source/core/attr/cellatr.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index 8032d3506a27..f492696ef8ac 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -28,9 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include +#include -#include #include // fuer RES_.. #include #include @@ -249,8 +250,12 @@ SwTblBoxValue::SwTblBoxValue( const double nVal ) int SwTblBoxValue::operator==( const SfxPoolItem& rAttr ) const { - ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return nValue == ((SwTblBoxValue&)rAttr).nValue; + ASSERT(SfxPoolItem::operator==(rAttr), "SwTblBoxValue: item not equal"); + SwTblBoxValue const& rOther( static_cast(rAttr) ); + // items with NaN should be equal to enable pooling + return ::rtl::math::isNan(nValue) + ? ::rtl::math::isNan(rOther.nValue) + : (nValue == rOther.nValue); } -- cgit v1.2.3 From 5835ba13b9ca4e5386b8a7f9b3c86262f54016fb Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 27 Aug 2010 12:26:50 +0200 Subject: dba33h: #i112652#: SwXCell::getValue(): do not filter out NaN --- sw/source/core/unocore/unotbl.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index b7098710802b..fdc382ad99d9 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1009,12 +1009,9 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException double SwXCell::getValue(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - double fRet = lcl_getValue( *this ); - //lcl_getValue was changed thus it can return nan values, - //so I make this additional nan check here to not change the behaviour - //but maybe it would even be more correct to just return nan here? ... todo? - if( ::rtl::math::isNan( fRet ) ) - fRet = 0.0; + + double const fRet = lcl_getValue( *this ); + // #i112652# a table cell may contain NaN as a value, do not filter that return fRet; } /*-- 11.12.98 10:56:26--------------------------------------------------- -- cgit v1.2.3 From e42e01e951a83646fd5e037e241cb729579704d6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 12:42:07 +0200 Subject: dba33h: #i111396# fix getNatvieControlRegion --- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 9d3ce6b137cd..ec92c20b54b5 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -1102,8 +1102,9 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, GtkRequisition aReq; gtk_widget_size_request( widget, &aReq ); Rectangle aEditRect = rControlRegion; + long nHeight = (aEditRect.GetHeight() > aReq.height+1) ? aEditRect.GetHeight() : aReq.height+1; aEditRect = Rectangle( aEditRect.TopLeft(), - Size( aEditRect.GetWidth(), aReq.height+1 ) ); + Size( aEditRect.GetWidth(), nHeight ) ); rNativeBoundingRegion = aEditRect; rNativeContentRegion = rNativeBoundingRegion; returnVal = TRUE; @@ -2291,11 +2292,10 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, const ImplControlValue& aValue, const OUString& ) { - OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM ); + OSL_ASSERT( nType != CTRL_TAB_ITEM || aValue.getType() == CTRL_TAB_ITEM ); GdkPixmap * pixmap; Rectangle pixmapRect; Rectangle tabRect; - const TabitemValue * pTabitemValue = static_cast(&aValue); GtkStateType stateType; GtkShadowType shadowType; if( ! gWidgetData[ m_nScreen ].gCacheTabItems ) @@ -2311,9 +2311,8 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, if( !aCachePage.GetSize() ) aCachePage.SetSize( 1 ); - if ( !pTabitemValue && (nType==CTRL_TAB_ITEM) ) + if ( (nType == CTRL_TAB_ITEM) && (aValue.getType() != CTRL_TAB_ITEM) ) { - std::fprintf( stderr, "NWPaintGTKTabItem() received a NULL TabitemValue. Cannot draw native tab\n" ); return( false ); } @@ -2326,6 +2325,7 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart, pixmapRect = rControlRectangle; if ( nType == CTRL_TAB_ITEM ) { + const TabitemValue * pTabitemValue = static_cast(&aValue); if ( !pTabitemValue->isFirst() ) { // GTK+ tabs overlap on the right edge (the top tab obscures the -- cgit v1.2.3 From 4b5214f0d0f0d95b94314a85b4cdd2156c596d65 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 12:58:30 +0200 Subject: chart50: #i113950# ODF: don't export text:id with bad value --- xmloff/source/chart/SchXMLExport.cxx | 38 ++++++---------- xmloff/source/chart/SchXMLTableContext.cxx | 70 +++++++++++++++++++++++++++++- xmloff/source/chart/SchXMLTools.cxx | 23 ++++++++++ xmloff/source/chart/SchXMLTools.hxx | 2 + 4 files changed, 108 insertions(+), 25 deletions(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index c4abc4172959..5af8f0f3e5ea 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1688,20 +1688,16 @@ void SchXMLExportHelper_Impl::exportTable() { mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); - // write the original range name as id into the local table - // to allow a correct re-association when copying via clipboard + exportText( *aIt ); + if( nC < nComplexCount ) + lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport ); if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd ) { + // remind the original range to allow a correct re-association when copying via clipboard if ((*aColumnDescriptions_RangeIter).getLength()) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aColumnDescriptions_RangeIter); - } + SchXMLTools::exportRangeToSomewhere( mrExport, *aColumnDescriptions_RangeIter ); ++aColumnDescriptions_RangeIter; } - exportText( *aIt ); - if( nC < nComplexCount ) - lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport ); } OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd ); } // closing row and header-rows elements @@ -1725,17 +1721,15 @@ void SchXMLExportHelper_Impl::exportTable() SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); if( aRowDescriptionsIter != aData.aRowDescriptions.end()) { - // write the original range name as id into the local table - // to allow a correct re-association when copying via clipboard - if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aRowDescriptions_RangeIter++); - } exportText( *aRowDescriptionsIter ); ++aRowDescriptionsIter; if( nC < nComplexCount ) lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport ); + if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) + { + // remind the original range to allow a correct re-association when copying via clipboard + SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ ); + } } } @@ -1748,19 +1742,15 @@ void SchXMLExportHelper_Impl::exportTable() mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); - // write the original range name as id into the local table to - // allow a correct re-association when copying via clipboard + exportText( msString, false ); // do not convert tabs and lfs if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) && - ( mbRowSourceColumns || (aColIt == aRowIt->begin())) ) + ( mbRowSourceColumns || (aColIt == aRowIt->begin()) ) ) { + // remind the original range to allow a correct re-association when copying via clipboard if ((*aDataRangeIter).getLength()) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aDataRangeIter); - } + SchXMLTools::exportRangeToSomewhere( mrExport, *aDataRangeIter ); ++aDataRangeIter; } - exportText( msString, false ); // do not convert tabs and lfs } } } diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index d82970858ebe..d3f0670f672d 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -34,6 +34,7 @@ #include "SchXMLImport.hxx" #include "SchXMLTools.hxx" #include "transporttypes.hxx" +#include "XMLStringBufferImportContext.hxx" #include #include #include "xmlnmspe.hxx" @@ -687,6 +688,35 @@ SvXMLImportContext* SchXMLTableRowContext::CreateChildContext( return pContext; } +//--------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------- + +class SchXMLRangeSomewhereContext : public SvXMLImportContext +{ +//#i113950# previously the range was exported to attribute text:id, +//but that attribute does not allow arbitrary strings anymore +//so we need to find an alternative to save that range info for copy/paste scenario ... +//-> use description at an empty group element for now + +private: + ::rtl::OUString& mrRangeString; + ::rtl::OUStringBuffer maRangeStringBuffer; + +public: + SchXMLRangeSomewhereContext( SvXMLImport& rImport, + const ::rtl::OUString& rLocalName, + ::rtl::OUString& rRangeString ); + virtual ~SchXMLRangeSomewhereContext(); + + virtual SvXMLImportContext* CreateChildContext( + USHORT nPrefix, + const ::rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); + virtual void EndElement(); +}; + +//--------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------- // ======================================== // classes for cells and their content @@ -778,11 +808,18 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext( pContext = new SchXMLTextListContext( GetImport(), rLocalName, *rCell.pComplexString ); mbReadText = sal_False;//don't apply text from } - // element - read text and range-id + // element - read text (and range from text:id old version) else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) ) { pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId ); } + // element - read range + else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_G ) ) + { + //#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore + //so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now + pContext = new SchXMLRangeSomewhereContext( GetImport(), rLocalName, maRangeId ); + } else { pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -1148,3 +1185,34 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( } } +//--------------------------------------------------------------------------------------------------- + +SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport, + const OUString& rLocalName, + OUString& rRangeString ) : + SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ), + mrRangeString( rRangeString ) +{ +} + +SchXMLRangeSomewhereContext::~SchXMLRangeSomewhereContext() +{ +} + +SvXMLImportContext* SchXMLRangeSomewhereContext::CreateChildContext( + USHORT nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList >& ) +{ + if( XML_NAMESPACE_SVG == nPrefix && IsXMLToken( rLocalName, XML_DESC ) ) + { + return new XMLStringBufferImportContext( + GetImport(), nPrefix, rLocalName, maRangeStringBuffer ); + } + return new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); +} + +void SchXMLRangeSomewhereContext::EndElement() +{ + mrRangeString = maRangeStringBuffer.makeStringAndClear(); +} diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 582e5aead326..b2a90e534771 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -600,6 +600,29 @@ void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsL } } +void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue ) +{ + //with issue #i366# and CWS chart20 ranges for error bars were introduced + //to keep them during copy paste from calc to impress for example it + //was necessary to introduce a mapping between the used ranges within calc and the data written to the local table + //this is why we write this ranges here + + //#i113950# first the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore within ODF 1.2 + //as an alternative the range info is now saved into the description at an empty group element (not very nice, but ODF conform) + + const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( nCurrentODFVersion == SvtSaveOptions::ODFVER_010 || nCurrentODFVersion == SvtSaveOptions::ODFVER_011 ) + return;//svg:desc is not allowed at draw:g in ODF1.0; but as the ranges for error bars are anyhow not allowed within ODF1.0 nor ODF1.1 we do not need the information + + SvXMLElementExport aEmptyShapeGroup( rExport, XML_NAMESPACE_DRAW, + ::xmloff::token::GetXMLToken( ::xmloff::token::XML_G ), + sal_True, sal_False ); + SvXMLElementExport aDescription( rExport, XML_NAMESPACE_SVG, + ::xmloff::token::GetXMLToken( ::xmloff::token::XML_DESC ), + sal_True, sal_False ); + rExport.GetDocHandler()->characters( rValue ); +} + Reference< chart2::XRegressionCurve > getRegressionCurve( const Reference< chart2::XDataSeries > & xDataSeries ) { diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx index bcc39ae3d114..d8841bf3861b 100644 --- a/xmloff/source/chart/SchXMLTools.hxx +++ b/xmloff/source/chart/SchXMLTools.hxx @@ -105,6 +105,8 @@ namespace SchXMLTools void exportText( SvXMLExport& rExport, const ::rtl::OUString& rText, bool bConvertTabsLFs ); + void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue ); + /** returns the properties of the equation of the first regression curve that is no mean-value line */ -- cgit v1.2.3 From 12c69822be95534b8a960fbd5e11379925610be0 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 13:43:26 +0200 Subject: dba33h: #i111396# fix getNativeControlRegion --- vcl/aqua/source/gdi/salnativewidgets.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index 6e206977b5c4..9ce2b8a5a518 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -1366,10 +1366,12 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa w = aCtrlBoundRect.GetWidth(); if( w < 3+2*FOCUS_RING_WIDTH ) w = 3+2*FOCUS_RING_WIDTH; - h = TEXT_EDIT_HEIGHT_NORMAL; + h = TEXT_EDIT_HEIGHT_NORMAL+2*FOCUS_RING_WIDTH; + if( h < aCtrlBoundRect.GetHeight() ) + h = aCtrlBoundRect.GetHeight(); - rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH-2, h-2 ) ); - rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); + rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) ); + rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); toReturn = TRUE; } -- cgit v1.2.3 From 8412850383ef9569d42c4a8fd4493a7185799d37 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 15:40:24 +0200 Subject: chart50: #i114142# ODF: don't export invalid content to attribute chart:axis-label-position --- xmloff/inc/xmloff/xmltoken.hxx | 3 +++ xmloff/source/chart/PropertyMap.hxx | 2 ++ xmloff/source/core/xmltoken.cxx | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index f4843d54ace1..80238a075973 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3110,6 +3110,9 @@ namespace xmloff { namespace token { XML_DIAGONAL_BL_TR_WIDTHS, XML_DIAGONAL_TL_BR_WIDTHS, + XML_OUTSIDE_MINIMUM,//#i114142# + XML_OUTSIDE_MAXIMUM,//#i114142# + XML_TOKEN_END }; diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 0616040148b5..79a59ab6910f 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -223,6 +223,8 @@ SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] = { ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE }, { ::xmloff::token::XML_OUTSIDE_START, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START }, { ::xmloff::token::XML_OUTSIDE_END, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END }, + { ::xmloff::token::XML_OUTSIDE_MINIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142# + { ::xmloff::token::XML_OUTSIDE_MAXIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142# { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index a3d4a0c48d02..d65bafe583df 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3082,8 +3082,8 @@ namespace xmloff { namespace token { TOKEN( "axis-label-position", XML_AXIS_LABEL_POSITION ), TOKEN( "near-axis", XML_NEAR_AXIS ), TOKEN( "near-axis-other-side", XML_NEAR_AXIS_OTHER_SIDE ), - TOKEN( "outside-minimum", XML_OUTSIDE_START ), - TOKEN( "outside-maximum", XML_OUTSIDE_END ), + TOKEN( "outside-start", XML_OUTSIDE_START ), + TOKEN( "outside-end", XML_OUTSIDE_END ), TOKEN( "tick-mark-position", XML_TICK_MARK_POSITION ), TOKEN( "at-labels", XML_AT_LABELS ), TOKEN( "at-axis", XML_AT_AXIS ), @@ -3110,6 +3110,9 @@ namespace xmloff { namespace token { TOKEN( "diagonal-bl-tr-widths", XML_DIAGONAL_BL_TR_WIDTHS ), TOKEN( "diagonal-tl-br-widths", XML_DIAGONAL_TL_BR_WIDTHS ), + TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ), + TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ), + #if OSL_DEBUG_LEVEL > 0 { 0, NULL, NULL, XML_TOKEN_END } #else -- cgit v1.2.3 From 014547dafd3c0d455c37ba3c8df4a222a609c6c6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Aug 2010 15:51:44 +0200 Subject: #i111295# getFormattedValue: don't treat non-numeric columns with numeric formats --- connectivity/source/commontools/formattedcolumnvalue.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index 3707b7fdb65d..d63c83524389 100644 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -326,9 +326,16 @@ namespace dbtools ::rtl::OUString sStringValue; if ( m_pData->m_xColumn.is() ) { - sStringValue = DBTypeConversion::getValue( - m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType - ); + if ( m_pData->m_bNumericField ) + { + sStringValue = DBTypeConversion::getValue( + m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType + ); + } + else + { + sStringValue = m_pData->m_xColumn->getString(); + } } return sStringValue; } -- cgit v1.2.3 From 5f10df484d43bf5fcec2269f503c3ee9e0d0cccd Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Aug 2010 16:01:02 +0200 Subject: #dba33h: #i114147# catch an access to an empty interface --- vcl/aqua/source/a11y/aqua11yselectionwrapper.mm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm index 53ab6dd36128..804cf108dba8 100644 --- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm @@ -40,20 +40,23 @@ using namespace ::com::sun::star::uno; +(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper { Reference< XAccessibleSelection > xAccessibleSelection = [ wrapper accessibleSelection ]; - NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; - - try { - sal_Int32 n = xAccessibleSelection -> getSelectedAccessibleChildCount(); - for ( sal_Int32 i=0 ; i < n ; ++i ) { - [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ]; + if( xAccessibleSelection.is() ) + { + NSMutableArray * children = [ [ NSMutableArray alloc ] init ]; + try { + sal_Int32 n = xAccessibleSelection -> getSelectedAccessibleChildCount(); + for ( sal_Int32 i=0 ; i < n ; ++i ) { + [ children addObject: [ AquaA11yFactory wrapperForAccessible: xAccessibleSelection -> getSelectedAccessibleChild( i ) ] ]; + } + + return children; + + } catch ( Exception& e) + { } - - return children; - - } catch ( Exception& e) { - return nil; } + return nil; } -- cgit v1.2.3 From d80d6e32933eddd5802e3a62113237d6a4d5c63d Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 16:46:26 +0200 Subject: chart50: #i114149# ODF: export missing attribute dimension to element chart:error-indicator --- xmloff/source/chart/SchXMLExport.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 5af8f0f3e5ea..e6f6fc6d9340 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3053,6 +3053,10 @@ void SchXMLExportHelper_Impl::exportSeries( { // add style name attribute AddAutoStyleAttribute( aPropertyStates ); + + const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( nCurrentVersion >= SvtSaveOptions::ODFVER_012 ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );//#i114149# SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, sal_True, sal_True ); } else // autostyles -- cgit v1.2.3 From 2ba3b618bea27646eec902ac33f0b713eddf47a3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:26:49 +0200 Subject: dba33h: #i114105# fix version number --- .../sun/star/report/pentaho/output/OfficeDocumentReportTarget.java | 7 ++++++- .../java/com/sun/star/report/pentaho/output/StylesWriter.java | 3 ++- .../sun/star/report/pentaho/output/text/TextRawReportTarget.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java index d4046424e07d..b41252a17089 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java @@ -138,6 +138,10 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget public static final String VERTICAL_POS = "vertical-pos"; private static final String ZERO_CM = "0cm"; + /** the verison of the ODF specification to which generated documents + * shall conform. */ + public static final String ODF_VERSION = "1.2"; + protected static class BufferState { @@ -376,7 +380,8 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); rootAttributes.addNamespaceDeclaration("grddl", OfficeNamespaces.GRDDL_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.2"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + ODF_VERSION); this.rootXmlWriter.writeXmlDeclaration("UTF-8"); this.rootXmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-content", rootAttributes, XmlWriterSupport.OPEN); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java index 9b2e6b33b5f7..7c2671921d3f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java @@ -374,7 +374,8 @@ public class StylesWriter rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); rootAttributes.addNamespaceDeclaration("grddl", OfficeNamespaces.GRDDL_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.2"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + OfficeDocumentReportTarget.ODF_VERSION); this.xmlWriter.writeXmlDeclaration("UTF-8"); this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java index 7c90bf1fd0ec..9f3746086b87 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java @@ -1269,7 +1269,8 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS); rootAttributes.addNamespaceDeclaration("config", OfficeNamespaces.CONFIG); rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0"); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", + OfficeDocumentReportTarget.ODF_VERSION); final OutputStream outputStream = getOutputRepository().createOutputStream("settings.xml", "text/xml"); final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), createTagDescription()); xmlWriter.setAlwaysAddNamespace(true); -- cgit v1.2.3 From 2d9f7d9a9104a0679fb303e58b24a973f8a0a0ad Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:28:34 +0200 Subject: dba33h: #i114106# fix invalid root element for styles --- .../java/com/sun/star/report/pentaho/output/StylesWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java index 7c2671921d3f..54b7d0d0159c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java @@ -117,11 +117,11 @@ public class StylesWriter { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] + writeCommonStylesSection(new OfficeStylesCollection[] { globals }); - writeCommonStylesSection(new OfficeStylesCollection[] + writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); @@ -379,7 +379,7 @@ public class StylesWriter this.xmlWriter.writeXmlDeclaration("UTF-8"); this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, - "document-content", rootAttributes, XmlWriterSupport.OPEN); + "document-styles", rootAttributes, XmlWriterSupport.OPEN); } public void close() -- cgit v1.2.3 From 42af84d9127d16c33e1efdb8b3cb9dc02b9364b3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:31:28 +0200 Subject: dba33h: #i114106# fix missing value-type --- .../report/pentaho/layoutprocessor/TableCellLayoutController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java index 506ea6347d4a..f3c5ef383057 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -84,6 +84,13 @@ public class TableCellLayoutController extends SectionLayoutController attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE, "NaN"); } + // #i114108#: except on form elements, the only value-type that can + // occur without an accomanying value attribute is "string" + else if (!"string".equals(valueType)) + { + attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS, + FormatValueUtility.VALUE_TYPE, "string"); + } } catch (Exception e) { -- cgit v1.2.3 From 18d1017ba00291e4ab938f2456fd2a4afb9889f4 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Aug 2010 11:33:41 +0200 Subject: dba3h: #i114111#: reportbuilder: do not use Double.toString() when writing the 2 column-width attribute, it may write an exponent, which is invalid.. --- .../report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java index 11351b656ea1..d2c4ebd96e3c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java @@ -624,7 +624,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final Section tableColumnProperties = new Section(); tableColumnProperties.setType("table-column-properties"); tableColumnProperties.setNamespace(style.getNamespace()); - tableColumnProperties.setAttribute(style.getNamespace(), "column-width", columnWidth + getUnitsOfMeasure(null)); + final String width = String.format("%f", columnWidth); + tableColumnProperties.setAttribute(style.getNamespace(), + "column-width", width + getUnitsOfMeasure(null)); style.addNode(tableColumnProperties); final AttributeList myAttrList = new AttributeList(); -- cgit v1.2.3 From f677ac480835e92c90521a46b59a7d748f4566bf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Aug 2010 14:08:45 +0200 Subject: dba33h: #i114161# --- vcl/source/window/syswin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f3624ef56f59..f6a37658b79f 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -773,7 +773,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) BOOL bWrapped = FALSE; while( pWin ) { - if( !pWin->ImplIsRealParentPath( this ) && + if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) && pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible ) { SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry(); -- cgit v1.2.3 From 4a15cba3afa8bf8a81798c5c3fa124fce85e7f55 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Aug 2010 14:08:45 +0200 Subject: dba33h: #i114161# --- sfx2/source/dialog/taskpane.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 5d763f81744d..30fe2460d512 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -253,10 +253,11 @@ namespace sfx2 pWindow->SetHelpId( HID_TASKPANE_WINDOW ); pWindow->SetOutputSizePixel( Size( 300, 450 ) ); - pWindow->Show(); dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo ); SetHideNotDelete( TRUE ); + + pWindow->Show(); } //------------------------------------------------------------------------------------------------------------------ -- cgit v1.2.3 From 7efea44937b783ef1663006410e9d8c7f549f3be Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 30 Aug 2010 18:45:51 +0200 Subject: calc59: #i114202# save table:show-empty attribute only if valid in ScDPSaveDimension --- sc/inc/dpsave.hxx | 1 + sc/source/core/data/dpsave.cxx | 5 +++++ sc/source/filter/xml/XMLExportDataPilot.cxx | 10 +++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index bfff0b97a168..8272b850b27e 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -140,6 +140,7 @@ public: void SetSubTotals(long nCount, const USHORT* pFuncs); long GetSubTotalsCount() const { return nSubTotalCount; } USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } + bool HasShowEmpty() const; void SetShowEmpty(BOOL bSet); BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); } void SetFunction(USHORT nNew); // enum GeneralFunction diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index dd493bb0df6c..bad05968bf72 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -410,6 +410,11 @@ void ScDPSaveDimension::SetSubTotals(long nCount, const USHORT* pFuncs) bSubTotalDefault = FALSE; } +bool ScDPSaveDimension::HasShowEmpty() const +{ + return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW; +} + void ScDPSaveDimension::SetShowEmpty(BOOL bSet) { nShowEmptyMode = bSet; diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index e43ff21a114d..f8cba5ecf6c3 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -503,9 +503,13 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) void ScXMLExportDataPilot::WriteLevels(ScDPSaveDimension* pDim) { - rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty()); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear()); + // #i114202# GetShowEmpty is only valid if HasShowEmpty is true. + if (pDim->HasShowEmpty()) + { + rtl::OUStringBuffer sBuffer; + SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear()); + } SvXMLElementExport aElemDPL(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_LEVEL, sal_True, sal_True); WriteSubTotals(pDim); -- cgit v1.2.3 From 368fcc28b151d4c5428e67e15a1e60f64a88d832 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 31 Aug 2010 13:42:47 +0200 Subject: dba33i: #i114173# fix name to select from and field name of auto incremtn column --- dbaccess/source/core/api/KeySet.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 992c748aad2e..3d4f66ff8830 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -809,10 +809,12 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString for (;aAutoIter != aAutoEnd; ++aAutoIter) { // we will only fetch values which are keycolumns - if ( m_pKeyColumnNames->find(*aAutoIter) != aEnd ) + SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); + if ( aFind != aEnd ) { sMaxStmt += sMax; - sMaxStmt += ::dbtools::quoteName( sQuote,*aAutoIter); + sMaxStmt += ::dbtools::quoteName( sQuote,aFind->second.sRealName +); sMaxStmt += sMaxEnd; } } @@ -823,7 +825,9 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString ::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT "); sStmt += sMaxStmt; sStmt += ::rtl::OUString::createFromAscii("FROM "); - sStmt += m_aSelectComposedTableName; + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); try { // now fetch the autoincrement values -- cgit v1.2.3 From 559c4cb8afb0e7ce94405c2a8e048fc31f913df6 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 1 Sep 2010 09:29:20 +0200 Subject: dba33i: #i114189# correct wrong used variable --- dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 69520d043c52..2f9a58c975b7 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1266,13 +1266,13 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon // Feldnamen sal_uInt16 i; for (i=0;i< pLhs->count();i++) - pCondition->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); + pLhs->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); // Kriterium aItem.Handle = pCondition->getChild(1)->getNodeType(); aValue = pCondition->getChild(1)->getTokenValue(); for(i=0;i< pRhs->count();i++) - pCondition->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); + pRhs->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) ); aItem.Name = aName; aItem.Value <<= aValue; -- cgit v1.2.3 From 073050f4527815a0825937bc0d398959dfb556ec Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 13:01:03 +0200 Subject: jl158: #i114008# pre-indexing of extension help --- xmlhelp/prj/d.lst | 1 + xmlhelp/util/makefile.mk | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst index 1cfa107f73b9..ec45189d3045 100644 --- a/xmlhelp/prj/d.lst +++ b/xmlhelp/prj/d.lst @@ -4,4 +4,5 @@ ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.* ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.* ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml +..\util\*.xsl %_DEST%\bin%_EXT%\*.* ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk index 10206670b5f8..66551f15bffc 100644 --- a/xmlhelp/util/makefile.mk +++ b/xmlhelp/util/makefile.mk @@ -74,5 +74,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------------------------------- +ZIP1TARGET=helpxsl +ZIP1FLAGS= -u -r +#ZIP1DIR=$(PRJ)$/source$/auxiliary +ZIP1LIST=main_transform*.xsl idxcaption.xsl idxcontent.xsl + + .INCLUDE: target.mk -- cgit v1.2.3 From 1de48c417404464ca1e34e5c5d1c82a9342349bb Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 13:01:03 +0200 Subject: jl158: #i114008# pre-indexing of extension help --- sdext/prj/d.lst | 1 + .../en-US/com.sun.PresenterScreen/presenter.xhp | 10 ++-- sdext/source/presenter/makefile.mk | 30 +++++++++-- swext/mediawiki/build.xml | 16 ++---- swext/mediawiki/help/makefile.mk | 58 +++++++++++++--------- swext/prj/build.lst | 2 +- 6 files changed, 72 insertions(+), 45 deletions(-) diff --git a/sdext/prj/d.lst b/sdext/prj/d.lst index 71a91653c3d2..c5105c35560f 100644 --- a/sdext/prj/d.lst +++ b/sdext/prj/d.lst @@ -6,3 +6,4 @@ mkdir: %_DEST%\bin%_EXT%\pdfimport ..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt ..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\presentation-minimizer.oxt ..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter\presenter-screen.oxt +..\%__SRC%\bin\presenter-screen_develop.zip %_DEST%\bin%_EXT%\presenter\presenter-screen_develop.zip diff --git a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp index a1172d540d7e..ba8f29bb497f 100644 --- a/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp +++ b/sdext/source/presenter/help/en-US/com.sun.PresenterScreen/presenter.xhp @@ -33,16 +33,16 @@ - Oracle Presenter Console Keyboard Shortcuts + @PRESENTEREXTENSIONPRODUCTNAME@ Keyboard Shortcuts /com.sun.PresenterScreen-PLATFORMID/presenter.xhp -Presenter Console shortcuts +@PRESENTEREXTENSIONPRODUCTNAME@ shortcuts -Oracle Presenter Console Keyboard Shortcuts - When running a slide show using the Oracle Presenter Console, you can use the following keys: +@PRESENTEREXTENSIONPRODUCTNAME@ Keyboard Shortcuts + When running a slide show using the @PRESENTEREXTENSIONPRODUCTNAME@, you can use the following keys: @@ -158,7 +158,7 @@ - Show the Presenter Console + Show the @PRESENTEREXTENSIONPRODUCTNAME@ Ctrl-'1' diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index 08a3470fc24d..eacc4c726725 100755 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -32,11 +32,16 @@ GEN_HID=FALSE EXTNAME=PresenterScreen ENABLE_EXCEPTIONS=TRUE +# survive zip dependencies +MAXLINELENGTH:=80000 # --- Settings ---------------------------------- .INCLUDE : rtlbootstrap.mk .INCLUDE : settings.mk + +PACKAGE=com.sun.PresenterScreen-$(PLATFORMID) + .IF "$(L10N_framework)"=="" .INCLUDE : $(PRJ)$/util$/makefile.pmk @@ -107,6 +112,12 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1RPATH= OXT DEF1NAME= $(SHL1TARGET) +ZIP2TARGET= presenter-screen_develop +ZIP2DIR= $(COMMONMISC) +ZIP2EXT= .zip +ZIP2FLAGS=-r +ZIP2LIST= */com.sun.PresenterScreen/*.xhp + ZIP1TARGET= presenter-screen ZIP1DIR= $(MISC)$/$(TARGET) ZIP1EXT= .oxt @@ -248,10 +259,6 @@ PLATFORMID:=$(RTL_OS:l)_$(RTL_ARCH:l) COMPONENT_HELP= \ $(ZIP1DIR)$/help/component.txt \ $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) -# $(ZIP1DIR)$/help$/en-US$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp - -# no localization yet - see #i107498# -# $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) ZIP1DEPS= \ $(PACKLICS) \ @@ -262,14 +269,25 @@ ZIP1DEPS= \ $(COMPONENT_IMAGES) \ $(COMPONENT_LIBRARY) \ $(COMPONENT_HELP) + # $(COMPONENT_MERGED_XCU) \ +LINKNAME:=help +XHPLINKSRC:=$(ZIP1DIR)/help + +my_XHPFILES= \ + presenter.xhp + +LINKLINKFILES= \ + $(PACKAGE)/{$(my_XHPFILES)} # --- Targets ---------------------------------- .ENDIF # L10N_framework .INCLUDE : target.mk +.INCLUDE : extension_helplink.mk + .IF "$(L10N_framework)"=="" $(SLO)$/PresenterComponent.obj : $(INCCOM)$/PresenterExtensionIdentifier.hxx @@ -287,7 +305,9 @@ $(ZIP1DIR)$/help$/component.txt : help$/$$(@:f) $(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : $(COMMONMISC)/%/com.sun.PresenterScreen/presenter.xhp @echo creating $@ @@-$(MKDIRHIER) $(@:d) - $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/" > $@ + $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/ ; s/@PRESENTEREXTENSIONPRODUCTNAME@/Presenter Console/g " > $@ + +$(ZIP1TARGETN) : $(HELPLINKALLTARGETS) $(COMPONENT_BITMAPS) : bitmaps$/$$(@:f) @-$(MKDIRHIER) $(@:d) diff --git a/swext/mediawiki/build.xml b/swext/mediawiki/build.xml index ff96fe578ca6..8dea0dce0bd2 100644 --- a/swext/mediawiki/build.xml +++ b/swext/mediawiki/build.xml @@ -123,15 +123,6 @@ - - - - - - - - - @@ -149,6 +140,8 @@ + + @@ -161,14 +154,15 @@ - + - + + diff --git a/swext/mediawiki/help/makefile.mk b/swext/mediawiki/help/makefile.mk index 1cb200a1860f..72608a80de0b 100644 --- a/swext/mediawiki/help/makefile.mk +++ b/swext/mediawiki/help/makefile.mk @@ -30,16 +30,29 @@ PRJNAME=swext TARGET=$(PRJNAME)_help .INCLUDE : settings.mk -.INCLUDE : target.mk - -.IF "$(ENABLE_MEDIAWIKI)" == "YES" -PACKAGE=com.sun.sun-mediawiki +.IF "$(WITH_LANG)"!="" # workaround for the problem in help, the help uses en instead of en-US -MEDIAWIKI_LANG= en $(alllangiso) +MEDIAWIKI_LANG=$(uniq en $(alllangiso)) +aux_alllangiso:=$(MEDIAWIKI_LANG) +.ELSE # "$(WITH_LANG)"!="" +aux_alllangiso:=$(defaultlangiso) +MEDIAWIKI_LANG=$(uniq en $(alllangiso)) +.ENDIF # "$(WITH_LANG)"!="" + +.IF "$(ENABLE_MEDIAWIKI)" != "YES" +all: + @echo Building mediawiki disabled... +.ELSE # "$(ENABLE_MEDIAWIKI)" != "YES" + +PACKAGE=com.sun.wiki-publisher -OUT_MEDIAWIKI=$(MISC)$/mediawiki -OUT_HELP=$(OUT_MEDIAWIKI)$/help +OUT_MEDIAWIKI:=$(MISC)$/mediawiki + +LINKNAME:=help +XHPLINKSRC:=$(OUT_MEDIAWIKI)/help + +XHPDEST=$(OUT_MEDIAWIKI)_merge/help XHPFILES= \ wiki.xhp\ @@ -48,26 +61,25 @@ XHPFILES= \ wikisend.xhp\ wikisettings.xhp -HLANGXHPFILES:=$(foreach,i,$(XHPFILES) $(foreach,j,$(MEDIAWIKI_LANG) $(OUT_HELP)$/$j$/$(PACKAGE)$/$(i:f))) +LINKLINKFILES= \ + $(PACKAGE)/{$(XHPFILES)} -ALLTAR : $(OUT_MEDIAWIKI)$/$(TARGET).done $(OUT_HELP)$/component.txt +# define with own language set +HLANGXHPFILES=$(foreach,i,$(XHPFILES) $(foreach,j,$(MEDIAWIKI_LANG) $(XHPDEST)$/$j$/$(PACKAGE)$/$(i:f))) -#$(OUT_MEDIAWIKI)$/xhp_changed.flag optix - -$(OUT_HELP)$/component.txt : component.txt - $(COPY) component.txt $(OUT_HELP)$/component.txt +.INCLUDE : target.mk +.INCLUDE : tg_help.mk +.INCLUDE : extension_helplink.mk -$(HLANGXHPFILES) : #$$(@:d)thisdir.created - -$(MKDIRHIER) $(@:d) - $(TOUCH) $(@:d)thisdir.created +ALLTAR : $(OUT_MEDIAWIKI)/help/component.txt -$(OUT_HELP)$/{$(MEDIAWIKI_LANG)}$/$(PACKAGE)$/%.xhp :| %.xhp - @$(TOUCH) $@ -# internal dependencies not sufficient to trigger merge? -# @$(NULL) +$(OUT_MEDIAWIKI)/help/component.txt : component.txt + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(COPY) component.txt $@ +$(OUT_MEDIAWIKI)/help/%.xhp : $(OUT_MEDIAWIKI)_merge/help/%.xhp + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)cat $< | sed -e 's/@WIKIEXTENSIONPRODUCTNAME@/Wiki Publisher/g ; s/@WIKIEXTENSIONID@/com.sun.wiki-publisher/g ; s/@WIKIEXTENSIONFILENAME@/wiki-publisher/g' > $@ -$(OUT_MEDIAWIKI)$/$(TARGET).done : $(LOCALIZESDF) $(XHPFILES) $(HLANGXHPFILES) - @$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(OUT_HELP) -y $(PACKAGE) -l all -lf $(MEDIAWIKI_LANG:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ -.ENDIF +.ENDIF # "$(ENABLE_MEDIAWIKI)" != "YES" diff --git a/swext/prj/build.lst b/swext/prj/build.lst index eb1aaca61422..aa07df358770 100644 --- a/swext/prj/build.lst +++ b/swext/prj/build.lst @@ -1,4 +1,4 @@ -swext swext : officecfg l10n javaunohelper ridljar unoil jurt APACHE_COMMONS:apache-commons readlicense_oo xsltml NULL +swext swext : officecfg l10n javaunohelper ridljar unoil jurt APACHE_COMMONS:apache-commons readlicense_oo xsltml xmlhelp NULL swext swext usr1 - all swext_mkout NULL swext swext\mediawiki\help nmake - all swext_mwhelp NULL swext swext\mediawiki\src\registry\schema\org\openoffice\Office\Custom nmake - all swext_mwschema NULL -- cgit v1.2.3 From cc4432bb8a07d50388b5778e1bad19f882467446 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 13:01:03 +0200 Subject: jl158: #i114008# pre-indexing of extension help --- solenv/inc/extension_helplink.mk | 78 ++++++++++++++++++++++++++++++++++++++++ solenv/inc/tg_help.mk | 10 +++--- 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 solenv/inc/extension_helplink.mk diff --git a/solenv/inc/extension_helplink.mk b/solenv/inc/extension_helplink.mk new file mode 100644 index 000000000000..0a7521842d08 --- /dev/null +++ b/solenv/inc/extension_helplink.mk @@ -0,0 +1,78 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +my_cp:=$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)/jaxp.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/juh.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/parser.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/xt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/unoil.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/ridl.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/jurt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/xmlsearch.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/LuceneHelpWrapper.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/HelpIndexerTool.jar$ + +.IF "$(SYSTEM_LUCENE)" == "YES" +my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR) +.ELSE +my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-2.3.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-2.3.jar +.ENDIF + +.IF "$(SYSTEM_DB)" != "YES" +JAVA_LIBRARY_PATH= -Djava.library.path=$(SOLARSHAREDBIN) +.ENDIF + +#aux_alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(aux_langdirs) $(eq,$i,$j $i $(NULL)))) +aux_alllangiso*:=$(alllangiso) + +######################################################### + + +HELPLINKALLTARGETS=$(foreach,i,$(aux_alllangiso) $(MISC)/$(TARGET)_$(LINKNAME)_$i.done) +HELPLINKALLADDEDDEPS=$(foreach,i,$(aux_alllangiso) $(subst,LANGUAGE,$i $(LINKADDEDDPES))) + +ALLTAR : $(HELPLINKALLTARGETS) + +.IF "$(SYSTEM_DB)" != "YES" +JAVA_LIBRARY_PATH= -Djava.library.path=$(SOLARSHAREDBIN) +.ENDIF + +XSL_DIR*:=$(SOLARBINDIR) +XHPLINKSRC*:=$(XHPDEST) +STY_SWITCH:= -sty $(XSL_DIR)/embed.xsl + +.IF "$(XHPFILES)"!="" +$(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/{$(aux_alllangiso)}/$i) : $(COMMONMISC)/$(TARGET).done +LINKDEPS+=$(COMMONMISC)/xhp_changed.flag +.ENDIF # "$(XHPFILES)"!="" + +$(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/$$(@:b:s/_/./:e:s/.//)/$i) $(subst,LANGUAGE,$$(@:b:s/_/./:e:s/.//) $(LINKDEPS)) + @echo Building help index for $(@:b:s/_/./:e:s/.//) + $(COMMAND_ECHO)$(HELPLINKER) -mod $(LINKNAME) -extlangsrc $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} $(STY_SWITCH) -extlangdest $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -idxcaption $(XSL_DIR)/idxcaption.xsl -idxcontent $(XSL_DIR)/idxcontent.xsl $(LINKLINKFILES) + $(COMMAND_ECHO)cd $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && zip -u -r $(LINKNAME).jar $(PACKAGE)/* $(CHECKZIPRESULT) +.IF "$(SOLAR_JAVA)" == "TRUE" +.IF "$(CHECK_LUCENCE_INDEXER_OUTPUT)" == "" + $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && $(TOUCH) $@ +.ELSE + $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -checkcfsandsegname _0 _3 && $(TOUCH) $@ +.ENDIF +.ELSE + -$(RM) $(XHPLINKSRC)/$(@:b)/content/*.* + -$(RM) $(XHPLINKSRC)/$(@:b)/caption/*.* +.ENDIF + diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk index 89f1ebabec6c..b665f2f4aff8 100644 --- a/solenv/inc/tg_help.mk +++ b/solenv/inc/tg_help.mk @@ -31,13 +31,15 @@ aux_alllangiso*:=$(alllangiso) SHELL_PACKAGE:=$(subst,/,$/ $(PACKAGE)) -HLANGXHPFILES:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(COMMONMISC)$/$j$/$(SHELL_PACKAGE)$/$(i:f))) +XHPDEST*:=$(COMMONMISC) + +HLANGXHPFILES*:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(XHPDEST)$/$j$/$(SHELL_PACKAGE)$/$(i:f))) ALLTAR : $(COMMONMISC)$/$(TARGET).done $(COMMONMISC)$/xhp_changed.flag optix $(HLANGXHPFILES) : $$(@:d)thisdir.created -$(COMMONMISC)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp +$(XHPDEST)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp @$(TOUCH) $@ # internal dependencies not sufficient to trigger merge? # @$(NULL) @@ -45,9 +47,9 @@ $(COMMONMISC)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp $(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES) .IF "$(WITH_LANG)"!="" - $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(COMMONMISC) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ + $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(XHPDEST) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ .ELSE # "$(WITH_LANG)"!="" - cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(COMMONMISC)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@ + cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(XHPDEST)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@ .ENDIF # "$(WITH_LANG)"!="" .IF "$(OS)"=="SOLARIS" @$(ECHONL) " " -- cgit v1.2.3 From 0999deb988a6cd5033031c60a9267e5856400307 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 1 Sep 2010 13:09:46 +0200 Subject: dba33h: #i114246# use correct table name --- dbaccess/source/core/api/KeySet.cxx | 31 +++++++++++++++++++++++++------ dbaccess/source/core/api/KeySet.hxx | 1 - 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 992c748aad2e..88b67b5ea5e3 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -198,7 +198,7 @@ void OKeySet::initColumns() m_pForeignColumnNames.reset( new SelectColumnsMetaData(bCase) ); } void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable - ,const Reference& /*i_xMeta*/ + ,const Reference& i_xMeta ,const Reference& i_xQueryColumns) { // first ask the database itself for the best columns which can be used @@ -209,9 +209,6 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable const Reference xTblColSup(i_aTable,UNO_QUERY_THROW); const Reference xTblColumns = xTblColSup->getColumns(); - ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); - ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); - // locate parameter in select columns Reference xParaSup(m_xComposer,UNO_QUERY); Reference xQueryParameters = xParaSup->getParameters(); @@ -222,7 +219,26 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable Reference xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW); xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i]; } - ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); + + if ( m_sUpdateTableName.getLength() ) + { + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); + } + else + { + ::rtl::OUString sCatalog,sSchema,sTable; + Reference xTableProp(i_aTable,UNO_QUERY); + Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME); + aCatalog >>= sCatalog; + xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; + xTableProp->getPropertyValue(PROPERTY_NAME) >>= sTable; + const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true); + } SelectColumnsMetaData::const_iterator aPosIter = m_pKeyColumnNames->begin(); SelectColumnsMetaData::const_iterator aPosEnd = m_pKeyColumnNames->end(); @@ -823,7 +839,10 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString ::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT "); sStmt += sMaxStmt; sStmt += ::rtl::OUString::createFromAscii("FROM "); - sStmt += m_aSelectComposedTableName; + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); + //sStmt += m_aSelectComposedTableName; try { // now fetch the autoincrement values diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 694593e6c608..212ec237699e 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -112,7 +112,6 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> m_xRow; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; - ::rtl::OUString m_aSelectComposedTableName; ::std::vector< ::rtl::OUString > m_aFilterColumns; sal_Bool m_bRowCountFinal; -- cgit v1.2.3 From 7c006c81f4d7eb4c1dd371585ca09bfc3549a0d7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 13:39:49 +0200 Subject: dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the print preview and back, to SFX In particular, the following changes have been applied - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view factories for such named views - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view is exchanged with another view. In this case, it preserves the view's view data at the model - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from the print preview, has been removed completely. What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY. This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the view names would be speaking then, instead of the current "view" names. --- sfx2/inc/sfx2/docfac.hxx | 2 +- sfx2/inc/sfx2/viewfrm.hxx | 1 + sfx2/inc/sfx2/viewsh.hxx | 11 ++++++ sfx2/inc/viewfac.hxx | 14 ++++++- sfx2/source/doc/docfac.cxx | 4 +- sfx2/source/doc/sfxbasemodel.cxx | 4 +- sfx2/source/view/frmload.cxx | 2 +- sfx2/source/view/sfxbasecontroller.cxx | 51 ++++++++++++++++++++----- sfx2/source/view/viewfac.cxx | 29 ++++++++++++-- sfx2/source/view/viewfrm.cxx | 69 ++++++++++++++++++++++++++++++++++ 10 files changed, 168 insertions(+), 19 deletions(-) diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 7468394d2617..89062d7b7263 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -94,7 +94,7 @@ public: USHORT GetViewFactoryCount() const; SfxViewFactory& GetViewFactory(USHORT i = 0) const; - /// returns the view factory whose GetViewName delivers the requested logical name + /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const; // Filter diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index d376236bf830..a0f5eadd5148 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -253,6 +253,7 @@ public: private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); + SAL_DLLPRIVATE void SaveCurrentViewData_Impl(); /** loads the given existing document into the given frame diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 8465a238cd5b..34362500b690 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -134,6 +134,17 @@ public: \ } \ void Class::InitFactory() +#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ + SfxViewFactory* Class::pFactory; \ + SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ + { return new Class(pFrame, pOldView); } \ + void Class::RegisterFactory( USHORT nPrio ) \ + { \ + pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\ + InitFactory(); \ + } \ + void Class::InitFactory() + #define SFX_VIEW_REGISTRATION(DocClass) \ DocClass::Factory().RegisterViewFactory( Factory() ) diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index 6f9ae1d3cb37..0e6498b1f8a5 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -47,6 +47,8 @@ class SFX2_DLLPUBLIC SfxViewFactory public: SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const ResId& aDescrResId ); + SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ); ~SfxViewFactory(); SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); @@ -56,14 +58,22 @@ public: { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } - /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID - String GetViewName() const; + /// returns a legacy view name. This is "view" with an appended ordinal/ID. + String GetLegacyViewName() const; + + /** returns a API-compatible view name. + + For details on which view names are specified, see the XModel2.getAvailableViewControllerNames + documentation. + */ + String GetAPIViewName() const; private: SfxViewCtor fnCreate; SfxViewInit fnInit; USHORT nOrd; ResId aDescription; + const String m_sViewName; }; #endif diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index bfd67210ec44..8f8a4a969740 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -467,7 +467,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie ) { SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) ); - if ( rViewFac.GetViewName() == i_rViewName ) + if ( ( rViewFac.GetAPIViewName() == i_rViewName ) + || ( rViewFac.GetLegacyViewName() == i_rViewName ) + ) return &rViewFac; } return NULL; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index fe4ffa50f67d..846cc669b9a7 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3812,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) - aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName(); + aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName(); return aViewNames; } @@ -3826,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); - const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName(); + const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName(); aGuard.clear(); diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index ed158ce009e3..df252b831803 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -650,7 +650,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // ensure the ID of the to-be-created view is in the descriptor, if possible const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); - const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); + const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() ); // if the document is created hidden, prevent it from being deleted until it is shown or disposed impl_lockHiddenDocument( *xDoc, aDescriptor ); diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index f5c24b195af7..cda5fd0bdd7d 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -118,6 +118,7 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::lang::DisposedException; using ::com::sun::star::awt::XWindow; using ::com::sun::star::frame::XController; @@ -579,7 +580,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run ::rtl::OUString sViewName; if ( nViewNo < rDocFac.GetViewFactoryCount() ) - sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName(); + sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName(); return sViewName; } @@ -1421,20 +1422,52 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) // if so, forward it to the view/shell. if ( !bHasPluginMode && !bHasJumpMark ) { + // Note that this might not be the ideal place here. Restoring view data should, IMO, be the + // responsibility of the loader, not an implementation detail burried here deep within the controller's + // implementation. + // What I think should be done to replace the below code: + // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts + // a string only), and forward it to its ViewShell's ReadUserDataSequence + // - change the frame loader so that when a new document is loaded (as opposed to an existing + // document being loaded into a new frame), the model's view data is examine the very same + // way as below, and the proper view data is set via XController::restoreViewData + // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview + // view is exchanged, and sets the old view's data at the model. It should also care for the other + // way, were the PrintPreview view is left: in this case, the new view should also be initialized + // with the model's view data try { - Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); - if ( xViewData.is() && xViewData->getCount() > 0 ) + Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW ); + Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW ); + + // find the view data item whose ViewId matches the ID of the view we're just connecting to + const SfxObjectFactory& rDocFactory( rDoc.GetFactory() ); + const sal_Int32 nCount = xViewData->getCount(); + sal_Int32 nViewDataIndex = 0; + for ( sal_Int32 i=0; i aViewData; - if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) ) + const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) ); + ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + if ( sViewId.getLength() == 0 ) + continue; + + const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); + if ( pViewFactory == NULL ) + continue; + + if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() ) { - m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE ); + nViewDataIndex = i; + break; } } + if ( nViewDataIndex < nCount ) + { + Sequence< PropertyValue > aViewData; + OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData ); + if ( aViewData.getLength() > 0 ) + m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE ); + } } catch( const Exception& ) { diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index b58bbc2840da..5ef64a2a8b0d 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -30,6 +30,7 @@ // INCLUDE --------------------------------------------------------------- #include +#include "sfxresid.hxx" #include #include "viewfac.hxx" @@ -49,7 +50,7 @@ void SfxViewFactory::InitFactory() (*fnInit)(); } -String SfxViewFactory::GetViewName() const +String SfxViewFactory::GetLegacyViewName() const { ::rtl::OUStringBuffer aViewName; aViewName.appendAscii( "view" ); @@ -57,6 +58,17 @@ String SfxViewFactory::GetViewName() const return aViewName.makeStringAndClear(); } +String SfxViewFactory::GetAPIViewName() const +{ + if ( m_sViewName.Len() > 0 ) + return m_sViewName; + + if ( GetOrdinal() == 0 ) + return String::CreateFromAscii( "Default" ); + + return GetLegacyViewName(); +} + // CTOR / DTOR ----------------------------------------------------------- SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, @@ -64,11 +76,22 @@ SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, fnCreate(fnC), fnInit(fnI), nOrd(nOrdinal), - aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()) + aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()), + m_sViewName() { aDescription.SetRT(aDescrResId.GetRT()); DBG_CTOR(SfxViewFactory, 0); -// SFX_APP()->RegisterViewFactory_Impl(*this); +} + +SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ): + fnCreate(fnC), + fnInit(fnI), + nOrd(nOrdinal), + aDescription( SfxResId( 0 ) ), + m_sViewName( String::CreateFromAscii( asciiViewName ) ) +{ + DBG_CTOR(SfxViewFactory, 0); } SfxViewFactory::~SfxViewFactory() diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ed924623c700..f1e6e45c5217 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -75,6 +75,8 @@ #include #include #include +#include +#include #include #include @@ -106,6 +108,8 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using ::com::sun::star::awt::XWindow; using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::container::XIndexContainer; namespace css = ::com::sun::star; #ifndef GCC @@ -2242,6 +2246,68 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- +void SfxViewFrame::SaveCurrentViewData_Impl() +{ + SfxViewShell* pCurrentShell = GetViewShell(); + ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" ); + + // determine the logical (API) view name + const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() ); + const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); + const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName(); + if ( sViewName.Len() == 0 ) + { + // can't say anything about the view, the respective application did not yet migrate its code to + // named view factories => bail out + return; + } + + // do *not* save view data when the view is a print preview + if ( sViewName.EqualsAscii( "PrintPreview" ) ) + return; + + // retrieve the view data from the view + Sequence< PropertyValue > aViewData; + pCurrentShell->WriteUserDataSequence( aViewData ); + + try + { + // retrieve view data (for *all* views) from the model + const Reference< XController > xController( pCurrentShell->GetController(), UNO_SET_THROW ); + const Reference< XViewDataSupplier > xViewDataSupplier( xController->getModel(), UNO_QUERY_THROW ); + const Reference< XIndexContainer > xViewData( xViewDataSupplier->getViewData(), UNO_QUERY_THROW ); + + // look up the one view data item which corresponds to our current view, and remove it + const sal_Int32 nCount = xViewData->getCount(); + for ( sal_Int32 i=0; igetByIndex(i) ); + ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + if ( sViewId.getLength() == 0 ) + continue; + + const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); + if ( pViewFactory == NULL ) + continue; + + if ( pViewFactory->GetOrdinal() == GetCurViewId() ) + { + xViewData->removeByIndex(i); + break; + } + } + + // then replace it with the most recent view data we just obtained + xViewData->insertByIndex( 0, makeAny( aViewData ) ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//-------------------------------------------------------------------- + sal_Bool SfxViewFrame::SwitchToViewShell_Impl ( sal_uInt16 nViewIdOrNo, /* > 0 @@ -2304,6 +2370,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; + // save the view data of the old view, so it can be restored later on (when needed) + SaveCurrentViewData_Impl(); + // create and load new ViewShell SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( *GetObjectShell(), -- cgit v1.2.3 From 839c0f5270b12f99a7c9f3f4baadb355695c3424 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 13:39:49 +0200 Subject: dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the print preview and back, to SFX In particular, the following changes have been applied - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view factories for such named views - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view is exchanged with another view. In this case, it preserves the view's view data at the model - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from the print preview, has been removed completely. What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY. This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the view names would be speaking then, instead of the current "view" names. --- sc/inc/ViewSettingsSequenceDefines.hxx | 2 +- sc/source/ui/inc/tabvwsh.hxx | 1 - sc/source/ui/view/prevwsh.cxx | 2 +- sc/source/ui/view/tabvwsh.cxx | 2 +- sc/source/ui/view/tabvwsh4.cxx | 8 -------- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx index f23229d31a43..07c3d2b375e0 100644 --- a/sc/inc/ViewSettingsSequenceDefines.hxx +++ b/sc/inc/ViewSettingsSequenceDefines.hxx @@ -103,6 +103,6 @@ #define SC_PAGEVIEWZOOMVALUE "PageViewZoomValue" #define SC_SHOWPAGEBREAKPREVIEW "ShowPageBreakPreview" #define SC_VIEWID "ViewId" -#define SC_VIEW "View" +#define SC_VIEW "view" #endif diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index b4313c1d7a32..28cc2a823928 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -144,7 +144,6 @@ private: ScNavigatorSettings* pNavSettings; // used in first Activate - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aPendingUserData; BOOL bFirstActivate; BOOL bActiveDrawSh; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 38d5144274c5..48ffd4fd39a4 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -108,7 +108,7 @@ SFX_IMPL_INTERFACE( ScPreviewShell, SfxViewShell, ScResId(SCSTR_PREVIEWSHELL) ) SFX_POPUPMENU_REGISTRATION(ScResId(RID_POPUP_PREVIEW)); } -SFX_IMPL_VIEWFACTORY( ScPreviewShell, ScResId(STR_NONAME) ) +SFX_IMPL_NAMED_VIEWFACTORY( ScPreviewShell, "PrintPreview" ) { SFX_VIEW_REGISTRATION(ScDocShell); } diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 1733cf2e19b5..2fc2bba072d9 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -102,7 +102,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) //-->Added by PengYunQuan for Validity Cell Range Picker } -SFX_IMPL_VIEWFACTORY( ScTabViewShell, ScResId(STR_NONAME) ) +SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" ) { SFX_VIEW_REGISTRATION(ScDocShell); } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index ed09ec85ee8c..0835d08de9fd 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -173,13 +173,6 @@ void __EXPORT ScTabViewShell::Activate(BOOL bMDI) SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) ); bFirstActivate = FALSE; - if ( aPendingUserData.hasElements() ) - { - // #89897# read user data from print preview now, after ctor - DoReadUserDataSequence( aPendingUserData ); - aPendingUserData.realloc( 0 ); - } - // #116278# ReadExtOptions (view settings from Excel import) must also be done // after the ctor, because of the potential calls to Window::Show. // Even after the fix for #104887# (Window::Show no longer notifies the access @@ -1924,7 +1917,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, if ( pOldSh && pOldSh->ISA( ScPreviewShell ) ) { ScPreviewShell* pPreviewShell = ((ScPreviewShell*)pOldSh); - aPendingUserData = pPreviewShell->GetSourceData(); // used in Activate nForceDesignMode = pPreviewShell->GetSourceDesignMode(); } -- cgit v1.2.3 From 03ee94167cc16990ee8809f3ebe30af27ba94570 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 14:59:07 +0200 Subject: dba33i: #i111146# migrated all SFX-based applications to use named views --- sfx2/inc/sfx2/viewsh.hxx | 11 ----------- sfx2/inc/viewfac.hxx | 5 ----- sfx2/source/doc/docfac.cxx | 15 +++++++++++++++ sfx2/source/view/viewfac.cxx | 14 -------------- 4 files changed, 15 insertions(+), 30 deletions(-) diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 34362500b690..ee8dfb1ca57c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -123,17 +123,6 @@ public: \ static SfxViewFactory&Factory() { return *pFactory; } \ static void InitFactory() -#define SFX_IMPL_VIEWFACTORY(Class, rResId) \ - SfxViewFactory* Class::pFactory; \ - SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ - { return new Class(pFrame, pOldView); } \ - void Class::RegisterFactory( USHORT nPrio ) \ - { \ - pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\ - InitFactory(); \ - } \ - void Class::InitFactory() - #define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ SfxViewFactory* Class::pFactory; \ SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index 0e6498b1f8a5..b0f0abdba3b3 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -45,8 +45,6 @@ typedef void (*SfxViewInit)(); class SFX2_DLLPUBLIC SfxViewFactory { public: - SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, - USHORT nOrdinal, const ResId& aDescrResId ); SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const sal_Char* asciiViewName ); ~SfxViewFactory(); @@ -54,8 +52,6 @@ public: SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); void InitFactory(); - String GetDescription() const - { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } /// returns a legacy view name. This is "view" with an appended ordinal/ID. @@ -72,7 +68,6 @@ private: SfxViewCtor fnCreate; SfxViewInit fnInit; USHORT nOrd; - ResId aDescription; const String m_sViewName; }; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 8f8a4a969740..4311559f94af 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory SfxViewFactory &rFactory ) { +#if OSL_DEBUG_LEVEL > 0 + { + const String sViewName( rFactory.GetAPIViewName() ); + for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i ) + { + if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) ) + continue; + ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" ); + sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US ); + sMessage += "'!"; + OSL_ENSURE( false, sMessage.GetBuffer() ); + break; + } + } +#endif sal_uInt16 nPos; for ( nPos = 0; nPos < pImpl->aViewFactoryArr.Count() && diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 5ef64a2a8b0d..f9469e8a9f88 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -30,7 +30,6 @@ // INCLUDE --------------------------------------------------------------- #include -#include "sfxresid.hxx" #include #include "viewfac.hxx" @@ -71,24 +70,11 @@ String SfxViewFactory::GetAPIViewName() const // CTOR / DTOR ----------------------------------------------------------- -SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, - USHORT nOrdinal, const ResId& aDescrResId ): - fnCreate(fnC), - fnInit(fnI), - nOrd(nOrdinal), - aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()), - m_sViewName() -{ - aDescription.SetRT(aDescrResId.GetRT()); - DBG_CTOR(SfxViewFactory, 0); -} - SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const sal_Char* asciiViewName ): fnCreate(fnC), fnInit(fnI), nOrd(nOrdinal), - aDescription( SfxResId( 0 ) ), m_sViewName( String::CreateFromAscii( asciiViewName ) ) { DBG_CTOR(SfxViewFactory, 0); -- cgit v1.2.3 From 28d8a1b19571f801277f9c98f818dda4158fbf2c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 14:59:07 +0200 Subject: dba33i: #i111146# migrated all SFX-based applications to use named views --- sd/inc/FactoryIds.hxx | 3 +-- sd/source/ui/app/strings.src | 4 ---- sd/source/ui/inc/strings.hrc | 1 - sd/source/ui/view/GraphicViewShellBase.cxx | 2 +- sd/source/ui/view/ImpressViewShellBase.cxx | 2 +- sd/source/ui/view/OutlineViewShellBase.cxx | 2 +- sd/source/ui/view/PresentationViewShellBase.cxx | 2 +- sd/source/ui/view/SlideSorterViewShellBase.cxx | 2 +- sd/source/ui/view/ViewShellBase.cxx | 2 +- 9 files changed, 7 insertions(+), 13 deletions(-) mode change 100644 => 100755 sd/inc/FactoryIds.hxx mode change 100644 => 100755 sd/source/ui/view/ImpressViewShellBase.cxx mode change 100644 => 100755 sd/source/ui/view/OutlineViewShellBase.cxx mode change 100644 => 100755 sd/source/ui/view/PresentationViewShellBase.cxx mode change 100644 => 100755 sd/source/ui/view/SlideSorterViewShellBase.cxx diff --git a/sd/inc/FactoryIds.hxx b/sd/inc/FactoryIds.hxx old mode 100644 new mode 100755 index 66477a1faf67..4f2346942fc9 --- a/sd/inc/FactoryIds.hxx +++ b/sd/inc/FactoryIds.hxx @@ -42,8 +42,7 @@ enum ViewShellFactoryIds DRAW_FACTORY_ID = 1, SLIDE_SORTER_FACTORY_ID = 2, OUTLINE_FACTORY_ID = 3, - PRESENTATION_FACTORY_ID = 4, - PREVIEW_FACTORY_ID = 5 + PRESENTATION_FACTORY_ID = 4 }; } // end of namespace sd diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src index e992e7016f04..bb1199fdd352 100755 --- a/sd/source/ui/app/strings.src +++ b/sd/source/ui/app/strings.src @@ -86,10 +86,6 @@ String RID_APPTITLE { Text = "StarImpress 4.0" ; }; -String STR_DEFAULTVIEW -{ - Text [ en-US ] = "Default" ; -}; String STR_NULL { Text [ en-US ] = "None" ; diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc index d9dc93a1ef20..7f5086057e5c 100755 --- a/sd/source/ui/inc/strings.hrc +++ b/sd/source/ui/inc/strings.hrc @@ -28,7 +28,6 @@ #ifndef _SD_CFGID_HXX #include "cfgids.hxx" #endif -#define STR_DEFAULTVIEW (RID_APP_START) #define STR_NULL (RID_APP_START+3) #define STR_INSERTPAGE (RID_APP_START+35) #define STR_INSERTLAYER (RID_APP_START+37) diff --git a/sd/source/ui/view/GraphicViewShellBase.cxx b/sd/source/ui/view/GraphicViewShellBase.cxx index 759103760bfe..99e45a0d05d6 100755 --- a/sd/source/ui/view/GraphicViewShellBase.cxx +++ b/sd/source/ui/view/GraphicViewShellBase.cxx @@ -62,7 +62,7 @@ SfxViewShell* __EXPORT GraphicViewShellBase::CreateInstance ( void GraphicViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"Default"); InitFactory(); } void GraphicViewShellBase::InitFactory() diff --git a/sd/source/ui/view/ImpressViewShellBase.cxx b/sd/source/ui/view/ImpressViewShellBase.cxx old mode 100644 new mode 100755 index 0cd5971eb51e..69906fbfd5d8 --- a/sd/source/ui/view/ImpressViewShellBase.cxx +++ b/sd/source/ui/view/ImpressViewShellBase.cxx @@ -62,7 +62,7 @@ SfxViewShell* __EXPORT ImpressViewShellBase::CreateInstance ( void ImpressViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"Default"); InitFactory(); } void ImpressViewShellBase::InitFactory() diff --git a/sd/source/ui/view/OutlineViewShellBase.cxx b/sd/source/ui/view/OutlineViewShellBase.cxx old mode 100644 new mode 100755 index 762219c88016..3c31155a9fb5 --- a/sd/source/ui/view/OutlineViewShellBase.cxx +++ b/sd/source/ui/view/OutlineViewShellBase.cxx @@ -60,7 +60,7 @@ SfxViewShell* __EXPORT OutlineViewShellBase::CreateInstance ( void OutlineViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"Outline"); InitFactory(); } void OutlineViewShellBase::InitFactory() diff --git a/sd/source/ui/view/PresentationViewShellBase.cxx b/sd/source/ui/view/PresentationViewShellBase.cxx old mode 100644 new mode 100755 index a16b12d3cb63..0fcb421a9888 --- a/sd/source/ui/view/PresentationViewShellBase.cxx +++ b/sd/source/ui/view/PresentationViewShellBase.cxx @@ -70,7 +70,7 @@ SfxViewShell* __EXPORT PresentationViewShellBase::CreateInstance ( void PresentationViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"FullScreenPresentation"); InitFactory(); } void PresentationViewShellBase::InitFactory() diff --git a/sd/source/ui/view/SlideSorterViewShellBase.cxx b/sd/source/ui/view/SlideSorterViewShellBase.cxx old mode 100644 new mode 100755 index 466f699b1bb0..7944d2cf4b2e --- a/sd/source/ui/view/SlideSorterViewShellBase.cxx +++ b/sd/source/ui/view/SlideSorterViewShellBase.cxx @@ -64,7 +64,7 @@ SfxViewShell* __EXPORT SlideSorterViewShellBase::CreateInstance ( void SlideSorterViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"SlideSorter"); InitFactory(); } diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 1e18ad5c5ee9..c748ffbc05e0 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -258,7 +258,7 @@ SfxViewShell* __EXPORT ViewShellBase::CreateInstance ( void ViewShellBase::RegisterFactory( USHORT nPrio ) { pFactory = new SfxViewFactory( - &CreateInstance,&InitFactory,nPrio,SdResId(STR_DEFAULTVIEW)); + &CreateInstance,&InitFactory,nPrio,"Default"); InitFactory(); } void ViewShellBase::InitFactory() -- cgit v1.2.3 From 435d8e1cd1854ce4bd4fbbe778c487675f809ee1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 14:59:07 +0200 Subject: dba33i: #i111146# migrated all SFX-based applications to use named views --- starmath/inc/starmath.hrc | 2 +- starmath/source/smres.src | 4 ---- starmath/source/view.cxx | 2 +- sw/source/ui/uiview/pview.cxx | 2 +- sw/source/ui/uiview/srcview.cxx | 2 +- sw/source/ui/uiview/view0.cxx | 2 +- sw/source/ui/web/wview.cxx | 2 +- 7 files changed, 6 insertions(+), 10 deletions(-) diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index d73ea27a0d45..8d156792e1d3 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -107,7 +107,7 @@ #define RID_READSYMBOLERROR (RID_APP_START + 203) #define RID_NOMATHTYPEFACEWARNING (RID_APP_START + 204) #define RID_OBJECTNAME (RID_APP_START + 501) -#define RID_VIEWNAME (RID_APP_START + 502) + // free #define RID_UNDOEDITNAME (RID_APP_START + 503) #define RID_UNDOFORMATNAME (RID_APP_START + 504) #define RID_APPICO (RID_APP_START + 601) diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 7d3525bd2a29..c35d77c9afcf 100755 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -1379,10 +1379,6 @@ String RID_OBJECTNAME { Text = "SMath3" ; }; -String RID_VIEWNAME -{ - Text = "StarMath" ; -}; String RID_UNDOEDITNAME { Text = "Edit" ; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 0087595703ca..3920c65e941c 100755 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -749,7 +749,7 @@ SFX_IMPL_INTERFACE(SmViewShell, SfxViewShell, SmResId(0)) } -SFX_IMPL_VIEWFACTORY(SmViewShell, SmResId(RID_VIEWNAME)) +SFX_IMPL_NAMED_VIEWFACTORY(SmViewShell, "Default") { SFX_VIEW_REGISTRATION(SmDocShell); } diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index d499add5ad53..27fe1a65641f 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -108,7 +108,7 @@ using namespace ::com::sun::star; -SFX_IMPL_VIEWFACTORY(SwPagePreView, SW_RES(STR_NONAME)) +SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreView, "PrintPreview") { SFX_VIEW_REGISTRATION(SwDocShell); SFX_VIEW_REGISTRATION(SwWebDocShell); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 801ecba22c73..667beb8ab4ca 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -125,7 +125,7 @@ using ::com::sun::star::util::SearchOptions; -SFX_IMPL_VIEWFACTORY(SwSrcView, SW_RES(STR_NONAME)) +SFX_IMPL_NAMED_VIEWFACTORY(SwSrcView, "SourceView") { SFX_VIEW_REGISTRATION(SwWebDocShell); } diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index 9d905a4c3443..93a29f699f5a 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -105,7 +105,7 @@ using ::rtl::OUString; #include -SFX_IMPL_VIEWFACTORY(SwView, SW_RES(STR_NONAME)) +SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default") { if ( SvtModuleOptions().IsWriter() ) { diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx index 9a55aaf94a28..1822ab2de4e8 100644 --- a/sw/source/ui/web/wview.cxx +++ b/sw/source/ui/web/wview.cxx @@ -93,7 +93,7 @@ #include -SFX_IMPL_VIEWFACTORY(SwWebView, SW_RES(STR_NONAME)) +SFX_IMPL_NAMED_VIEWFACTORY(SwWebView, "Default") { SFX_VIEW_REGISTRATION(SwWebDocShell); } -- cgit v1.2.3 From c2ac9c93bde6d0d555e97732fe8b20dde43aa1ed Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 14:59:07 +0200 Subject: dba33i: #i111146# migrated all SFX-based applications to use named views --- basctl/source/basicide/basidesh.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 2f9303756e09..55dec2566205 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -155,7 +155,7 @@ public: TYPEINIT1( BasicIDEShell, SfxViewShell ); -SFX_IMPL_VIEWFACTORY( BasicIDEShell, IDEResId( SVX_INTERFACE_BASIDE_VIEWSH ) ) +SFX_IMPL_NAMED_VIEWFACTORY( BasicIDEShell, "Default" ) { SFX_VIEW_REGISTRATION( BasicDocShell ); } -- cgit v1.2.3 From 1f01f13ddb5738edb341a00e66ec289d20faf47f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 15:13:11 +0200 Subject: dba33i: #i111146# SaveCurrentViewData_Impl: be less generous, only store the old view's data in the model if the new view is a print preview --- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/source/view/viewfrm.cxx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index a0f5eadd5148..affa836486e6 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -253,7 +253,7 @@ public: private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); - SAL_DLLPRIVATE void SaveCurrentViewData_Impl(); + SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const USHORT i_nNewViewId ); /** loads the given existing document into the given frame diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f1e6e45c5217..744a8e83568d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2246,24 +2246,28 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- -void SfxViewFrame::SaveCurrentViewData_Impl() +void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId ) { SfxViewShell* pCurrentShell = GetViewShell(); ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" ); // determine the logical (API) view name const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() ); - const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); - const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName(); - if ( sViewName.Len() == 0 ) + const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); + const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName(); + const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 ); + const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName(); + if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) ) { // can't say anything about the view, the respective application did not yet migrate its code to // named view factories => bail out + OSL_ENSURE( false, "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" ); return; } + OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" ); - // do *not* save view data when the view is a print preview - if ( sViewName.EqualsAscii( "PrintPreview" ) ) + // save the view data only when we're moving from a non-print-preview to the print-preview view + if ( !sNewViewName.EqualsAscii( "PrintPreview" ) ) return; // retrieve the view data from the view @@ -2371,7 +2375,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; // save the view data of the old view, so it can be restored later on (when needed) - SaveCurrentViewData_Impl(); + SaveCurrentViewData_Impl( nViewId ); // create and load new ViewShell SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( -- cgit v1.2.3 From a30673bb9d8324810f2e33d1e4e42966771ed08f Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 15:49:06 +0200 Subject: jl158: #i114088# required file missing --- xmlhelp/util/delzip | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 xmlhelp/util/delzip diff --git a/xmlhelp/util/delzip b/xmlhelp/util/delzip new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit v1.2.3 From 79431b1f2ac04cc55eeaaed0931bb1bd770356af Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 17:15:05 +0200 Subject: jl158: #i114008# move transformation files --- xmlhelp/util/embed.xsl | 83 ++++ xmlhelp/util/idxcaption.xsl | 34 ++ xmlhelp/util/idxcontent.xsl | 104 +++++ xmlhelp/util/main_transform.xsl | 972 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1193 insertions(+) create mode 100644 xmlhelp/util/embed.xsl create mode 100644 xmlhelp/util/idxcaption.xsl create mode 100644 xmlhelp/util/idxcontent.xsl create mode 100644 xmlhelp/util/main_transform.xsl diff --git a/xmlhelp/util/embed.xsl b/xmlhelp/util/embed.xsl new file mode 100644 index 000000000000..3a4e3ef80f61 --- /dev/null +++ b/xmlhelp/util/embed.xsl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/idxcaption.xsl b/xmlhelp/util/idxcaption.xsl new file mode 100644 index 000000000000..7570fa5c7870 --- /dev/null +++ b/xmlhelp/util/idxcaption.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/idxcontent.xsl b/xmlhelp/util/idxcontent.xsl new file mode 100644 index 000000000000..aa371d7f9255 --- /dev/null +++ b/xmlhelp/util/idxcontent.xsl @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl new file mode 100644 index 000000000000..d9b6c3229696 --- /dev/null +++ b/xmlhelp/util/main_transform.xsl @@ -0,0 +1,972 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
+
+ +
+
+
+
+ + + + +
    + + + + +
+
+ +
+
+
+
+ + + +
  • +
    + + +
  • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
    +
    + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    + + + + + + + +
    + + + +
    +

    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + +
    {$alt}
    +
    +
    + + + + + + + <h> + + + + + + + + + </h> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + +

    +
    + +

    + +

    +
    + +

    D'oh! You found a bug ( not found).

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$alt} + + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +
    + + + + +
    +
    + + + + +
    +
    +
    + +
    +
    + + +
    + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + [ not found]. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 3c224c60cc23cbd5d9c54f254f0ed5f20f995c7f Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 17:22:19 +0200 Subject: jl158: #i114008# add dependency on xmlhelp --- sdext/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdext/prj/build.lst b/sdext/prj/build.lst index c593a265f26e..3603afbae866 100644 --- a/sdext/prj/build.lst +++ b/sdext/prj/build.lst @@ -1,4 +1,4 @@ -dx sdext : l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg XPDF:xpdf LIBXSLT:libxslt NULL +dx sdext : l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg XPDF:xpdf LIBXSLT:libxslt xmlhelp NULL dx sdext usr1 - all sdext_mkout NULL dx sdext\prj get - all sdext_prj NULL dx sdext\source\minimizer nmake - all sdext_minimizer sdext_minimizer_rdoooe sdext_minimizer_rdooo sdext_inc NULL -- cgit v1.2.3 From ada49490ba4972243e4b1873f990f11b8bfb5afd Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 17:41:13 +0200 Subject: jl158: #i114008# deliver moved .zip --- xmlhelp/prj/d.lst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst index ec45189d3045..67fe323757bb 100644 --- a/xmlhelp/prj/d.lst +++ b/xmlhelp/prj/d.lst @@ -6,3 +6,5 @@ ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml ..\util\*.xsl %_DEST%\bin%_EXT%\*.* ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib +..\%__SRC%\bin\helpxsl.zip %_DEST%\pck%_EXT%\helpxsl.zip + -- cgit v1.2.3 From 892fc048a385eebb365a0bfc7172f334f5d0ab57 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 1 Sep 2010 17:53:25 +0200 Subject: calc59: #i114256# Don't move DataPilot fields to orientations that the source doesn't support --- sc/inc/dpobject.hxx | 4 ++- sc/inc/pivot.hxx | 1 + sc/inc/unonames.hxx | 1 + sc/source/core/data/dpobject.cxx | 35 +++++++++++++++++++++++- sc/source/core/data/dptabsrc.cxx | 6 +++++ sc/source/core/data/pivot2.cxx | 1 + sc/source/ui/dbgui/pvfundlg.cxx | 5 ++-- sc/source/ui/dbgui/pvlaydlg.cxx | 58 +++++++++++++++++++++++++++++++++++----- sc/source/ui/inc/pvlaydlg.hxx | 1 + sc/source/ui/view/gridwin2.cxx | 13 ++++++--- 10 files changed, 111 insertions(+), 14 deletions(-) mode change 100755 => 100644 sc/source/core/data/dptabsrc.cxx diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 44aa1daa9a92..e1b88919dad6 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -186,7 +186,7 @@ public: bool IsDataDescriptionCell(const ScAddress& rPos); bool IsDimNameInUse(const ::rtl::OUString& rName) const; - String GetDimName( long nDim, BOOL& rIsDataLayout ); + String GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags = NULL ); BOOL IsDuplicated( long nDim ); long GetDimCount(); void GetHeaderPositionData(const ScAddress& rPos, ::com::sun::star::sheet::DataPilotTableHeaderData& rData); @@ -259,6 +259,8 @@ public: PivotField* pRefColFields = NULL, SCSIZE nRefColCount = 0, PivotField* pRefRowFields = NULL, SCSIZE nRefRowCount = 0, PivotField* pRefPageFields = NULL, SCSIZE nRefPageCount = 0 ); + + static bool IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags ); }; diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index 915a311411c4..489f272bc8ba 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -141,6 +141,7 @@ struct ScDPLabelData SCsCOL mnCol; USHORT mnFuncMask; /// Page/Column/Row subtotal function. sal_Int32 mnUsedHier; /// Used hierarchy. + sal_Int32 mnFlags; /// Flags from the DataPilotSource dimension bool mbShowAll; /// true = Show all (also empty) results. bool mbIsValue; /// true = Sum or count in data field. diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 2d011f425398..1e56743d8129 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -565,6 +565,7 @@ #define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" #define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" #define SC_UNO_HAS_HIDDEN_MEMBER "HasHiddenMember" +#define SC_UNO_FLAGS "Flags" // (preliminary:) #define SC_UNO_REFVALUE "ReferenceValue" diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index e994339f4a9a..29ba9f15dc92 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -845,7 +846,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const return false; } -String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout ) +String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags ) { rIsDataLayout = FALSE; String aRet; @@ -879,6 +880,10 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout ) rIsDataLayout = TRUE; else aRet = String( aName ); + + if (pFlags) + *pFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp, + rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 ); } } } @@ -2003,6 +2008,8 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) GetHierarchies(nDim, pNewLabel->maHiers); GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers); lcl_FillLabelData(*pNewLabel, xDimProp); + pNewLabel->mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp, + rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 ); rParam.maLabelArray.push_back(pNewLabel); } } @@ -2231,6 +2238,32 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData, } } +// static +bool ScDPObject::IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags ) +{ + bool bAllowed = true; + switch (nOrient) + { + case sheet::DataPilotFieldOrientation_PAGE: + bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_PAGE_ORIENTATION ) == 0; + break; + case sheet::DataPilotFieldOrientation_COLUMN: + bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_COLUMN_ORIENTATION ) == 0; + break; + case sheet::DataPilotFieldOrientation_ROW: + bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_ROW_ORIENTATION ) == 0; + break; + case sheet::DataPilotFieldOrientation_DATA: + bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_DATA_ORIENTATION ) == 0; + break; + default: + { + // allowed to remove from previous orientation + } + } + return bAllowed; +} + // ----------------------------------------------------------------------- // static diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx old mode 100755 new mode 100644 index da40e6e230c4..b4ca5dbc7330 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1576,6 +1576,7 @@ uno::Reference SAL_CALL ScDPDimension::getPropertySetIn static SfxItemPropertyMapEntry aDPDimensionMap_Impl[] = { {MAP_CHAR_LEN(SC_UNO_FILTER), 0, &getCppuType((uno::Sequence*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_FLAGS), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 }, {MAP_CHAR_LEN(SC_UNO_FUNCTION), 0, &getCppuType((sheet::GeneralFunction*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_ISDATALA), 0, &getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0 }, {MAP_CHAR_LEN(SC_UNO_NUMBERFO), 0, &getCppuType((sal_Int32*)0), beans::PropertyAttribute::READONLY, 0 }, @@ -1753,6 +1754,11 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii(""); else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER)) aRet <<= mbHasHiddenMember; + else if (aNameStr.EqualsAscii(SC_UNO_FLAGS)) + { + sal_Int32 nFlags = 0; // tabular data: all orientations are possible + aRet <<= nFlags; + } else { DBG_ERROR("unknown property"); diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index 5a6174bc0129..ddac72f0230b 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -82,6 +82,7 @@ ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : mnCol( nCol ), mnFuncMask( PIVOT_FUNC_NONE ), mnUsedHier( 0 ), + mnFlags( 0 ), mbShowAll( false ), mbIsValue( bIsValue ) { diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 6b04993ba0bc..b5a19ef0ec9b 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -735,8 +735,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR for (long nDim=0; nDimGetExistingDimensionByName(aName) : 0; if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 1eca44a787ed..d73ede0d4947 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -567,7 +567,9 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po } } - if ( (toArr->back().get() == NULL) + bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType ); + if ( bAllowed + && (toArr->back().get() == NULL) && (!Contains( toArr, fData.mnCol, nAt )) ) { // ggF. in anderem Fenster entfernen @@ -714,7 +716,8 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF { ScDPFuncData fData( *((*fromArr)[nFromIndex]) ); - if ( Contains( fromArr, fData.mnCol, nAt ) ) + bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType ); + if ( bAllowed && Contains( fromArr, fData.mnCol, nAt ) ) { fromWnd->DelField( nAt ); Remove( fromArr, nAt ); @@ -935,21 +938,42 @@ PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt ) if ( bIsDrag ) { Point aPos = ScreenToOutputPixel( rAt ); + ScDPFieldType eCheckTarget = TYPE_SELECT; if ( aRectPage.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_PAGE ); + eCheckTarget = TYPE_PAGE; else if ( aRectCol.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_COL ); + eCheckTarget = TYPE_COL; else if ( aRectRow.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_ROW ); + eCheckTarget = TYPE_ROW; else if ( aRectData.IsInside( aPos ) ) - ePtr = lclGetPointerForField( TYPE_DATA ); + eCheckTarget = TYPE_DATA; else if ( eDnDFromType != TYPE_SELECT ) ePtr = POINTER_PIVOT_DELETE; else if ( aRectSelect.IsInside( aPos ) ) ePtr = lclGetPointerForField( TYPE_SELECT ); else ePtr = POINTER_NOTALLOWED; + + if ( eCheckTarget != TYPE_SELECT ) + { + // check if the target orientation is allowed for this field + bool bAllowed = true; + ScDPFuncDataVec* fromArr = NULL; + switch ( eDnDFromType ) + { + case TYPE_PAGE: fromArr = &aPageArr; break; + case TYPE_COL: fromArr = &aColArr; break; + case TYPE_ROW: fromArr = &aRowArr; break; + case TYPE_DATA: fromArr = &aDataArr; break; + case TYPE_SELECT: fromArr = &aSelectArr; break; + } + ScDPFuncData fData( *((*fromArr)[nDnDFromIndex]) ); + if (IsOrientationAllowed( fData.mnCol, eCheckTarget )) + ePtr = lclGetPointerForField( eCheckTarget ); + else + ePtr = POINTER_NOTALLOWED; + } } return ePtr; @@ -1218,6 +1242,28 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) return String(); } +//---------------------------------------------------------------------------- + +bool ScDPLayoutDlg::IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ) +{ + bool bAllowed = true; + ScDPLabelData* pData = GetLabelData( nCol ); + DBG_ASSERT( pData, "LabelData not found" ); + if (pData) + { + sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN; + switch (eType) + { + case TYPE_PAGE: eOrient = sheet::DataPilotFieldOrientation_PAGE; break; + case TYPE_COL: eOrient = sheet::DataPilotFieldOrientation_COLUMN; break; + case TYPE_ROW: eOrient = sheet::DataPilotFieldOrientation_ROW; break; + case TYPE_DATA: eOrient = sheet::DataPilotFieldOrientation_DATA; break; + case TYPE_SELECT: eOrient = sheet::DataPilotFieldOrientation_HIDDEN; break; + } + bAllowed = ScDPObject::IsOrientationAllowed( (USHORT)eOrient, pData->mnFlags ); + } + return bAllowed; +} //---------------------------------------------------------------------------- diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index c74b9e028d2f..e16c3266510e 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -198,6 +198,7 @@ private: Point DlgPos2WndPos ( const Point& rPt, Window& rWnd ); ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL ); String GetLabelString ( SCsCOL nCol ); + bool IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ); String GetFuncString ( USHORT& rFuncMask, BOOL bIsValue = TRUE ); BOOL Contains ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt ); void Remove ( ScDPFuncDataVec* pArr, size_t nAt ); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index a64814d952ef..ec584213898c 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -309,10 +309,17 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) aPosRect, nOrient, nDimPos ); UpdateDragRect( bHasRange && bMove, aPosRect ); + BOOL bIsDataLayout; + sal_Int32 nDimFlags = 0; + String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout, &nDimFlags ); + bool bAllowed = !bHasRange || ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ); + if (bMove) // set mouse pointer { PointerStyle ePointer = POINTER_PIVOT_DELETE; - if ( bHasRange ) + if ( !bAllowed ) + ePointer = POINTER_NOTALLOWED; + else if ( bHasRange ) switch (nOrient) { case sheet::DataPilotFieldOrientation_COLUMN: ePointer = POINTER_PIVOT_COL; break; @@ -327,15 +334,13 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) if (!bHasRange) nOrient = sheet::DataPilotFieldOrientation_HIDDEN; - BOOL bIsDataLayout; - String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout ); if ( bIsDataLayout && ( nOrient != sheet::DataPilotFieldOrientation_COLUMN && nOrient != sheet::DataPilotFieldOrientation_ROW ) ) { // removing data layout is not allowed pViewData->GetView()->ErrorMessage(STR_PIVOT_MOVENOTALLOWED); } - else + else if ( bAllowed ) { ScDPSaveData aSaveData( *pDragDPObj->GetSaveData() ); -- cgit v1.2.3 From 0720069a5eda395ca1709dc2e52546181f59f1ae Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 1 Sep 2010 17:53:25 +0200 Subject: calc59: #i114256# Don't move DataPilot fields to orientations that the source doesn't support --- .../sun/star/sheet/DataPilotSourceDimension.idl | 8 +++ offapi/com/sun/star/sheet/DimensionFlags.idl | 74 ++++++++++++++++++++++ offapi/com/sun/star/sheet/makefile.mk | 1 + 3 files changed, 83 insertions(+) create mode 100644 offapi/com/sun/star/sheet/DimensionFlags.idl diff --git a/offapi/com/sun/star/sheet/DataPilotSourceDimension.idl b/offapi/com/sun/star/sheet/DataPilotSourceDimension.idl index bb652252c33e..9f5961731a05 100644 --- a/offapi/com/sun/star/sheet/DataPilotSourceDimension.idl +++ b/offapi/com/sun/star/sheet/DataPilotSourceDimension.idl @@ -156,6 +156,14 @@ published service DataPilotSourceDimension */ [property] sequence< com::sun::star::sheet::TableFilterField > Filter; + //------------------------------------------------------------------------- + + /** contains flags that control the usage of the dimension. + + @see com::sun::star::sheet::DimensionFlags + */ + [readonly, property, optional] long Flags; + }; //============================================================================= diff --git a/offapi/com/sun/star/sheet/DimensionFlags.idl b/offapi/com/sun/star/sheet/DimensionFlags.idl new file mode 100644 index 000000000000..2edb2368e863 --- /dev/null +++ b/offapi/com/sun/star/sheet/DimensionFlags.idl @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sheet_DimensionFlags_idl__ +#define __com_sun_star_sheet_DimensionFlags_idl__ + +//============================================================================= + +module com { module sun { module star { module sheet { + +//============================================================================= + +/** used to specify flags for a dimension in a data pilot source. + + @see com::sun::star::sheet::DataPilotSourceDimension + */ +published constants DimensionFlags +{ + //------------------------------------------------------------------------- + + /** The dimension cannot be used in column orientation. + */ + const long NO_COLUMN_ORIENTATION = 1; + + //------------------------------------------------------------------------- + + /** The dimension cannot be used in row orientation. + */ + const long NO_ROW_ORIENTATION = 2; + + //------------------------------------------------------------------------- + + /** The dimension cannot be used in page orientation. + */ + const long NO_PAGE_ORIENTATION = 4; + + //------------------------------------------------------------------------- + + /** The dimension cannot be used in data orientation. + */ + const long NO_DATA_ORIENTATION = 8; + +}; + +//============================================================================= + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/sheet/makefile.mk b/offapi/com/sun/star/sheet/makefile.mk index 016378178f29..65e8d5c40491 100644 --- a/offapi/com/sun/star/sheet/makefile.mk +++ b/offapi/com/sun/star/sheet/makefile.mk @@ -122,6 +122,7 @@ IDLFILES=\ DatabaseRange.idl\ DatabaseRanges.idl\ DatabaseRangesEnumeration.idl\ + DimensionFlags.idl\ DocumentSettings.idl\ ExternalDocLink.idl\ ExternalDocLinks.idl\ -- cgit v1.2.3 From c87fa692ab3b94601d3556b0e81c396f7cadc40d Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 1 Sep 2010 18:30:27 +0200 Subject: calc59: compiler warning --- sc/source/ui/dbgui/pvlaydlg.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index d73ede0d4947..56d7e3550cda 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -958,7 +958,6 @@ PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt ) if ( eCheckTarget != TYPE_SELECT ) { // check if the target orientation is allowed for this field - bool bAllowed = true; ScDPFuncDataVec* fromArr = NULL; switch ( eDnDFromType ) { -- cgit v1.2.3 From 23eb90b58cd29c102d4e6f6e940933b04d9a87a7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 21:56:16 +0200 Subject: dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this --- svx/source/dialog/checklbx.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx index c54634017392..80096ce70f32 100644 --- a/svx/source/dialog/checklbx.cxx +++ b/svx/source/dialog/checklbx.cxx @@ -212,7 +212,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() ) { - Point aPnt = rMEvt.GetPosPixel(); + const Point aPnt = rMEvt.GetPosPixel(); SvLBoxEntry* pEntry = GetEntry( aPnt ); if ( pEntry ) @@ -230,6 +230,13 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt ) { ToggleCheckButton( pEntry ); SvTreeListBox::MouseButtonDown( rMEvt ); + + // check if the entry below the mouse changed during the base method call. This is possible if, + // for instance, a handler invoked by the base class tampers with the list entries. + const SvLBoxEntry* pNewEntry = GetEntry( aPnt ); + if ( pNewEntry != pEntry ) + return; + if ( bCheck != ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) ) CheckButtonHdl(); return; -- cgit v1.2.3 From 4833151f7dcfcf692dfd28eb796a0baf8782f285 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 21:56:16 +0200 Subject: dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this --- svtools/source/contnr/svimpbox.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 484584828b9f..35324d551858 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -2172,14 +2172,6 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); SetCursor( pEntry ); - DBG_ERROR( "Please report what you did to get this assertion to FS!" ); - // The entry which has been double-clicked changed - and we select it, again. - // I have situations where this behaviour does not make any sense at all - even more, it - // leads to hacks to revert it's results. - // So I'm not sure if this behaviour here is nonsense (which I believe at the moment), - // or if there are really scenarious where it dones make sense .... - // 07.12.2001 - 95727 - fs@openoffice.org - return; } if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() ) -- cgit v1.2.3 From 3c6b622a6cd10d937e9e5b17fd042a698bfbd00a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Sep 2010 07:15:38 +0200 Subject: dba33i: #i113506# when loading a sub component which is already open, return the existing component instead of NULL --- dbaccess/source/ui/app/AppController.cxx | 11 +++++++---- dbaccess/source/ui/app/subcomponentmanager.cxx | 10 +++++++++- dbaccess/source/ui/app/subcomponentmanager.hxx | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 1905193a4f04..9d659c26e707 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1347,7 +1347,9 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa InvalidateAll(); break; case SID_DB_APP_DSRELDESIGN: - if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN ) ) + { + Reference< XComponent > xRelationDesigner; + if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) ) { SharedConnection xConnection( ensureConnection() ); if ( xConnection.is() ) @@ -1359,7 +1361,8 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa onDocumentOpened( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); } } - break; + } + break; case SID_DB_APP_DSUSERADMIN: { SharedConnection xConnection( ensureConnection() ); @@ -1844,7 +1847,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_REPORT: case E_FORM: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { ::std::auto_ptr< OLinkedDocumentsAccess > aHelper = getDocumentsAccess( _eType ); if ( !aHelper->isConnected() ) @@ -1861,7 +1864,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_QUERY: case E_TABLE: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { SharedConnection xConnection( ensureConnection() ); if ( !xConnection.is() ) diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 56fbc30f46e7..9b56120c3ea0 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -529,7 +529,8 @@ namespace dbaui } //------------------------------------------------------------------------------------------------------------------ - bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, const ElementOpenMode _eOpenMode ) const + bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, + const ElementOpenMode _eOpenMode, Reference< XComponent >& o_rComponent ) const { ::osl::MutexGuard aGuard( m_pData->getMutex() ); @@ -546,6 +547,13 @@ namespace dbaui const Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW ); xTopWindow->toFront(); + if ( pos->xModel.is() ) + o_rComponent = pos->xModel.get(); + else if ( pos->xController.is() ) + o_rComponent = pos->xController.get(); + else + o_rComponent = pos->xFrame.get(); + return true; } diff --git a/dbaccess/source/ui/app/subcomponentmanager.hxx b/dbaccess/source/ui/app/subcomponentmanager.hxx index f7f93ab6a53b..72b0a548e533 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.hxx +++ b/dbaccess/source/ui/app/subcomponentmanager.hxx @@ -90,7 +90,8 @@ namespace dbaui bool activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, - const ElementOpenMode _eOpenMode + const ElementOpenMode _eOpenMode, + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rComponent ) const; /** closes all frames of the given component -- cgit v1.2.3 From ab46e29e1a993724a6000e82fd05514c2d34d115 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Sep 2010 12:25:23 +0200 Subject: dba33i: #i113684# proper termination condition when reading large strings --- connectivity/source/drivers/odbcbase/OTools.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx index 43de55e3505c..d598de8bc12d 100644 --- a/connectivity/source/drivers/odbcbase/OTools.cxx +++ b/connectivity/source/drivers/odbcbase/OTools.cxx @@ -578,7 +578,7 @@ Sequence OTools::getBytesValue(OConnection* _pConnection, // StarView zu lang ist oder der Treiber kann die Laenge der // Daten nicht im voraus bestimmen - also als MemoryStream // speichern. - while ((pcbValue == SQL_NO_TOTAL ) || pcbValue > nMaxLen) + while ((pcbValue == SQL_NO_TOTAL ) || nLen > nMaxLen) { // Bei Strings wird der Puffer nie ganz ausgenutzt // (das letzte Byte ist immer ein NULL-Byte, das -- cgit v1.2.3 From bfac8e3f220d826d3443d7a367794a3df778d549 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Sep 2010 12:25:31 +0200 Subject: dba33i: fix GCC warning --- sfx2/source/view/viewfrm.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 744a8e83568d..0e71a49e30de 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2285,8 +2285,8 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId ) const sal_Int32 nCount = xViewData->getCount(); for ( sal_Int32 i=0; igetByIndex(i) ); - ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) ); + ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); if ( sViewId.getLength() == 0 ) continue; -- cgit v1.2.3 From ce501a62a3530cbb0d5fc3abd2aa6d8fd6aaff31 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Thu, 2 Sep 2010 19:32:59 +0200 Subject: fwk156: #i113687# Add static cast to get string for CreateProcess function --- sal/osl/w32/signal.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx index f893f7520d40..a74baaefc057 100644 --- a/sal/osl/w32/signal.cxx +++ b/sal/osl/w32/signal.cxx @@ -188,7 +188,7 @@ static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP ) sntprintf( szBuffer, elementsof(szBuffer), _T("%s -p %u -excp 0x%p -t %u%s"), - aPath, + static_cast( aPath ), GetCurrentProcessId(), lpEP, GetCurrentThreadId(), -- cgit v1.2.3 From e54a8a83b7d404a8ff6f2572adab9c19131bc32f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 13:48:56 +0200 Subject: dba33i: #i113788# ensure the resource framework activates the TaskPane when the respective window is activated (might happen when triggered by SFX, bypassing the resource framework) --- sd/source/ui/dlg/PaneChildWindows.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index 181fc8433c22..f9f181b0e44d 100755 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -37,6 +37,9 @@ #include "strings.hrc" #include "sdresid.hxx" +#include +#include + #include #include #include @@ -47,6 +50,9 @@ namespace sd { using ::com::sun::star::uno::Reference; using ::com::sun::star::drawing::framework::XResourceId; +using ::com::sun::star::drawing::framework::XConfigurationController; +using ::com::sun::star::drawing::framework::ResourceActivationMode_ADD; +using ::com::sun::star::drawing::framework::ResourceActivationMode_REPLACE; SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) @@ -151,6 +157,26 @@ ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_ :PaneChildWindow( i_pParentWindow, i_nId, i_pBindings, i_pChildWindowInfo, FLT_TOOL_PANEL_DOCKING_WINDOW, STR_RIGHT_PANE_TITLE, SFX_ALIGN_RIGHT ) { + // just in case this window has been created by SFX, instead our resource framework: Ensure that the resource framework + // activates the task pane, so it is really filled with content (in opposite to the other SFX applications, the + // child window registered for SID_TASKPANE is not responsible for its content, but here in SD, it's the ToolPanelViewShell + // which has this responsibility. And this view shell is created implicitly via the resource framework.) + // #i113788# / 2010-09-03 / frank.schoenheit@oracle.com + SfxDockingWindow* pDockingWindow = dynamic_cast< SfxDockingWindow* >( GetWindow() ); + ViewShellBase* pViewShellBase = ViewShellBase::GetViewShellBase( pDockingWindow->GetBindings().GetDispatcher()->GetFrame() ); + ENSURE_OR_RETURN_VOID( pViewShellBase != NULL, "ToolPanelChildWindow::ToolPanelChildWindow: no view shell access!" ); + + const ::boost::shared_ptr< framework::FrameworkHelper > pFrameworkHelper( framework::FrameworkHelper::Instance( *pViewShellBase ) ); + ENSURE_OR_RETURN_VOID( pFrameworkHelper.get(), "ToolPanelChildWindow::ToolPanelChildWindow: no framework helper for the view shell!" ); + Reference xConfigController( pFrameworkHelper->GetConfigurationController() ); + ENSURE_OR_RETURN_VOID( xConfigController.is(), "ToolPanelChildWindow::ToolPanelChildWindow: no config controller!" ); + xConfigController->requestResourceActivation( + framework::FrameworkHelper::CreateResourceId( framework::FrameworkHelper::msRightPaneURL ), + ResourceActivationMode_ADD ); + xConfigController->requestResourceActivation( + framework::FrameworkHelper::CreateResourceId( framework::FrameworkHelper::msTaskPaneURL, framework::FrameworkHelper::msRightPaneURL ), + ResourceActivationMode_REPLACE + ); } //---------------------------------------------------------------------------------------------------------------------- -- cgit v1.2.3 From 90d786057bd04ca075462b0d099f0d2f62ec446f Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Fri, 3 Sep 2010 14:12:57 +0200 Subject: jl158: #i114008# make sure index directory is empty --- solenv/inc/extension_helplink.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solenv/inc/extension_helplink.mk b/solenv/inc/extension_helplink.mk index 0a7521842d08..907a1e06d0d9 100644 --- a/solenv/inc/extension_helplink.mk +++ b/solenv/inc/extension_helplink.mk @@ -66,6 +66,8 @@ $(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/$$(@:b:s/_/./ $(COMMAND_ECHO)$(HELPLINKER) -mod $(LINKNAME) -extlangsrc $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} $(STY_SWITCH) -extlangdest $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -idxcaption $(XSL_DIR)/idxcaption.xsl -idxcontent $(XSL_DIR)/idxcontent.xsl $(LINKLINKFILES) $(COMMAND_ECHO)cd $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && zip -u -r $(LINKNAME).jar $(PACKAGE)/* $(CHECKZIPRESULT) .IF "$(SOLAR_JAVA)" == "TRUE" +# cleanup index dir + -$(RM) $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))}/$(LINKNAME).idxl/* .IF "$(CHECK_LUCENCE_INDEXER_OUTPUT)" == "" $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && $(TOUCH) $@ .ELSE -- cgit v1.2.3 From 6a8fd4c76a969ac98d1aff91ff7442f43aee0006 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 17:26:50 +0200 Subject: dba33i: #163542# VCLXWindow::OnProcessCallbacks: process window events while attempting to re-acquire the solar mutex - this prevents deadlocks with other threads trying to SendMessage into the main thread --- toolkit/inc/toolkit/helper/solarrelease.hxx | 27 ++++++++++++++++++++++++--- toolkit/source/awt/vclxwindow.cxx | 3 ++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/toolkit/inc/toolkit/helper/solarrelease.hxx b/toolkit/inc/toolkit/helper/solarrelease.hxx index d8938b41c220..e45a1b6ee2c3 100644 --- a/toolkit/inc/toolkit/helper/solarrelease.hxx +++ b/toolkit/inc/toolkit/helper/solarrelease.hxx @@ -41,15 +41,36 @@ namespace toolkit class ReleaseSolarMutex { sal_uInt32 mnLockCount; + const bool mbRescheduleDuringAcquire; + public: - ReleaseSolarMutex() + enum { - mnLockCount = Application::ReleaseSolarMutex(); + RescheduleDuringAcquire = true + }; + + public: + ReleaseSolarMutex( const bool i_rescheduleDuringAcquire = false ) + :mnLockCount( Application::ReleaseSolarMutex() ) + ,mbRescheduleDuringAcquire( i_rescheduleDuringAcquire ) + { + } ~ReleaseSolarMutex() { - Application::AcquireSolarMutex( mnLockCount ); + if ( mnLockCount > 0 ) + { + if ( mbRescheduleDuringAcquire ) + { + while ( !Application::GetSolarMutex().tryToAcquire() ) + { + Application::Reschedule(); + } + --mnLockCount; + } + Application::AcquireSolarMutex( mnLockCount ); + } } }; diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index efc2c40c6baa..1022d78a43ed 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -92,6 +92,7 @@ using ::com::sun::star::style::VerticalAlignment_MAKE_FIXED_SIZE; namespace WritingMode2 = ::com::sun::star::text::WritingMode2; namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior; +using ::toolkit::ReleaseSolarMutex; //==================================================================== //= misc helpers @@ -339,7 +340,7 @@ IMPL_LINK( VCLXWindowImpl, OnProcessCallbacks, void*, EMPTYARG ) } { - ::toolkit::ReleaseSolarMutex aReleaseSolar; + ReleaseSolarMutex aReleaseSolar( ReleaseSolarMutex::RescheduleDuringAcquire ); for ( CallbackArray::const_iterator loop = aCallbacksCopy.begin(); loop != aCallbacksCopy.end(); ++loop -- cgit v1.2.3 From fb9145fb3023e44292d89f9f14c6028e1fe54e23 Mon Sep 17 00:00:00 2001 From: "Marc Neumann [msc]" Date: Mon, 6 Sep 2010 09:09:40 +0200 Subject: dba33h: #114249# fix testscript to work better --- testautomation/dbaccess/optional/includes/rpt_Formating.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testautomation/dbaccess/optional/includes/rpt_Formating.inc b/testautomation/dbaccess/optional/includes/rpt_Formating.inc index e2671728b168..4bde542bd176 100755 --- a/testautomation/dbaccess/optional/includes/rpt_Formating.inc +++ b/testautomation/dbaccess/optional/includes/rpt_Formating.inc @@ -62,9 +62,9 @@ testcase tConditionalFormating sleep(1) Kontext "ReportDesign" - ReportDesign.MouseDown ( 30, 50 ) - ReportDesign.MouseMove ( 40, 60 ) - ReportDesign.MouseUp ( 40, 60 ) + ReportDesign.MouseDown ( 30, 40 ) + ReportDesign.MouseMove ( 40, 50 ) + ReportDesign.MouseUp ( 40, 50 ) sleep(1) '/// open the conditional formating dialog via the menu @@ -129,9 +129,9 @@ testcase tGrowAndShrink sleep(1) Kontext "ReportDesign" - ReportDesign.MouseDown ( 30, 50 ) - ReportDesign.MouseMove ( 40, 60 ) - ReportDesign.MouseUp ( 40, 60 ) + ReportDesign.MouseDown ( 30, 40 ) + ReportDesign.MouseMove ( 40, 50 ) + ReportDesign.MouseUp ( 40, 50 ) sleep(1) '/// open the conditional formating dialog via the menu -- cgit v1.2.3 From da76e1e348c547976d2e1d0a3cdf4fa55dc7a9da Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Mon, 6 Sep 2010 12:21:00 +0200 Subject: fwk156: #114339# selection listener fixed --- svtools/inc/svtools/table/tabledatawindow.hxx | 1 - svtools/source/table/tabledatawindow.cxx | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index 9a6ece489119..829feecd5836 100644 --- a/svtools/inc/svtools/table/tabledatawindow.hxx +++ b/svtools/inc/svtools/table/tabledatawindow.hxx @@ -55,7 +55,6 @@ namespace svt { namespace table Link m_aMouseButtonDownHdl; Link m_aMouseButtonUpHdl; Link m_aSelectHdl; - RowPos m_nRowAlreadySelected; public: TableDataWindow( TableControl_Impl& _rTableControl ); inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; } diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index e2e1ce5353fe..bbd7f6829369 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -45,7 +45,6 @@ namespace svt { namespace table TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl ) :Window( &_rTableControl.getAntiImpl() ) ,m_rTableControl ( _rTableControl ) - ,m_nRowAlreadySelected( -1 ) { // by default, use the background as determined by the style settings const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() ); @@ -110,15 +109,17 @@ namespace svt { namespace table { Point aPoint = rMEvt.GetPosPixel(); RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint); + std::vector selectedRows(m_rTableControl.getSelectedRows()); if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) ) Window::MouseButtonDown( rMEvt ); else { if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION) { - if( m_nRowAlreadySelected != nCurRow ) + bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end(); + + if( !found ) { - m_nRowAlreadySelected = nCurRow; m_aSelectHdl.Call( NULL ); } } -- cgit v1.2.3 From 6ed6fc0f4f2609a738d531de1545a8571bec56fc Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Mon, 6 Sep 2010 12:21:55 +0200 Subject: fwk156: #114340# keyboard navigation fixed --- svtools/source/table/defaultinputhandler.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index ad8f7a7562d3..f6a58ad17efe 100644 --- a/svtools/source/table/defaultinputhandler.cxx +++ b/svtools/source/table/defaultinputhandler.cxx @@ -173,6 +173,7 @@ namespace svt { namespace table if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) ) { bHandled = _rControl.dispatchAction( pActions->eAction ); + bHandled = true; // always handled issue #i114340 break; } } -- cgit v1.2.3 From 7636e21b2396dca05b6e4d52814451103f3adfba Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 6 Sep 2010 17:25:36 +0200 Subject: impress199: #i114275# unbranding presentation minimizer extension --- solenv/inc/extension_post.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solenv/inc/extension_post.mk b/solenv/inc/extension_post.mk index 47b62d20dd12..f221ff7ebe4a 100644 --- a/solenv/inc/extension_post.mk +++ b/solenv/inc/extension_post.mk @@ -39,7 +39,11 @@ fixme4=$(fixme:n) $(EXTENSIONDIR)/$(COMPONENT_CONFIGDEST)/%.xcu : %.xcu # ugly hacking to workaround prepended first source path @@-$(MKDIRHIER) $(subst,$(fixme2),$(MISC) $(@:d)) +.IF "$(COMPONENT_XCU_REPLACEMENT)"!="" + $(TYPE) $< | sed '$(COMPONENT_XCU_REPLACEMENT)' > $(subst,$(fixme2),$(MISC) $@) +.ELSE # "$(COMPONENT_REPLACEMENT)"!="" $(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@) +.ENDIF # "$(COMPONENT_REPLACEMENT)"!="" $(EXTENSIONDIR)/$(COMPONENT_CONFIGDESTSCHEMA)/%.xcs : %.xcs @@-$(MKDIRHIER) $(subst,$(fixme4),$(MISC) $(@:d)) -- cgit v1.2.3 From 818f46505d4d4d23a37e7cb492b0e34b11afd44e Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 6 Sep 2010 17:25:36 +0200 Subject: impress199: #i114275# unbranding presentation minimizer extension --- sdext/prj/d.lst | 1 + sdext/source/minimizer/aboutdialog.cxx | 276 --------------------- sdext/source/minimizer/aboutdialog.hxx | 91 ------- sdext/source/minimizer/informationdialog.cxx | 7 +- sdext/source/minimizer/makefile.mk | 15 +- sdext/source/minimizer/pppoptimizerdialog.cxx | 6 - sdext/source/minimizer/pppoptimizertoken.cxx | 3 - sdext/source/minimizer/pppoptimizertoken.hxx | 3 - .../Office/extension/SunPresentationMinimizer.xcu | 26 +- .../Office/extension/SunPresentationMinimizer.xcs | 24 +- 10 files changed, 29 insertions(+), 423 deletions(-) delete mode 100644 sdext/source/minimizer/aboutdialog.cxx delete mode 100644 sdext/source/minimizer/aboutdialog.hxx diff --git a/sdext/prj/d.lst b/sdext/prj/d.lst index 71a91653c3d2..54cefac1dfa3 100644 --- a/sdext/prj/d.lst +++ b/sdext/prj/d.lst @@ -5,4 +5,5 @@ mkdir: %_DEST%\bin%_EXT%\pdfimport ..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.* ..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt ..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\presentation-minimizer.oxt +..\%__SRC%\bin\presentation_minimizer_develop.zip %_DEST%\bin%_EXT%\minimizer\presentation_minimizer_develop.zip ..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter\presenter-screen.oxt diff --git a/sdext/source/minimizer/aboutdialog.cxx b/sdext/source/minimizer/aboutdialog.cxx deleted file mode 100644 index f495da9994ea..000000000000 --- a/sdext/source/minimizer/aboutdialog.cxx +++ /dev/null @@ -1,276 +0,0 @@ - /************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sdext.hxx" - -#include "aboutdialog.hxx" -#include "optimizationstats.hxx" -#include "fileopendialog.hxx" -#include - -// --------------- -// - ABOUTDIALOG - -// --------------- - -using namespace ::rtl; -using namespace ::com::sun::star::ui; -using namespace ::com::sun::star::awt; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::util; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::script; -using namespace ::com::sun::star::container; - -#define ABOUT_DIALOG_WIDTH 200 -#define ABOUT_DIALOG_HEIGHT 155 - -// ----------------------------------------------------------------------------- - - -rtl::OUString InsertFixedText( AboutDialog& rAboutDialog, const rtl::OUString& rControlName, const OUString& rLabel, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Int16 nTabIndex ) -{ - OUString pNames[] = { - TKGet( TK_Height ), - TKGet( TK_Label ), - TKGet( TK_MultiLine ), - TKGet( TK_PositionX ), - TKGet( TK_PositionY ), - TKGet( TK_Step ), - TKGet( TK_TabIndex ), - TKGet( TK_Width ) }; - - Any pValues[] = { - Any( nHeight ), - Any( rLabel ), - Any( bMultiLine ), - Any( nXPos ), - Any( nYPos ), - Any( (sal_Int16)0 ), - Any( nTabIndex ), - Any( nWidth ) }; - - sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); - - Sequence< rtl::OUString > aNames( pNames, nCount ); - Sequence< Any > aValues( pValues, nCount ); - - rAboutDialog.insertFixedText( rControlName, aNames, aValues ); - return rControlName; -} - -#if 0 -rtl::OUString InsertSeparator( AboutDialog& rAboutDialog, const OUString& rControlName, sal_Int32 nOrientation, - sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight ) -{ - OUString pNames[] = { - TKGet( TK_Height ), - TKGet( TK_Orientation ), - TKGet( TK_PositionX ), - TKGet( TK_PositionY ), - TKGet( TK_Step ), - TKGet( TK_Width ) }; - - Any pValues[] = { - Any( nHeight ), - Any( nOrientation ), - Any( nPosX ), - Any( nPosY ), - Any( sal_Int16( 0 ) ), - Any( nWidth ) }; - - sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); - - Sequence< rtl::OUString > aNames( pNames, nCount ); - Sequence< Any > aValues( pValues, nCount ); - - rAboutDialog.insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ), - rControlName, aNames, aValues ); - return rControlName; -} - -#endif - -rtl::OUString InsertImage( AboutDialog& rAboutDialog, const OUString& rControlName, const OUString& rURL, - sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight ) -{ - OUString pNames[] = { - TKGet( TK_Border ), - TKGet( TK_Height ), - TKGet( TK_ImageURL ), - TKGet( TK_PositionX ), - TKGet( TK_PositionY ), - TKGet( TK_ScaleImage ), - TKGet( TK_Width ) }; - - Any pValues[] = { - Any( sal_Int16( 1 ) ), - Any( nHeight ), - Any( rURL ), - Any( nPosX ), - Any( nPosY ), - Any( sal_False ), - Any( nWidth ) }; - sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); - - Sequence< rtl::OUString > aNames( pNames, nCount ); - Sequence< Any > aValues( pValues, nCount ); - - rAboutDialog.insertImage( rControlName, aNames, aValues ); - return rControlName; -} - -rtl::OUString InsertButton( AboutDialog& rAboutDialog, const OUString& rControlName, Reference< XActionListener >& xActionListener, - sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex, PPPOptimizerTokenEnum nResID ) -{ - OUString pNames[] = { - TKGet( TK_Enabled ), - TKGet( TK_Height ), - TKGet( TK_Label ), - TKGet( TK_PositionX ), - TKGet( TK_PositionY ), - TKGet( TK_PushButtonType ), - TKGet( TK_Step ), - TKGet( TK_TabIndex ), - TKGet( TK_Width ) }; - - Any pValues[] = { - Any( sal_True ), - Any( nHeight ), - Any( rAboutDialog.getString( nResID ) ), - Any( nXPos ), - Any( nYPos ), - Any( static_cast< sal_Int16 >( PushButtonType_OK ) ), - Any( (sal_Int16)0 ), - Any( nTabIndex ), - Any( nWidth ) }; - - - sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); - - Sequence< rtl::OUString > aNames( pNames, nCount ); - Sequence< Any > aValues( pValues, nCount ); - - rAboutDialog.insertButton( rControlName, xActionListener, aNames, aValues ); - return rControlName; -} - -void AboutDialog::InitDialog() -{ - // setting the dialog properties - OUString pNames[] = { - rtl::OUString::createFromAscii( "BackgroundColor" ) , - TKGet( TK_Closeable ), - TKGet( TK_Height ), - TKGet( TK_Moveable ), - TKGet( TK_PositionX ), - TKGet( TK_PositionY ), - TKGet( TK_Title ), - TKGet( TK_Width ) }; - - Any pValues[] = { - Any( sal_Int32( 0xffffff ) ), - Any( sal_True ), - Any( sal_Int32( ABOUT_DIALOG_HEIGHT ) ), - Any( sal_True ), - Any( sal_Int32( 113 ) ), - Any( sal_Int32( 42 ) ), - Any( getString( STR_ABOUT_VERSION2 ) ), - Any( sal_Int32( ABOUT_DIALOG_WIDTH ) ) }; - - sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); - - Sequence< rtl::OUString > aNames( pNames, nCount ); - Sequence< Any > aValues( pValues, nCount ); - - rtl::OUString sBitmapPath( getPath( TK_BitmapPath ) ); - rtl::OUString sBitmap( rtl::OUString::createFromAscii( "/aboutlogo.png" ) ); - rtl::OUString sURL( sBitmapPath += sBitmap ); - - mxDialogModelMultiPropertySet->setPropertyValues( aNames, aValues ); - sal_Int32 nWidth = getMapsFromPixels( 387 ); - if ( nWidth ) - mxDialogModelPropertySet->setPropertyValue( TKGet( TK_Width ), Any( nWidth ) ); - else - nWidth = ABOUT_DIALOG_WIDTH; - -// int nHeight = (int) getMapsFromPixels( 95 ); - - InsertImage( *this, rtl::OUString( rtl::OUString::createFromAscii( "aboutimage" ) ), sURL, 0, 0, nWidth, 60 ); - InsertFixedText( *this, rtl::OUString( rtl::OUString::createFromAscii( "fixedtext" ) ), getString( STR_ABOUT_PRN ), 9, 66, nWidth - 18, 50, sal_True, 0 ); -// InsertSeparator( *this, rtl::OUString( rtl::OUString::createFromAscii( "separator" ) ), 0, 0, ABOUT_DIALOG_HEIGHT - 25, nWidth, 8 ); - InsertButton( *this, rtl::OUString( rtl::OUString::createFromAscii( "button" ) ), mxActionListener, ( nWidth / 2 ) - 25, 120, 50, 14, 1, STR_OK ); -} - -// ----------------------------------------------------------------------------- - -AboutDialog::AboutDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame ) : - UnoDialog( rxMSF, rxFrame ), - ConfigurationAccess( rxMSF, NULL ), - mxMSF( rxMSF ), - mxFrame( rxFrame ), - mxActionListener( new AboutActionListener( *this ) ) -{ - Reference< XFrame > xFrame( mxController->getFrame() ); - Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() ); - Reference< XWindowPeer > xWindowPeer( xContainerWindow, UNO_QUERY_THROW ); - createWindowPeer( xWindowPeer ); - - InitDialog(); -} - -// ----------------------------------------------------------------------------- - -AboutDialog::~AboutDialog() -{ -} - -// ----------------------------------------------------------------------------- - -sal_Bool AboutDialog::execute() -{ - UnoDialog::execute(); - return mbStatus; -} - -// ----------------------------------------------------------------------------- - -void AboutActionListener::actionPerformed( const ActionEvent& rEvent ) - throw ( com::sun::star::uno::RuntimeException ) -{ - if ( rEvent.ActionCommand == rtl::OUString( rtl::OUString::createFromAscii( "button" ) ) ) - { - mrAboutDialog.endExecute( sal_True ); - } -} -void AboutActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ ) - throw ( com::sun::star::uno::RuntimeException ) -{ -} diff --git a/sdext/source/minimizer/aboutdialog.hxx b/sdext/source/minimizer/aboutdialog.hxx deleted file mode 100644 index 3bc402fb2543..000000000000 --- a/sdext/source/minimizer/aboutdialog.hxx +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ABOUTDIALOG_HXX -#define ABOUTDIALOG_HXX -#include -#include "unodialog.hxx" -#include "configurationaccess.hxx" -#include "pppoptimizertoken.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DIALOG_WIDTH 310 -#define DIALOG_HEIGHT 210 -#define BUTTON_WIDTH 50 -#define BUTTON_HEIGHT 14 - -// ------------------- -// - OPTIMIZERDIALOG - -// ------------------- -class AboutDialog : public UnoDialog, public ConfigurationAccess -{ -public : - - AboutDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame ); - ~AboutDialog(); - - sal_Bool execute(); - -private : - com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF; - com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame; - com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListener; - - void InitDialog(); - -public : - - com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; }; - const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; }; -}; - -class AboutActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener > -{ -public: - AboutActionListener( AboutDialog& rAboutDialog ) : mrAboutDialog( rAboutDialog ){}; - - virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException); -private: - - AboutDialog& mrAboutDialog; -}; - -#endif // ABOUTDIALOG_HXX diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx index 3c4dbf69895d..089c81f55a6a 100644 --- a/sdext/source/minimizer/informationdialog.cxx +++ b/sdext/source/minimizer/informationdialog.cxx @@ -265,7 +265,7 @@ void InformationDialog::InitDialog() Any( sal_True ), Any( sal_Int32( 245 ) ), Any( sal_Int32( 115 ) ), - Any( getString( STR_ABOUT2 ) ), + Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ), Any( sal_Int32( DIALOG_WIDTH ) ) }; sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString ); @@ -321,7 +321,6 @@ void InformationDialog::InitDialog() const OUString aOldSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%OLDFILESIZE" ) ); const OUString aNewSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%NEWFILESIZE" ) ); const OUString aTitlePlaceholder( aTitle.getLength() ? OUString::createFromAscii( "%TITLE" ) : OUString::createFromAscii( "'%TITLE'" ) ); - const OUString aExtensionPlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%EXTENSIONNAME" ) ); sal_Int32 i = aInfoString.indexOf( aOldSizePlaceholder, 0 ); if ( i >= 0 ) @@ -335,10 +334,6 @@ void InformationDialog::InitDialog() if ( k >= 0 ) aInfoString = aInfoString.replaceAt( k, aTitlePlaceholder.getLength(), aTitle ); - sal_Int32 l = aInfoString.indexOf( aExtensionPlaceholder, 0 ); - if ( l >= 0 ) - aInfoString = aInfoString.replaceAt( l, aExtensionPlaceholder.getLength(), getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ); - com::sun::star::uno::Reference< com::sun::star::awt::XItemListener > xItemListener; InsertImage( *this, rtl::OUString( rtl::OUString::createFromAscii( "aboutimage" ) ), ImpGetStandardImage( rtl::OUString::createFromAscii( "private:standardimage/query" ) ), 5, 5, 25, 25 ); InsertFixedText( *this, rtl::OUString( rtl::OUString::createFromAscii( "fixedtext" ) ), aInfoString, PAGE_POS_X, 6, PAGE_WIDTH, 24, sal_True, 0 ); diff --git a/sdext/source/minimizer/makefile.mk b/sdext/source/minimizer/makefile.mk index 8a3a385fc8f2..969a0cb1f248 100755 --- a/sdext/source/minimizer/makefile.mk +++ b/sdext/source/minimizer/makefile.mk @@ -61,7 +61,6 @@ SLOFILES= $(SLO)$/unodialog.obj \ $(SLO)$/pppoptimizerdialog.obj \ $(SLO)$/fileopendialog.obj \ $(SLO)$/optimizationstats.obj \ - $(SLO)$/aboutdialog.obj \ $(SLO)$/graphiccollector.obj \ $(SLO)$/pagecollector.obj \ $(SLO)$/informationdialog.obj @@ -81,6 +80,8 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1RPATH= OXT DEF1NAME= $(SHL1TARGET) +COMPONENT_XCU_REPLACEMENT=s/@MINIMIZEREXTENSIONPRODUCTNAME@/Presentation Minimizer/g + COMPONENT_MERGED_XCU= \ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/ProtocolHandler.xcu \ @@ -115,6 +116,18 @@ COMPONENT_HELP= \ # make sure to add your custom files here EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP) +ZIP2TARGET= presentation_minimizer_develop +.IF "$(WITH_LANG)"!="" +ZIP2DIR= $(MISC)/$(EXTENSIONNAME)_in/merge +.ELSE # "$(WITH_LANG)"!="" +ZIP2DIR= registry/data +.ENDIF # "$(WITH_LANG)"!="" +ZIP2EXT= .zip +ZIP2FLAGS=-r +ZIP2LIST= \ + org/openoffice/Office/Addons.xcu \ + org/openoffice/Office/extension/*.xcu + # --- Targets ---------------------------------- .INCLUDE : extension_pre.mk diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 854d4d9cebcd..b56f82b10543 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -30,7 +30,6 @@ #include "pppoptimizerdialog.hxx" #include "optimizerdialog.hxx" -#include "aboutdialog.hxx" using namespace ::rtl; using namespace ::com::sun::star::uno; @@ -175,11 +174,6 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, if ( mpOptimizerDialog ) mpOptimizerDialog->UpdateStatus( rArguments ); } - else if ( rURL.Path.compareToAscii( "about" ) == 0 ) - { - AboutDialog aAboutDialog( mxMSF, mxFrame ); - aAboutDialog.execute(); - } } } diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx b/sdext/source/minimizer/pppoptimizertoken.cxx index b36078ea2af4..e44116c02bf8 100644 --- a/sdext/source/minimizer/pppoptimizertoken.cxx +++ b/sdext/source/minimizer/pppoptimizertoken.cxx @@ -286,9 +286,6 @@ static const TokenTable pTokenTableArray[] = { "STR_DEFAULT_SESSION", STR_DEFAULT_SESSION }, { "STR_MODIFY_WARNING", STR_MODIFY_WARNING }, { "STR_YES", STR_YES }, - { "STR_ABOUT2", STR_ABOUT2 }, - { "STR_ABOUT_VERSION2", STR_ABOUT_VERSION2 }, - { "STR_ABOUT_PRN", STR_ABOUT_PRN }, { "STR_OK", STR_OK }, { "STR_INFO_1", STR_INFO_1 }, { "STR_INFO_2", STR_INFO_2 }, diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx b/sdext/source/minimizer/pppoptimizertoken.hxx index 9f544dd1a5bf..553a771c05f3 100644 --- a/sdext/source/minimizer/pppoptimizertoken.hxx +++ b/sdext/source/minimizer/pppoptimizertoken.hxx @@ -262,9 +262,6 @@ enum PPPOptimizerTokenEnum STR_DEFAULT_SESSION, STR_MODIFY_WARNING, STR_YES, - STR_ABOUT2, - STR_ABOUT_VERSION2, - STR_ABOUT_PRN, STR_OK, STR_INFO_1, STR_INFO_2, diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu b/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu index 251818079fe5..08324953d32c 100644 --- a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu +++ b/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu @@ -11,7 +11,7 @@ - Oracle Presentation Minimizer + @MINIMIZEREXTENSIONPRODUCTNAME@ Steps @@ -35,12 +35,12 @@ Introduction - The Oracle Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. + The @MINIMIZEREXTENSIONPRODUCTNAME@ is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation. - ~Choose settings for Oracle Presentation Minimizer + ~Choose settings for @MINIMIZEREXTENSIONPRODUCTNAME@ ~Delete @@ -181,32 +181,20 @@ The current presentation contains no OLE objects. ~Yes - - Oracle Presentation Minimizer - - - About Oracle Presentation Minimizer 1.0.2 - - - Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved. - -This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html - - OK - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. + The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. + The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. + The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. + The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. Duplicating presentation... diff --git a/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs b/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs index 59c947750064..f121768e0e72 100644 --- a/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs +++ b/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs @@ -106,7 +106,7 @@ - Oracle Presentation Minimizer + Presentation Minimizer Steps @@ -130,7 +130,7 @@ Introduction - The Oracle Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. + The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed. At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation. @@ -279,32 +279,20 @@ The current presentation contains no OLE objects. ~Yes - - Oracle Presentation Minimizer - - - About Oracle Presentation Minimizer 1.0.2 - - - Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved. - -This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html/value> - - OK - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. + The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. + The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. + The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB. - The %EXTENSIONNAME has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. + The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB. Duplicating presentation... -- cgit v1.2.3 From 01cec2c62e5a0dae80762396bf89a122dc62f172 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 7 Sep 2010 10:46:05 +0200 Subject: obo50: #i114363# Don't create *.pyc files on solver --- l10ntools/prj/build.lst | 3 ++- l10ntools/prj/d.lst | 16 +++++++----- l10ntools/scripts/makefile.mk | 59 +++++++++++++++++++++++++++++++++++++++++++ l10ntools/scripts/xhtex | 8 ------ l10ntools/scripts/xtxex | 8 ------ 5 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 l10ntools/scripts/makefile.mk diff --git a/l10ntools/prj/build.lst b/l10ntools/prj/build.lst index 8387154897b3..d8a2e8c00649 100644 --- a/l10ntools/prj/build.lst +++ b/l10ntools/prj/build.lst @@ -1,6 +1,7 @@ -tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL +tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene PYTHON:python NULL tr l10ntools usr1 - all tr_mkout NULL tr l10ntools\inc nmake - all tr_inc NULL +tr l10ntools\scripts nmake - all tr_scripts NULL tr l10ntools\source nmake - all tr_src tr_inc NULL tr l10ntools\layout nmake - all rt_layout tr_src tr_inc NULL tr l10ntools\java\jpropex nmake - all tr_blah NULL diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 53c846832fca..9d493e1e9673 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -47,14 +47,18 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help ..\scripts\localize %_DEST%\bin%_EXT%\localize ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl -..\scripts\tool\const.py %_DEST%\bin%_EXT%\const.py -..\scripts\tool\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py -..\scripts\tool\xtxex.py %_DEST%\bin%_EXT%\xtxex.py -..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py -..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py -..\scripts\tool\pseudo.py %_DEST%\bin%_EXT%\pseudo.py ..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex ..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex +..\%__SRC%\bin\const.py %_DEST%\bin%_EXT%\const.py +..\%__SRC%\bin\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py +..\%__SRC%\bin\pseudo.py %_DEST%\bin%_EXT%\pseudo.py +..\%__SRC%\bin\sdf.py %_DEST%\bin%_EXT%\sdf.py +..\%__SRC%\bin\const.pyc %_DEST%\bin%_EXT%\const.pyc +..\%__SRC%\bin\l10ntool.pyc %_DEST%\bin%_EXT%\l10ntool.pyc +..\%__SRC%\bin\pseudo.pyc %_DEST%\bin%_EXT%\pseudo.pyc +..\%__SRC%\bin\sdf.pyc %_DEST%\bin%_EXT%\sdf.pyc +..\%__SRC%\bin\xhtex.py %_DEST%\bin%_EXT%\xhtex.py +..\%__SRC%\bin\xtxex.py %_DEST%\bin%_EXT%\xtxex.py ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx diff --git a/l10ntools/scripts/makefile.mk b/l10ntools/scripts/makefile.mk new file mode 100644 index 000000000000..8bfa64e3fbad --- /dev/null +++ b/l10ntools/scripts/makefile.mk @@ -0,0 +1,59 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# Copy *.py files into output tree and call a script once to +# force python to create the *.pyc files. + +PRJ=.. +TARGET = l10ntools_dummy_pyc + +.INCLUDE: settings.mk + +.IF "$(SYSTEM_PYTHON)"!="YES" +PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python +.ELSE # "$(SYSTEM_PYTHON)"!="YES" +PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python +.ENDIF # "$(SYSTEM_PYTHON)"!="YES" + +PYFILES = $(BIN)$/const.py \ + $(BIN)$/l10ntool.py \ + $(BIN)$/pseudo.py \ + $(BIN)$/sdf.py \ + $(BIN)$/xhtex.py \ + $(BIN)$/xtxex.py + +.INCLUDE: target.mk + +.IGNORE : create_pyc +ALLTAR : create_pyc +create_pyc : $(PYFILES) + @$(PYTHON) $(BIN)/xtxex.py >& /dev/null + +$(BIN)$/%.py : tool/%.py + @$(COPY) $< $@ + + diff --git a/l10ntools/scripts/xhtex b/l10ntools/scripts/xhtex index ca307cf2d4a4..d337694c589b 100755 --- a/l10ntools/scripts/xhtex +++ b/l10ntools/scripts/xhtex @@ -31,16 +31,8 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -if [ ${GUI} = "WNT" ]; then if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xhtex.py "$@" else exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" fi -else -if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python -B $SOLARVERSION/$INPATH/bin/xhtex.py "$@" -else - exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@" -fi -fi diff --git a/l10ntools/scripts/xtxex b/l10ntools/scripts/xtxex index fb54c1aee36c..01a70ae57d80 100755 --- a/l10ntools/scripts/xtxex +++ b/l10ntools/scripts/xtxex @@ -31,17 +31,9 @@ if [ x${SOLARENV}x = xx ]; then exit 1 fi -if [ ${GUI} = "WNT" ]; then if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec python $SOLARVERSION/$INPATH/bin/xtxex.py "$@" else exec python $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" fi -else -if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then - exec python -B $SOLARVERSION/$INPATH/bin/xtxex.py "$@" -else - exec python -B $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@" -fi -fi -- cgit v1.2.3 From 663798e24e8bfd1d0194002a675a24d8eda271c2 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 7 Sep 2010 17:50:32 +0200 Subject: #i113922# added code to transform the LineWidth on MetaFile creation with the current transformation --- drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index dc954de7bb2a..0d2be85f9872 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1206,7 +1206,12 @@ namespace drawinglayer mpOutputDevice->SetLineColor(Color(aHairlineColor)); mpOutputDevice->SetFillColor(); aHairLinePolyPolygon.transform(maCurrentTransformation); - LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); + + // #i113922# LineWidth needs to be transformed, too + const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 0.0)); + const double fDiscreteLineWidth(aDiscreteUnit.getLength()); + + LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth)); aLineInfo.SetLineJoin(rLine.getLineJoin()); for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++) -- cgit v1.2.3 From 74729cf12e63d837a7bdad16ae0089973635d7fc Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 7 Sep 2010 19:18:26 +0200 Subject: #i10000# open file mode r+ -> r --- l10ntools/scripts/tool/xhtex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py index c427a7feccdd..ae973aacc555 100644 --- a/l10ntools/scripts/tool/xhtex.py +++ b/l10ntools/scripts/tool/xhtex.py @@ -108,7 +108,7 @@ class Xhtex(AbstractL10nTool): def parse_file(self, filename): document = "" try: - f = open(filename,"r+") + f = open(filename,"r") document = f.read() except IOError: print "ERROR: Can not read file " + filename -- cgit v1.2.3 From 27b897b0f609985ff717452295692d03b0ce1703 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 8 Sep 2010 10:38:58 +0200 Subject: #i114069# update DejaVu fonts to version 2.32 --- ooo.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ooo.lst b/ooo.lst index 9f51cf668a73..f49780f8e708 100755 --- a/ooo.lst +++ b/ooo.lst @@ -69,7 +69,7 @@ fb7ba5c2182be4e73748859967455455-README_stax-api-1.0-2-sources.txt fca8706f2c4619e2fa3f8f42f8fc1e9d-rasqal-0.9.16.tar.gz fcc6df1160753d0b8c835d17fdeeb0a7-boost_1_39_0.tar.gz fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz -fe5b3e2b7c4577f30dc001054365653e-dejavu-fonts-ttf-2.30.zip +37282537d0ed1a087b1c8f050dc812d9-dejavu-fonts-ttf-2.32.zip 831126a1ee5af269923cfab6050769fe-mysql-connector-cpp.zip 067201ea8b126597670b5eff72e1f66c-mythes-1.2.0.tar.gz cf8a6967f7de535ae257fa411c98eb88-mdds_0.3.0.tar.bz2 -- cgit v1.2.3 From c278878263b9c7b10f8c51ea7b97f088873df929 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 8 Sep 2010 10:38:58 +0200 Subject: #i114069# update DejaVu fonts to version 2.32 --- more_fonts/fonts/ttf_dejavu/makefile.mk | 6 +++--- more_fonts/prj/d.lst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/more_fonts/fonts/ttf_dejavu/makefile.mk b/more_fonts/fonts/ttf_dejavu/makefile.mk index f9fa78a7664b..090661bbde02 100644 --- a/more_fonts/fonts/ttf_dejavu/makefile.mk +++ b/more_fonts/fonts/ttf_dejavu/makefile.mk @@ -36,9 +36,9 @@ TARGET=ttf_dejavu # --- Files -------------------------------------------------------- -TARFILE_NAME=dejavu-fonts-ttf-2.30 -TARFILE_MD5=fe5b3e2b7c4577f30dc001054365653e -TARFILE_ROOTDIR=dejavu-fonts-ttf-2.30 +TARFILE_NAME=dejavu-fonts-ttf-2.32 +TARFILE_MD5=37282537d0ed1a087b1c8f050dc812d9 +TARFILE_ROOTDIR=dejavu-fonts-ttf-2.32 PATCH_FILES= diff --git a/more_fonts/prj/d.lst b/more_fonts/prj/d.lst index 261aae0b2d28..6dba097941ac 100644 --- a/more_fonts/prj/d.lst +++ b/more_fonts/prj/d.lst @@ -1,8 +1,8 @@ mkdir: %COMMON_DEST%\pck%_EXT% ..\fonts\fc_local.conf %COMMON_DEST%\pck%_EXT%\fc_local.conf # TODO: replace explicit versions by wildcard when the build system learns to handle them -..\%__SRC%\misc\build\dejavu-fonts-ttf-2.30\ttf\*.ttf %COMMON_DEST%\pck%_EXT%\*.ttf -..\%__SRC%\misc\build\dejavu-fonts-ttf-2.30\LICENSE %COMMON_DEST%\pck%_EXT%\LICENSE_dejavu +..\%__SRC%\misc\build\dejavu-fonts-ttf-2.32\ttf\*.ttf %COMMON_DEST%\pck%_EXT%\*.ttf +..\%__SRC%\misc\build\dejavu-fonts-ttf-2.32\LICENSE %COMMON_DEST%\pck%_EXT%\LICENSE_dejavu ..\%__SRC%\misc\build\liberation-fonts-ttf-1.06.0.20100721/Liberation*.ttf %COMMON_DEST%\pck%_EXT%\*.ttf ..\%__SRC%\misc\build\liberation-fonts-ttf-1.06.0.20100721/License.txt %COMMON_DEST%\pck%_EXT%\LICENSE_liberation ..\%__SRC%\misc\build\gentiumbasic-fonts-1.10\*.ttf %COMMON_DEST%\pck%_EXT%\*.ttf -- cgit v1.2.3 From 361766edb994aa0abe9ee9af2f28cf28416b0f1b Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Wed, 8 Sep 2010 11:21:23 +0200 Subject: #i114245# fix debug warnings in CTL glyph fallback --- vcl/win/source/gdi/winlayout.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 806d3b420b33..bc80cbf94fb8 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2203,7 +2203,9 @@ void UniscribeLayout::Simplify( bool /*bIsBase*/ ) const int k = mpGlyphs2Chars[ i ]; mpGlyphs2Chars[ j ] = k; const int nRelGlyphPos = (j++) - rVI.mnMinGlyphPos; - mpLogClusters[ k ] = static_cast(nRelGlyphPos); + if( k < 0) // extra glyphs are already mapped + continue; + mpLogClusters[ k ] = static_cast(nRelGlyphPos); } rVI.mnEndGlyphPos = j; -- cgit v1.2.3 From 9ec25654f39e2b3a3b90b811fde6949fe379ffcd Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 10 Sep 2010 17:05:00 +0200 Subject: jl158 #i114008# sed problem on solaris fixed --- sdext/source/presenter/makefile.mk | 2 +- swext/mediawiki/help/makefile.mk | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index eacc4c726725..687ac514ca57 100755 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -305,7 +305,7 @@ $(ZIP1DIR)$/help$/component.txt : help$/$$(@:f) $(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : $(COMMONMISC)/%/com.sun.PresenterScreen/presenter.xhp @echo creating $@ @@-$(MKDIRHIER) $(@:d) - $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/ ; s/@PRESENTEREXTENSIONPRODUCTNAME@/Presenter Console/g " > $@ + $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/" | sed 's/@PRESENTEREXTENSIONPRODUCTNAME@/Presenter Console/g' > $@ $(ZIP1TARGETN) : $(HELPLINKALLTARGETS) diff --git a/swext/mediawiki/help/makefile.mk b/swext/mediawiki/help/makefile.mk index 72608a80de0b..86773dcb7f3f 100644 --- a/swext/mediawiki/help/makefile.mk +++ b/swext/mediawiki/help/makefile.mk @@ -79,7 +79,9 @@ $(OUT_MEDIAWIKI)/help/component.txt : component.txt $(OUT_MEDIAWIKI)/help/%.xhp : $(OUT_MEDIAWIKI)_merge/help/%.xhp @@-$(MKDIRHIER) $(@:d) - $(COMMAND_ECHO)cat $< | sed -e 's/@WIKIEXTENSIONPRODUCTNAME@/Wiki Publisher/g ; s/@WIKIEXTENSIONID@/com.sun.wiki-publisher/g ; s/@WIKIEXTENSIONFILENAME@/wiki-publisher/g' > $@ + $(COMMAND_ECHO)cat $< | sed -e 's/@WIKIEXTENSIONPRODUCTNAME@/Wiki Publisher/g' | \ + sed 's/@WIKIEXTENSIONID@/com.sun.wiki-publisher/g' | \ + sed 's/@WIKIEXTENSIONFILENAME@/wiki-publisher/g' > $@ .ENDIF # "$(ENABLE_MEDIAWIKI)" != "YES" -- cgit v1.2.3 From c62011c83f5a00417e7510b7688dd5b0450cc4ee Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 10 Sep 2010 17:05:00 +0200 Subject: jl158 #i114008# sed problem on solaris fixed --- sw/source/ui/lingu/olmenu.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 0c7d7909ad7a..281e3ce3fabb 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -823,7 +823,7 @@ void SwSpellPopup::Execute( USHORT nId ) else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) { OUString aWord( xSpellAlt->getWord() ); - DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" ); +// DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" ); PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC); String aDicName ( pMenu->GetItemText(nId) ); -- cgit v1.2.3 From 6df4618d8da9293858b91be5fa3a9f461a3ad0f6 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Tue, 14 Sep 2010 13:56:30 +0200 Subject: OOO330 --- solenv/inc/minor.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index d769c5bed779..20070cddbd8a 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=330 -RSCREVISION=330m7(Build:9526) -BUILD=9526 -LAST_MINOR=m7 +RSCREVISION=330m8(Build:9527) +BUILD=9527 +LAST_MINOR=m8 SOURCEVERSION=OOO330 -- cgit v1.2.3 From ec1697300cdc7310200af902fae2e3d7de0ff879 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 15 Sep 2010 10:27:11 +0200 Subject: masterfix OOO330: #i10000# build problem (extensions help) --- solenv/inc/extension_helplink.mk | 8 ++++---- solenv/inc/tg_help.mk | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/solenv/inc/extension_helplink.mk b/solenv/inc/extension_helplink.mk index 907a1e06d0d9..e375696bda18 100644 --- a/solenv/inc/extension_helplink.mk +++ b/solenv/inc/extension_helplink.mk @@ -56,10 +56,10 @@ XSL_DIR*:=$(SOLARBINDIR) XHPLINKSRC*:=$(XHPDEST) STY_SWITCH:= -sty $(XSL_DIR)/embed.xsl -.IF "$(XHPFILES)"!="" -$(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/{$(aux_alllangiso)}/$i) : $(COMMONMISC)/$(TARGET).done -LINKDEPS+=$(COMMONMISC)/xhp_changed.flag -.ENDIF # "$(XHPFILES)"!="" +.IF "$(XHPFILES)"!="" && "$(HELP_OUT)"!="" +$(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/{$(aux_alllangiso)}/$i) : $(HELP_OUT)/$(TARGET).done +LINKDEPS+=$(HELP_OUT)/xhp_changed.flag +.ENDIF # "$(XHPFILES)"!="" && "$(HELP_OUT)"!="" $(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/$$(@:b:s/_/./:e:s/.//)/$i) $(subst,LANGUAGE,$$(@:b:s/_/./:e:s/.//) $(LINKDEPS)) @echo Building help index for $(@:b:s/_/./:e:s/.//) diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk index b665f2f4aff8..cce5b9ee62b2 100644 --- a/solenv/inc/tg_help.mk +++ b/solenv/inc/tg_help.mk @@ -31,11 +31,17 @@ aux_alllangiso*:=$(alllangiso) SHELL_PACKAGE:=$(subst,/,$/ $(PACKAGE)) + +.IF "$(XHPDEST)"=="" XHPDEST*:=$(COMMONMISC) +HELP_OUT:=$(COMMONMISC) +.ELSE # "$(XHPDEST)"=="" +HELP_OUT:=$(MISC) +.ENDIF # "$(XHPDEST)"=="" HLANGXHPFILES*:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(XHPDEST)$/$j$/$(SHELL_PACKAGE)$/$(i:f))) -ALLTAR : $(COMMONMISC)$/$(TARGET).done $(COMMONMISC)$/xhp_changed.flag optix +ALLTAR : $(HELP_OUT)$/$(TARGET).done $(HELP_OUT)$/xhp_changed.flag optix $(HLANGXHPFILES) : $$(@:d)thisdir.created @@ -45,7 +51,7 @@ $(XHPDEST)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp # @$(NULL) -$(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES) +$(HELP_OUT)$/$(TARGET).done : $(HLANGXHPFILES) .IF "$(WITH_LANG)"!="" $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(XHPDEST) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@ .ELSE # "$(WITH_LANG)"!="" @@ -57,24 +63,24 @@ $(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES) @$(ECHONL) .ENDIF # "$(OS)"=="SOLARIS" -$(COMMONMISC)$/xhp_changed.flag : $(HLANGXHPFILES) +$(HELP_OUT)$/xhp_changed.flag : $(HLANGXHPFILES) @$(TOUCH) $@ # urks - dmake mixes up operators and strings :-( .IF "$(HLANGXHPFILES:s/defined/xxx/)"!="" .IF "$(HELPTRANSPHONY)"!="" -$(COMMONMISC)$/$(TARGET).done .PHONY : +$(HELP_OUT)$/$(TARGET).done .PHONY : .ELSE # "$(HELPTRANSPHONY)"!="" -$(COMMONMISC)$/$(TARGET).done : makefile.mk +$(HELP_OUT)$/$(TARGET).done : makefile.mk .IF "$(WITH_LANG)"!="" -$(COMMONMISC)$/$(TARGET).done : $(LOCALIZESDF) +$(HELP_OUT)$/$(TARGET).done : $(LOCALIZESDF) .ENDIF # "$(WITH_LANG)"!="" .ENDIF # "$(HELPTRANSPHONY)"!="" .ENDIF # "$(HLANGXHPFILES)"!="" -optix: $(COMMONMISC)$/$(TARGET).done +optix: $(HELP_OUT)$/$(TARGET).done @echo done %.created : -- cgit v1.2.3 From 1c802c77f98ff4b10235f4c098710b038cd94f13 Mon Sep 17 00:00:00 2001 From: Release Engineering Date: Wed, 15 Sep 2010 10:37:55 +0200 Subject: masterfix OOO330: #i114513# change exec permissions --- odk/setsdkenv_unix | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 odk/setsdkenv_unix diff --git a/odk/setsdkenv_unix b/odk/setsdkenv_unix old mode 100644 new mode 100755 -- cgit v1.2.3 From bdab146f1c8d8a873fdddff203a6b2ef29022eaf Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 15 Sep 2010 15:40:28 +0200 Subject: masterfix OOO330: #i10000# store lid in gid --- l10ntools/java/jpropex/java/JPropEx.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java index ceeeb5083982..f068f93ad18b 100644 --- a/l10ntools/java/jpropex/java/JPropEx.java +++ b/l10ntools/java/jpropex/java/JPropEx.java @@ -126,8 +126,8 @@ public class JPropEx { key = (String) e.nextElement(); currentStr = (SdfEntity) dolly.clone(); - // Set the new LID and the string text - currentStr.setLid( key ); + // Set the new GID and the string text + currentStr.setGid( key ); value = prop.getProperty( key , "" ); //if( value.equals("") ) System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!"); str = (prop.getProperty( key )).replaceAll("\t" , " " ); // remove tab @@ -211,7 +211,7 @@ public class JPropEx key = (String) e.nextElement(); sourceString = sourceProp.getProperty( key ); curStr = (SdfEntity) dolly.clone(); - curStr.setLid( key ); + curStr.setGid( key ); for( Enumeration lang = langs.elements(); lang.hasMoreElements(); ) // merge in every language { curEntity = (SdfEntity) curStr.clone(); @@ -221,12 +221,12 @@ public class JPropEx if( mergedEntity == null ) { // in case there is no translation then fallback to the en-US source string - ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getLid() , sourceString ); + ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getGid() , sourceString ); } else { // Set the merged text from the sdf file - ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getLid() , mergedEntity.getText() ); // TODO: Quoting ??? + ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getGid() , mergedEntity.getText() ); // TODO: Quoting ??? } } -- cgit v1.2.3 From d918e2ac6c40c8da857ab3de5a703b3ad786a82c Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 16 Sep 2010 12:33:53 +0200 Subject: masterfix OOO330: #i10000# build problem with cygwin shell (Windows) --- sdext/source/presenter/makefile.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index 687ac514ca57..a26cf54b3694 100755 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -302,9 +302,9 @@ $(ZIP1DIR)$/help$/component.txt : help$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ -$(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : $(COMMONMISC)/%/com.sun.PresenterScreen/presenter.xhp +$(ZIP1DIR)/help/%/com.sun.PresenterScreen-$(PLATFORMID)/presenter.xhp : $(COMMONMISC)/%/com.sun.PresenterScreen/presenter.xhp @echo creating $@ - @@-$(MKDIRHIER) $(@:d) + @-$(MKDIRHIER) $(@:d) $(TYPE) $< | sed "s/PLATFORMID/$(PLATFORMID)/" | sed 's/@PRESENTEREXTENSIONPRODUCTNAME@/Presenter Console/g' > $@ $(ZIP1TARGETN) : $(HELPLINKALLTARGETS) @@ -390,7 +390,7 @@ DESCRIPTION_TMP:=$(ZIP1DIR)$/description.xml.tmp PHONYDESC=.PHONY .ENDIF # "$(LAST_WITH_LANG)"!="$(WITH_LANG)" $(DESCRIPTION) $(PHONYDESC) : $$(@:f) - @@-$(MKDIRHIER) $(@:d) + @-$(MKDIRHIER) $(@:d) $(PERL) $(SOLARENV)$/bin$/licinserter.pl description.xml registry/LICENSE_xxx $(DESCRIPTION_TMP) @echo LAST_WITH_LANG=$(WITH_LANG) > $(ZIP1DIR)_lang_track.mk $(TYPE) $(DESCRIPTION_TMP) | sed s/UPDATED_PLATFORM/$(PLATFORMID)/ > $@ -- cgit v1.2.3 From 1bf218731b864f73403a2cf653d8fd231f6e392f Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 16 Sep 2010 12:34:53 +0200 Subject: masterfix OOO330: #i10000# build problem with cygwin shell (Windows) --- swext/mediawiki/help/makefile.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swext/mediawiki/help/makefile.mk b/swext/mediawiki/help/makefile.mk index 86773dcb7f3f..1804ec2b668a 100644 --- a/swext/mediawiki/help/makefile.mk +++ b/swext/mediawiki/help/makefile.mk @@ -74,11 +74,11 @@ HLANGXHPFILES=$(foreach,i,$(XHPFILES) $(foreach,j,$(MEDIAWIKI_LANG) $(XHPDEST)$/ ALLTAR : $(OUT_MEDIAWIKI)/help/component.txt $(OUT_MEDIAWIKI)/help/component.txt : component.txt - @@-$(MKDIRHIER) $(@:d) + @-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)$(COPY) component.txt $@ $(OUT_MEDIAWIKI)/help/%.xhp : $(OUT_MEDIAWIKI)_merge/help/%.xhp - @@-$(MKDIRHIER) $(@:d) + @-$(MKDIRHIER) $(@:d) $(COMMAND_ECHO)cat $< | sed -e 's/@WIKIEXTENSIONPRODUCTNAME@/Wiki Publisher/g' | \ sed 's/@WIKIEXTENSIONID@/com.sun.wiki-publisher/g' | \ sed 's/@WIKIEXTENSIONFILENAME@/wiki-publisher/g' > $@ -- cgit v1.2.3