View | Details | Raw Unified | Return to issue 6087
Collapse All | Expand All

(-)a/sc/inc/compiler.hxx (+16 lines)
Lines 226-231 public: Link Here
226
                    parseAnyToken( const String& rFormula,
226
                    parseAnyToken( const String& rFormula,
227
                                   xub_StrLen nSrcPos,
227
                                   xub_StrLen nSrcPos,
228
                                   const CharClass* pCharClass) const = 0;
228
                                   const CharClass* pCharClass) const = 0;
229
230
        enum SpecialSymbolType
231
        {
232
            /** 
233
             * Character between sheet name and address.  In OOO A1 this is 
234
             * '.', while XL A1 and XL R1C1 this is '!'. 
235
             */
236
            SHEET_SEPARATOR,
237
238
            /**
239
             * In OOO A1, a sheet name may be prefixed with '$' to indicate an
240
             * absolute sheet position.
241
             */
242
            ABS_SHEET_PREFIX
243
        };
244
        virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
229
    };
245
    };
230
    friend struct Convention;
246
    friend struct Convention;
231
247
(-)a/sc/inc/document.hxx (-1 lines)
Lines 567-573 SC_DLLPUBLIC ScDBCollection* GetDBCollection() const; Link Here
567
	void			SnapVisArea( Rectangle& rRect ) const;			// 1/100 mm
567
	void			SnapVisArea( Rectangle& rRect ) const;			// 1/100 mm
568
568
569
	SC_DLLPUBLIC BOOL			ValidTabName( const String& rName ) const;
569
	SC_DLLPUBLIC BOOL			ValidTabName( const String& rName ) const;
570
    static SC_DLLPUBLIC void      ConvertToValidTabName( String& rName, sal_Unicode cReplaceChar );
571
	SC_DLLPUBLIC BOOL			ValidNewTabName( const String& rName ) const;
570
	SC_DLLPUBLIC BOOL			ValidNewTabName( const String& rName ) const;
572
	SC_DLLPUBLIC void			CreateValidTabName(String& rName) const;
571
	SC_DLLPUBLIC void			CreateValidTabName(String& rName) const;
