diff options
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 3 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 1 | ||||
-rw-r--r-- | oox/source/xls/externallinkbuffer.cxx | 13 | ||||
-rwxr-xr-x | oox/source/xls/formulabase.cxx | 2 | ||||
-rw-r--r-- | oox/source/xls/numberformatsbuffer.cxx | 8 | ||||
-rw-r--r-- | oox/source/xls/stylesbuffer.cxx | 46 | ||||
-rw-r--r-- | oox/source/xls/worksheethelper.cxx | 5 |
7 files changed, 47 insertions, 31 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index d108eb06aff8..b16c49c975fc 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -181,9 +181,6 @@ void Shape::addShape( if ( xShapes.is() ) addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); } - Reference< document::XActionLockable > xLockable( mxShape, UNO_QUERY ); - if( xLockable.is() ) - xLockable->removeActionLock(); } catch( const Exception& ) { diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 553af0d723f8..c4b4a4c34853 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -478,6 +478,7 @@ VerticalSplitMode VerticalSplitPositionTwips ViewBox Visible +VisibleFlag VisibleSize VisualArea VisualEffect diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index aa4d7a068530..23177d09cf1d 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -681,10 +681,19 @@ ExternalLinkInfo ExternalLink::getLinkInfo() const ExternalLinkInfo aLinkInfo; switch( meLinkType ) { + case LINKTYPE_SELF: + case LINKTYPE_SAME: + case LINKTYPE_INTERNAL: + aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::SELF; + break; case LINKTYPE_EXTERNAL: aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::DOCUMENT; aLinkInfo.Data <<= maTargetUrl; break; + case LINKTYPE_LIBRARY: + // parser will return library function names in OPCODE_BAD string tokens + aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::SPECIAL; + break; case LINKTYPE_DDE: { aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::DDE; @@ -1041,8 +1050,8 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm ) Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const { ::std::vector< ExternalLinkInfo > aLinkInfos; - // should not be used for BIFF12 documents - OSL_ENSURE( (getFilterType() == FILTER_OOXML) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" ); + // XML formula parser also used in BIFF12 documents, e.g. replacement formulas in unsupported conditional formattings + OSL_ENSURE( getFilterType() == FILTER_OOXML, "ExternalLinkBuffer::getLinkInfos - unexpected file format" ); // add entry for implicit index 0 (self reference to this document) aLinkInfos.push_back( mxSelfRef->getLinkInfo() ); for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt ) diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index 25398f9aa133..366e4a0dbde7 100755 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -1283,7 +1283,7 @@ bool OpCodeProviderImpl::initFuncOpCodes( const ApiTokenMap& rIntFuncTokenMap, c // set API opcode from ODF function name bIsValid &= initFuncOpCode( *xFuncInfo, xFuncInfo->mbExternal ? rExtFuncTokenMap : rIntFuncTokenMap ); // insert the function info into the maps - if( xFuncInfo->mnApiOpCode != OPCODE_NONAME ) + if( (xFuncInfo->mnApiOpCode != OPCODE_NONAME) && (xFuncInfo->mnApiOpCode != OPCODE_BAD) ) { if( (xFuncInfo->mnApiOpCode == OPCODE_EXTERNAL) && (xFuncInfo->maExtProgName.getLength() > 0) ) maExtProgFuncs[ xFuncInfo->maExtProgName ] = xFuncInfo; diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index 782c138d43e2..8484b28326b1 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -1851,14 +1851,16 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, catch( Exception& ) { // BIFF2-BIFF4 stores standard format explicitly in stream - static const OUString saGeneral = CREATE_OUSTRING( "general" ); - if( rFmtCode.equalsIgnoreAsciiCase( saGeneral ) ) + if( rFmtCode.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "general" ) ) ) { nIndex = lclCreatePredefinedFormat( rxNumFmts, 0, rToLocale ); } else { - OSL_ENSURE( false, + // do not assert fractional number formats with fixed denominator + OSL_ENSURE( rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?/" ) ) || + rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?/" ) ) || + rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?\?/" ) ), OStringBuffer( "lclCreateFormat - cannot create number format '" ). append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). append( '\'' ).getStr() ); diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index eddb5463be4e..53216c4d4890 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -2712,9 +2712,9 @@ const sal_Char* const sppcStyleNames[] = "Followed Hyperlink", "Note", // new in OOX "Warning Text", - "", - "", - "", + 0, + 0, + 0, "Title", "Heading 1", "Heading 2", @@ -2762,7 +2762,7 @@ OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, const OUString& rName, sa OSL_ENSURE( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount), "lclGetBuiltinStyleName - unknown built-in style" ); OUStringBuffer aStyleName; aStyleName.appendAscii( spcStyleNamePrefix ); - if( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount) && (sppcStyleNames[ nBuiltinId ][ 0 ] != 0) ) + if( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount) && (sppcStyleNames[ nBuiltinId ] != 0) ) aStyleName.appendAscii( sppcStyleNames[ nBuiltinId ] ); else if( rName.getLength() > 0 ) aStyleName.append( rName ); @@ -2773,11 +2773,9 @@ OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, const OUString& rName, sa return aStyleName.makeStringAndClear(); } -OUString lclGetBuiltInStyleName( const OUString& rName ) +OUString lclCreateStyleName( const CellStyleModel& rModel ) { - OUStringBuffer aStyleName; - aStyleName.appendAscii( spcStyleNamePrefix ).append( rName ); - return aStyleName.makeStringAndClear(); + return rModel.mbBuiltin ? lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel ) : rModel.maName; } bool lclIsBuiltinStyleName( const OUString& rStyleName, sal_Int32* pnBuiltinId, sal_Int32* pnNextChar ) @@ -2792,12 +2790,15 @@ bool lclIsBuiltinStyleName( const OUString& rStyleName, sal_Int32* pnBuiltinId, OUString aShortName; for( sal_Int32 nId = 0; nId < snStyleNamesCount; ++nId ) { - aShortName = OUString::createFromAscii( sppcStyleNames[ nId ] ); - if( rStyleName.matchIgnoreAsciiCase( aShortName, nPrefixLen ) && - (nNextChar < nPrefixLen + aShortName.getLength()) ) + if( sppcStyleNames[ nId ] != 0 ) { - nFoundId = nId; - nNextChar = nPrefixLen + aShortName.getLength(); + aShortName = OUString::createFromAscii( sppcStyleNames[ nId ] ); + if( rStyleName.matchIgnoreAsciiCase( aShortName, nPrefixLen ) && + (nNextChar < nPrefixLen + aShortName.getLength()) ) + { + nFoundId = nId; + nNextChar = nPrefixLen + aShortName.getLength(); + } } } } @@ -3043,10 +3044,11 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = maBuiltinStyles.begin(), aEnd = maBuiltinStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); - OUString aStyleName = lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel ); - OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0), - "CellStyleBuffer::finalizeImport - multiple styles with equal built-in identifier" ); - if( aCellStyles.count( aStyleName ) > 0 ) + OUString aStyleName = lclCreateStyleName( rModel ); + /* If a builtin style entry already exists, and we do not reserve all + existing styles, we just stick with the last definition and ignore + the preceding ones. */ + if( bReserveAll && (aCellStyles.count( aStyleName ) > 0) ) aConflictNameStyles.push_back( *aIt ); else aCellStyles[ aStyleName ] = *aIt; @@ -3057,13 +3059,14 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = maUserStyles.begin(), aEnd = maUserStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); + OUString aStyleName = lclCreateStyleName( rModel ); // #i1624# #i1768# ignore unnamed user styles - if( rModel.maName.getLength() > 0 ) + if( aStyleName.getLength() > 0 ) { - if( aCellStyles.count( rModel.maName ) > 0 ) + if( aCellStyles.count( aStyleName ) > 0 ) aConflictNameStyles.push_back( *aIt ); else - aCellStyles[ rModel.maName ] = *aIt; + aCellStyles[ aStyleName ] = *aIt; } } @@ -3071,11 +3074,12 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = aConflictNameStyles.begin(), aEnd = aConflictNameStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); + OUString aStyleName = lclCreateStyleName( rModel ); OUString aUnusedName; sal_Int32 nIndex = 0; do { - aUnusedName = OUStringBuffer( rModel.maName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear(); + aUnusedName = OUStringBuffer( aStyleName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear(); } while( aCellStyles.count( aUnusedName ) > 0 ); aCellStyles[ aUnusedName ] = *aIt; diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 69d17b47a570..fc382954a376 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -1241,7 +1241,10 @@ void WorksheetGlobals::convertRows( OutlineLevelVec& orRowLevels, if( rModel.mbHidden ) { PropertySet aPropSet( getRows( rRowRange ) ); - aPropSet.setProperty( PROP_IsVisible, false ); + /* #i116460# Use VisibleFlag instead of IsVisible: directly set the + flag, without drawing layer update etc. (only possible before + shapes are inserted). */ + aPropSet.setProperty( PROP_VisibleFlag, false ); } // outline settings for this row range |