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
This commit is contained in:
committed by
Caolán McNamara
parent
8735d039b0
commit
78ed89cebb
@@ -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 );
|
||||
|
Reference in New Issue
Block a user