573
	BOOL			InsertTab( SCTAB nPos, const String& rName,
572
	BOOL			InsertTab( SCTAB nPos, const String& rName,
(-)a/sc/source/core/data/document.cxx (-34 / +1 lines)
Lines 193-232 BOOL ScDocument::GetTable( const String& rName, SCTAB& rTab ) const Link Here
193
193
194
BOOL ScDocument::ValidTabName( const String& rName ) const
194
BOOL ScDocument::ValidTabName( const String& rName ) const
195
{
195
{
196
    // behaviour must be equal to ConvertToValidTabName(), see below
196
    return rName.Len() > 0;
197
	using namespace ::com::sun::star::i18n;
198
	sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER |
199
		KParseTokens::ASC_UNDERSCORE;
200
	sal_Int32 nContFlags = nStartFlags;
201
	String aContChars( RTL_CONSTASCII_USTRINGPARAM(" ") );
202
    ParseResult aRes = ScGlobal::pCharClass->parsePredefinedToken(
203
        KParseType::IDENTNAME, rName, 0, nStartFlags, EMPTY_STRING, nContFlags, aContChars );
204
    return (aRes.TokenType & KParseType::IDENTNAME) && aRes.EndPos == rName.Len();
205
}
206
207
208
void ScDocument::ConvertToValidTabName( String& rName, sal_Unicode cReplaceChar )
209
{
210
    // behaviour must be equal to ValidTabName(), see above
211
    using namespace ::com::sun::star::i18n;
212
    sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER |
213
        KParseTokens::ASC_UNDERSCORE;
214
    sal_Int32 nContFlags = nStartFlags;
215
    String aStartChars;
216
    String aContChars( RTL_CONSTASCII_USTRINGPARAM(" ") );
217
    sal_Int32 nStartPos = 0;
218
    while( nStartPos < rName.Len() )
219
    {
220
        ParseResult aRes = ScGlobal::pCharClass->parsePredefinedToken( KParseType::IDENTNAME,
221
            rName, nStartPos, nStartFlags, aStartChars, nContFlags, aContChars );
222
        if( aRes.EndPos < rName.Len() )
223
        {
224
            rName.SetChar( static_cast< xub_StrLen >( aRes.EndPos ), cReplaceChar );
225
            nStartFlags = nContFlags;
226
            aStartChars = aContChars;
227
        }
228
        nStartPos = aRes.EndPos + 1;
229
    }
230
}
197
}
231
198
232
199
(-)a/sc/source/core/tool/address.cxx (-7 / +35 lines)
Lines 717-739 lcl_ScAddress_Parse_OOo( BOOL& bExternal, const sal_Unicode* p, Link Here
717
    BOOL    bExtDoc = FALSE;
717
    BOOL    bExtDoc = FALSE;
718
    BOOL    bNeedExtTab = FALSE;
718
    BOOL    bNeedExtTab = FALSE;
719
719
720
    //Lets see if this is a reference to something in an external file
721
    //A Documentname is always quoted and has a trailing #
720
    if ( *p == '\'' && ScGlobal::UnicodeStrChr( p, SC_COMPILER_FILE_TAB_SEP ) )
722
    if ( *p == '\'' && ScGlobal::UnicodeStrChr( p, SC_COMPILER_FILE_TAB_SEP ) )
721
    {
723
    {
722
        BOOL bQuote = TRUE;         // Dokumentenname ist immer quoted
724
        const sal_Unicode *pStart = p;   
725
        BOOL bQuote = TRUE;         // A Documentname is always quoted
723
        aDocTab += *p++;
726
        aDocTab += *p++;
724
        while ( bQuote && *p )
727
        while ( bQuote && *p )
725
        {
728
        {
726
            if ( *p == '\'' && *(p-1) != '\\' )
729
            if ( *p == '\'' && *(p-1) != '\\' )
727
                bQuote = FALSE;
730
                bQuote = FALSE;
728
            else if( !(*p == '\\' && *(p+1) == '\'') )
731
            else if( !(*p == '\\' && *(p+1) == '\'') )
729
                aDocName += *p;     // falls escaped Quote: nur Quote in den Namen
732
                aDocName += *p;     // An escaped Quote in the Documentname
730
            aDocTab += *p++;
733
            aDocTab += *p++;
731
        }
734
        }
732
        aDocTab += *p;              // den SC_COMPILER_FILE_TAB_SEP mitnehmen
735
        aDocTab += *p;              // den SC_COMPILER_FILE_TAB_SEP mitnehmen
733
        if( *p++ == SC_COMPILER_FILE_TAB_SEP )
736
        if( *p++ == SC_COMPILER_FILE_TAB_SEP )
734
            bExtDoc = TRUE;
737
            bExtDoc = TRUE;
735
        else
738
        else
736
            return nRes;
739
        {
740
            //It wasn't a document after all, reset and continue as normal
741
            p = pStart;
742
            aDocTab = String();
743
        }
737
    }
744
    }
738
745
739
    SCCOL   nCol = 0;
746
    SCCOL   nCol = 0;
Lines 748-759 lcl_ScAddress_Parse_OOo( BOOL& bExternal, const sal_Unicode* p, Link Here
748
            nRes |= SCA_TAB_ABSOLUTE;
755
            nRes |= SCA_TAB_ABSOLUTE;
749
        if (*p == '$')
756
        if (*p == '$')
750
            nRes |= SCA_TAB_ABSOLUTE, p++;
757
            nRes |= SCA_TAB_ABSOLUTE, p++;
751
        BOOL bQuote = FALSE;
758
759
        //Tokens that start at ' can have anything in them until a final '
760
        //but '' marks an escaped '
761
        //We've earlier guaranteed that a string containing '' will be
762
        //surrounded by '
752
        if( *p == '\'' )
763
        if( *p == '\'' )
753
            p++, bQuote = TRUE;
754
        while (*p && (*p != '.'))
755
        {
764
        {
756
            if( bQuote && *p == '\'' )
765
            ++p;
766
            while (*p)
767
            {
768
                if (*p == '\'')
769
                {
770
                    if ( (*(p+1) != '\'') )
771
                        break;
772
                    else
773
                        *p++;
774
                }
775
                aTab += *p++;
776
            }
777
        }
778
779
        while (*p)
780
        {
781
            if( *p == '.')
782
                break;
783
784
            if( *p == '\'' )
757
            {
785
            {
758
                p++; break;
786
                p++; break;
759
            }
787
            }
(-)a/sc/source/core/tool/compiler.cxx (-22 / +73 lines)
Lines 1087-1092 struct Convention_A1 : public ScCompiler::Convention Link Here
1087
                               xub_StrLen nSrcPos,
1087
                               xub_StrLen nSrcPos,
1088
                               const CharClass* pCharClass) const
1088
                               const CharClass* pCharClass) const
1089
    {
1089
    {
1090
        //Tokens that start at ' can have anything in them until a final '
1091
        //but '' marks an escaped '
1092
        //We've earlier guaranteed that a string containing '' will be
1093
        //surrounded by '
1094
        if (rFormula.GetChar(nSrcPos) == '\'')
1095
        {
1096
            xub_StrLen nPos = nSrcPos+1;
1097
            while (nPos < rFormula.Len())
1098
            {
1099
                if (rFormula.GetChar(nPos) == '\'')
1100
                {
1101
                    if ( (nPos+1 == rFormula.Len()) || (rFormula.GetChar(nPos+1) != '\'') )
1102
                    {
1103
                        ParseResult aRet;
1104
                        aRet.TokenType = KParseType::SINGLE_QUOTE_NAME;
1105
                        aRet.EndPos = nPos+1;
1106
                        return aRet;
1107
                    }
1108
                    ++nPos;
1109
                }
1110
                ++nPos;
1111
            }
1112
        }
1113
1090
        static const sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER |
1114
        static const sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER |
1091
            KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
1115
            KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
1092
        static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
1116
        static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
Lines 1261-1266 struct ConventionOOO_A1 : public Convention_A1 Link Here
1261
    {
1285
    {
1262
        MakeRefStrImpl( rBuffer, rComp, rRef, bSingleRef, false);
1286
        MakeRefStrImpl( rBuffer, rComp, rRef, bSingleRef, false);
1263
    }
1287
    }
1288
1289
    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
1290
    {
1291
        switch (eSymType)
1292
        {
1293
            case ScCompiler::Convention::ABS_SHEET_PREFIX:
1294
                return '$';
1295
            case ScCompiler::Convention::SHEET_SEPARATOR:
1296
                return '.';
1297
        }
1298
1299
        return sal_Unicode(0);
1300
    }
1264
};
1301
};
1265
1302
1266
1303
Lines 1370-1375 struct ConventionXL Link Here
1370
            rBuf.append( sal_Unicode( '!' ) );
1407
            rBuf.append( sal_Unicode( '!' ) );
1371
        }
1408
        }
1372
    }
1409
    }
