diff options
author | Jürgen Schmidt <jsc@apache.org> | 2013-12-05 08:02:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-05 10:10:04 +0000 |
commit | 78ed89cebb2a8eaa9e9c480a92426c0070f4d3b6 (patch) | |
tree | 646fb9497d8b488f2ce38e4525e0de5088e96f04 /sd | |
parent | 8735d039b00ba4f4ade0d0373b8c6341a9a4d763 (diff) |
Resolves: #i123789# ppt import, if sub address is not document...
internal link, take it as it is
(cherry picked from commit d44e9a9244558f63b3feaf923802ed32b4931283)
Conflicts:
sd/source/filter/ppt/pptin.cxx
Change-Id: Ic2541bcf7e368a4e9f2cc87353be165fc203dbac
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index da9428cf4c4f..f8585cc8a77b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -421,7 +421,7 @@ sal_Bool ImplSdPPTImport::Import() for( nToken = 0; nToken < nTokenCount; nToken++ ) aStringAry[nToken] = OUStringToOString(aString.getToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8); - sal_Bool bSucceeded = sal_False; + sal_Bool bDocInternalSubAddress = sal_False; // first pass, searching for a SlideId for( nToken = 0; nToken < nTokenCount; nToken++ ) @@ -438,29 +438,29 @@ sal_Bool ImplSdPPTImport::Import() if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND ) { nPageNumber = nPage; - bSucceeded = sal_True; + bDocInternalSubAddress = sal_True; break; } } } } } - if ( !bSucceeded ) + if ( !bDocInternalSubAddress ) { // second pass, searching for a SlideName for ( nToken = 0; nToken < nTokenCount; nToken++ ) { - OUString aToken( aString.getToken( nToken, (sal_Unicode)',' ) ); + OUString aToken(OStringToOUString(aStringAry[nToken], RTL_TEXTENCODING_UTF8)); std::vector<OUString>::const_iterator pIter = std::find(maSlideNameList.begin(),maSlideNameList.end(),aToken); if (pIter != maSlideNameList.end()) { nPageNumber = pIter - maSlideNameList.begin(); - bSucceeded = sal_True; + bDocInternalSubAddress = sal_True; } } } - if ( !bSucceeded ) + if ( !bDocInternalSubAddress ) { // third pass, searching for a slide number for ( nToken = 0; nToken < nTokenCount; nToken++ ) { @@ -470,13 +470,14 @@ sal_Bool ImplSdPPTImport::Import() if ( ( nNumber & ~0xff ) == 0 ) { nPageNumber = (sal_uInt32)nNumber - 1; - bSucceeded = sal_True; + bDocInternalSubAddress = sal_True; break; } } } } - if ( bSucceeded ) + // if a document internal sub address + if ( bDocInternalSubAddress ) { if ( nPageNumber < maSlideNameList.size() ) pHyperlink->aConvSubString = maSlideNameList[ nPageNumber ]; @@ -484,6 +485,12 @@ sal_Bool ImplSdPPTImport::Import() { pHyperlink->aConvSubString = OUString( SdResId( STR_PAGE ) ) + " " + ( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); } + } else { + // if sub address is given but not internal, use it as it is + if ( pHyperlink->aConvSubString.isEmpty() ) + { + pHyperlink->aConvSubString = aString; + } } } aHyperList.push_back( pHyperlink ); |