1410
1411
    static sal_Unicode getSpecialSymbol( ScCompiler::Convention::SpecialSymbolType eSymType )
1412
    {
1413
        switch (eSymType)
1414
        {
1415
            case ScCompiler::Convention::SHEET_SEPARATOR:
1416
                return '!';
1417
        }
1418
        return sal_Unicode(0);
1419
    }
1373
};
1420
};
1374
1421
1375
struct ConventionXL_A1 : public Convention_A1, public ConventionXL
1422
struct ConventionXL_A1 : public Convention_A1, public ConventionXL
Lines 1446-1451 struct ConventionXL_A1 : public Convention_A1, public ConventionXL Link Here
1446
            MakeRowStr( rBuf, aRef.Ref2.nRow );
1493
            MakeRowStr( rBuf, aRef.Ref2.nRow );
1447
        }
1494
        }
1448
    }
1495
    }
1496
1497
    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
1498
    {
1499
        return ConventionXL::getSpecialSymbol(eSymType);
1500
    }
1449
};
1501
};
1450
1502
1451
static const ConventionXL_A1 ConvXL_A1;
1503
static const ConventionXL_A1 ConvXL_A1;
Lines 1564-1569 struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL Link Here
1564
        return pCharClass->parseAnyToken( rFormula,
1616
        return pCharClass->parseAnyToken( rFormula,
1565
                nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
1617
                nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
1566
    }
1618
    }
1619
1620
    virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const
1621
    {
1622
        return ConventionXL::getSpecialSymbol(eSymType);
1623
    }
1567
};
1624
};
1568
1625
1569
static const ConventionXL_R1C1 ConvXL_R1C1;
1626
static const ConventionXL_R1C1 ConvXL_R1C1;
Lines 1621-1649 ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos, Link Here
1621
void ScCompiler::CheckTabQuotes( String& rString,
1678
void ScCompiler::CheckTabQuotes( String& rString,
1622
                                 const ScAddress::Convention eConv )
1679
                                 const ScAddress::Convention eConv )
1623
{
1680
{
1624
    register const xub_StrLen nLen = rString.Len();
1681
    using namespace ::com::sun::star::i18n;
1625
    register xub_StrLen i;
1682
    sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER | KParseTokens::ASC_UNDERSCORE;
1626
1683
    sal_Int32 nContFlags = nStartFlags;
1627
    bool bNeedsQuote = false;
1684
    ParseResult aRes = ScGlobal::pCharClass->parsePredefinedToken(
1628
1685
        KParseType::IDENTNAME, rString, 0, nStartFlags, EMPTY_STRING, nContFlags, EMPTY_STRING);
1629
    for ( i = 0 ; i < nLen ; i++ )
1686
    bool bNeedsQuote = !((aRes.TokenType & KParseType::IDENTNAME) && aRes.EndPos == rString.Len());
1630
    {
1631
        if( !IsWordChar( rString, i ) )
1632
        {
1633
            bNeedsQuote = true;
1634
            break;
1635
        }
1636
    }
1637
    if ( !bNeedsQuote && CharClass::isAsciiNumeric( rString ) )
1638
    {
1639
        bNeedsQuote = true;
1640
    }
1641
1687
1642
    switch ( eConv ) {
1688
    switch ( eConv ) {
1643
        default :
1689
        default :
1644
        case ScAddress::CONV_UNSPECIFIED :
1690
        case ScAddress::CONV_UNSPECIFIED :
1645
        case ScAddress::CONV_OOO :
1646
            break;
1691
            break;
1692
        case ScAddress::CONV_OOO :
1647
        case ScAddress::CONV_XL_A1 :
1693
        case ScAddress::CONV_XL_A1 :
1648
        case ScAddress::CONV_XL_R1C1 :
1694
        case ScAddress::CONV_XL_R1C1 :
1649
            if( bNeedsQuote )
1695
            if( bNeedsQuote )
Lines 1756-1761 xub_StrLen ScCompiler::NextSymbol() Link Here
1756
    sal_Unicode cSep = mxSymbols->getSymbol( ocSep).GetChar(0);
1802
    sal_Unicode cSep = mxSymbols->getSymbol( ocSep).GetChar(0);
1757
    sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
1803
    sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
1758
            ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0));
1804
            ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0));
1805
1806
    // special symbols specific to address convention used
1807
    sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX);
1808
    sal_Unicode cSheetSep    = pConv->getSpecialSymbol(ScCompiler::Convention::SHEET_SEPARATOR);
1809
1759
    int nDecSeps = 0;
1810
    int nDecSeps = 0;
1760
    int nRefInSheetName = 0;
1811
    int nRefInSheetName = 0;
1761
    mnPredetectedReference = 0;
1812
    mnPredetectedReference = 0;
Lines 2063-2070 xub_StrLen ScCompiler::NextSymbol() Link Here
2063
        do
2114
        do
2064
        {
2115
        {
2065
            bi18n = FALSE;
2116
            bi18n = FALSE;
2066
            // special case  $'sheetname'
2117
            // special case  (e.g. $'sheetname' in OOO A1)
2067
            if ( pStart[nSrcPos] == '$' && pStart[nSrcPos+1] == '\'' )
2118
            if ( pStart[nSrcPos] == cSheetPrefix && pStart[nSrcPos+1] == '\'' )
2068
                aSymbol += pStart[nSrcPos++];
2119
                aSymbol += pStart[nSrcPos++];
2069
2120
2070
            ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pCharClass );
2121
            ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pCharClass );
Lines 2082-2090 xub_StrLen ScCompiler::NextSymbol() Link Here
2082
                aSymbol.Append( pStart + nSrcPos, (xub_StrLen)aRes.EndPos - nSrcPos );
2133
                aSymbol.Append( pStart + nSrcPos, (xub_StrLen)aRes.EndPos - nSrcPos );
2083
                nSrcPos = (xub_StrLen) aRes.EndPos;
2134
                nSrcPos = (xub_StrLen) aRes.EndPos;
2084
                if ( aRes.TokenType & KParseType::SINGLE_QUOTE_NAME )
2135
                if ( aRes.TokenType & KParseType::SINGLE_QUOTE_NAME )
2085
                {   // special cases  'sheetname'.  'filename'#
2136
                {   // special cases (e.g. 'sheetname'. or 'filename'# in OOO A1)
2086
                    c = pStart[nSrcPos];
2137
                    c = pStart[nSrcPos];
2087
                    bi18n = (c == '.' || c == SC_COMPILER_FILE_TAB_SEP);
2138
                    bi18n = (c == cSheetSep || c == SC_COMPILER_FILE_TAB_SEP);
2088
                    if ( bi18n )
2139
                    if ( bi18n )
2089
                        aSymbol += pStart[nSrcPos++];
2140
                        aSymbol += pStart[nSrcPos++];
2090
                }
2141
                }
(-)a/sc/source/filter/excel/excimp8.cxx (-1 lines)
Lines 186-192 void ImportExcel8::Boundsheet( void ) Link Here
186
    String aName( aIn.ReadUniString( nLen ) );
186
    String aName( aIn.ReadUniString( nLen ) );
187
    GetTabInfo().AppendXclTabName( aName, nBdshtTab );
187
    GetTabInfo().AppendXclTabName( aName, nBdshtTab );
188
188
189
    ScfTools::ConvertToScSheetName( aName );
190
	*pExcRoot->pTabNameBuff << aName;
189
	*pExcRoot->pTabNameBuff << aName;
191
190
192
    SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
191
    SCTAB nScTab = static_cast< SCTAB >( nBdshtTab );
(-)a/sc/source/filter/excel/exctools.cxx (-1 lines)
Lines 391-397 void ExcScenario::Apply( const XclImpRoot& rRoot, const BOOL bLast ) Link Here
391
    ScDocument&         r = rRoot.GetDoc();
391
    ScDocument&         r = rRoot.GetDoc();
392
	ExcScenarioCell*	p = EXCSCFIRST();
392
	ExcScenarioCell*	p = EXCSCFIRST();
393
	String				aSzenName( *pName );
393
	String				aSzenName( *pName );
394
	ScfTools::ConvertToScSheetName( aSzenName );
395
	UINT16				nNewTab = nTab + 1;
394
	UINT16				nNewTab = nTab + 1;
396
395
397
	if( !r.InsertTab( nNewTab, aSzenName ) )
396
	if( !r.InsertTab( nNewTab, aSzenName ) )
(-)a/sc/source/filter/excel/impop.cxx (-2 lines)
Lines 435-441 void ImportExcel::Externsheet( void ) Link Here
435
    bool bSameWorkBook;
435
    bool bSameWorkBook;
436
    String aEncodedUrl( aIn.ReadByteString( false ) );
436
    String aEncodedUrl( aIn.ReadByteString( false ) );
437
    XclImpUrlHelper::DecodeUrl( aUrl, aTabName, bSameWorkBook, *pExcRoot->pIR, aEncodedUrl );
437
    XclImpUrlHelper::DecodeUrl( aUrl, aTabName, bSameWorkBook, *pExcRoot->pIR, aEncodedUrl );
438
    ScfTools::ConvertToScSheetName( aTabName );
439
    pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
438
    pExcRoot->pExtSheetBuff->Add( aUrl, aTabName, bSameWorkBook );
440
}
439
}
441
440
Lines 686-692 void ImportExcel::Boundsheet( void ) Link Here
686
	}
685
	}
687
686
688
    String aName( aIn.ReadByteString( FALSE ) );
687
    String aName( aIn.ReadByteString( FALSE ) );
689
    ScfTools::ConvertToScSheetName( aName );
690
688
691
	*pExcRoot->pTabNameBuff << aName;
689
	*pExcRoot->pTabNameBuff << aName;
692
690
(-)a/sc/source/filter/excel/xicontent.cxx (-5 lines)
Lines 354-365 void XclImpHyperlink::ConvertToValidTabName(String& rUrl) Link Here
354
        {
354
        {
355
            bInQuote = !bInQuote;
355
            bInQuote = !bInQuote;
356
            if (!bInQuote && aTabName.Len() > 0)
356
            if (!bInQuote && aTabName.Len() > 0)
357
            {
358
                // Sheet name exists.  Convert it to valid name the same way the
359
                // sheet names are converted.
360
                ScDocument::ConvertToValidTabName(aTabName, sal_Unicode('_'));
361
                aNewUrl.Append(aTabName);
357
                aNewUrl.Append(aTabName);
362
            }
363
        }
358
        }
364
        else if (bInQuote)
359
        else if (bInQuote)
365
            aTabName.Append(c);
360
            aTabName.Append(c);
(-)a/sc/source/filter/excel/xilink.cxx (-1 lines)
Lines 422-428 XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) : Link Here
422
        for( sal_uInt16 nSBTab = 0; nSBTab < nSBTabCnt; ++nSBTab )
422
        for( sal_uInt16 nSBTab = 0; nSBTab < nSBTabCnt; ++nSBTab )
423
        {
423
        {
424
            String aTabName( rStrm.ReadUniString() );
424
            String aTabName( rStrm.ReadUniString() );
425
            ScfTools::ConvertToScSheetName( aTabName );
426
            maSupbTabList.Append( new XclImpSupbookTab( aTabName ) );
425
            maSupbTabList.Append( new XclImpSupbookTab( aTabName ) );
427
        }
426
        }
428
    }
427
    }
(-)a/sc/source/filter/excel/xipivot.cxx (-1 lines)
Lines 695-701 void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) Link Here
695
            String aDummyName = CREATE_STRING( "DPCache" );
695
            String aDummyName = CREATE_STRING( "DPCache" );
696
            if( maTabName.Len() > 0 )
696
            if( maTabName.Len() > 0 )
697
                aDummyName.Append( '_' ).Append( maTabName );
697
                aDummyName.Append( '_' ).Append( maTabName );
698
            ScfTools::ConvertToScSheetName( aDummyName );
699
            rDoc.CreateValidTabName( aDummyName );
698
            rDoc.CreateValidTabName( aDummyName );
700
            rDoc.RenameTab( nScTab, aDummyName );
699
            rDoc.RenameTab( nScTab, aDummyName );
701
            // set sheet index to source range
700
            // set sheet index to source range
(-)a/sc/source/filter/ftools/ftools.cxx (-5 lines)
Lines 158-168 Color ScfTools::GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 Link Here
158
158
159
// *** conversion of names *** ------------------------------------------------
159
// *** conversion of names *** ------------------------------------------------
160
160
161
void ScfTools::ConvertToScSheetName( String& rName )
162
{
163
    ScDocument::ConvertToValidTabName( rName, '_' );
164
}
165
166
void ScfTools::ConvertToScDefinedName( String& rName )
161
void ScfTools::ConvertToScDefinedName( String& rName )
167
{
162
{
168
    xub_StrLen nLen = rName.Len();
163
    xub_StrLen nLen = rName.Len();
(-)a/sc/source/filter/inc/ftools.hxx (-4 lines)
Lines 292-301 public: Link Here
292
292
293
// *** conversion of names *** ------------------------------------------------
293
// *** conversion of names *** ------------------------------------------------
294
294
295
    /** Converts a string to a valid Calc sheet name.
296
        @descr  Sheet names in Calc may contain letters, digits, underscores, and spaces
297
        (space characters are not allowed at first position). */
298
    static void         ConvertToScSheetName( String& rName );
299
    /** Converts a string to a valid Calc defined name or database range name.
295
    /** Converts a string to a valid Calc defined name or database range name.
300
        @descr  Defined names in Calc may contain letters, digits (*), underscores, periods (*),
296
        @descr  Defined names in Calc may contain letters, digits (*), underscores, periods (*),
301
        colons (*), question marks, and dollar signs.
297
        colons (*), question marks, and dollar signs.
(-)a/sc/source/filter/xcl97/XclImpChangeTrack.cxx (-1 lines)
Lines 179-185 sal_Bool XclImpChangeTrack::Read3DTabRefInfo( SCTAB& rFirstTab, SCTAB& rLastTab Link Here
179
        pStrm->Ignore( 1 );
179
        pStrm->Ignore( 1 );
180
        // - sheet name, always separated from URL
180
        // - sheet name, always separated from URL
181
        String aTabName( pStrm->ReadUniString() );
181
        String aTabName( pStrm->ReadUniString() );
182
        ScfTools::ConvertToScSheetName( aTabName );
183
        pStrm->Ignore( 1 );
182
        pStrm->Ignore( 1 );
184
        rFirstTab = rLastTab = static_cast<SCTAB>(GetLinkManager().GetScTab( aUrl, aTabName ));
183
        rFirstTab = rLastTab = static_cast<SCTAB>(GetLinkManager().GetScTab( aUrl, aTabName ));
185
	}
184
	}
(-)a/sc/source/ui/vba/vbaworksheets.cxx (-3 / +1 lines)
Lines 402-410 ScVbaWorksheets::Item( const uno::Any& Index, const uno::Any& Index2 ) throw (u Link Here
402
uno::Any 
402
uno::Any 
403
ScVbaWorksheets::getItemByStringIndex( const rtl::OUString& sIndex ) throw (uno::RuntimeException)
403
ScVbaWorksheets::getItemByStringIndex( const rtl::OUString& sIndex ) throw (uno::RuntimeException)
404
{
404
{
405
	String sScIndex = sIndex;
405
	return ScVbaWorksheets_BASE::getItemByStringIndex( sIndex );
406
	ScDocument::ConvertToValidTabName( sScIndex, '_' );
407
	return ScVbaWorksheets_BASE::getItemByStringIndex( sScIndex );
408
}
406
}
409
407
410
rtl::OUString& 
408
rtl::OUString& 

Return to issue 6087