Lines 252-258
Link Here
|
252 |
|
252 |
|
253 |
namespace DocTempl { |
253 |
namespace DocTempl { |
254 |
|
254 |
|
255 |
class EntryData_Impl |
255 |
class DocTempl_EntryData_Impl |
256 |
{ |
256 |
{ |
257 |
RegionData_Impl* mpParent; |
257 |
RegionData_Impl* mpParent; |
258 |
SfxObjectShellLock mxObjShell; |
258 |
SfxObjectShellLock mxObjShell; |
Lines 267-273
Link Here
|
267 |
RegionData_Impl* GetParent() const { return mpParent; } |
267 |
RegionData_Impl* GetParent() const { return mpParent; } |
268 |
|
268 |
|
269 |
public: |
269 |
public: |
270 |
EntryData_Impl( RegionData_Impl* pParent, |
270 |
DocTempl_EntryData_Impl( RegionData_Impl* pParent, |
271 |
const OUString& rTitle ); |
271 |
const OUString& rTitle ); |
272 |
|
272 |
|
273 |
const OUString& GetTitle() const { return maTitle; } |
273 |
const OUString& GetTitle() const { return maTitle; } |
Lines 288-301
Link Here
|
288 |
|
288 |
|
289 |
using namespace ::DocTempl; |
289 |
using namespace ::DocTempl; |
290 |
|
290 |
|
291 |
DECLARE_LIST( EntryList_Impl, EntryData_Impl* ); |
291 |
DECLARE_LIST( DocTempl_EntryList_Impl, DocTempl_EntryData_Impl* ); |
292 |
|
292 |
|
293 |
// ------------------------------------------------------------------------ |
293 |
// ------------------------------------------------------------------------ |
294 |
|
294 |
|
295 |
class RegionData_Impl |
295 |
class RegionData_Impl |
296 |
{ |
296 |
{ |
297 |
const SfxDocTemplate_Impl* mpParent; |
297 |
const SfxDocTemplate_Impl* mpParent; |
298 |
EntryList_Impl maEntries; |
298 |
DocTempl_EntryList_Impl maEntries; |
299 |
OUString maTitle; |
299 |
OUString maTitle; |
300 |
OUString maOwnURL; |
300 |
OUString maOwnURL; |
301 |
OUString maTargetURL; |
301 |
OUString maTargetURL; |
Lines 313-321
Link Here
|
313 |
void SetTargetURL( const OUString& rURL ) { maTargetURL = rURL; } |
313 |
void SetTargetURL( const OUString& rURL ) { maTargetURL = rURL; } |
314 |
void SetHierarchyURL( const OUString& rURL) { maOwnURL = rURL; } |
314 |
void SetHierarchyURL( const OUString& rURL) { maOwnURL = rURL; } |
315 |
|
315 |
|
316 |
EntryData_Impl* GetEntry( ULONG nIndex ) const; |
316 |
DocTempl_EntryData_Impl* GetEntry( ULONG nIndex ) const; |
317 |
EntryData_Impl* GetEntry( const OUString& rName ) const; |
317 |
DocTempl_EntryData_Impl* GetEntry( const OUString& rName ) const; |
318 |
EntryData_Impl* GetByTargetURL( const OUString& rName ) const; |
318 |
DocTempl_EntryData_Impl* GetByTargetURL( const OUString& rName ) const; |
319 |
|
319 |
|
320 |
const OUString& GetTitle() const { return maTitle; } |
320 |
const OUString& GetTitle() const { return maTitle; } |
321 |
const OUString& GetTargetURL(); |
321 |
const OUString& GetTargetURL(); |
Lines 635-641
Link Here
|
635 |
|
635 |
|
636 |
if ( pImp->Construct() ) |
636 |
if ( pImp->Construct() ) |
637 |
{ |
637 |
{ |
638 |
EntryData_Impl *pEntry = NULL; |
638 |
DocTempl_EntryData_Impl *pEntry = NULL; |
639 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
639 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
640 |
|
640 |
|
641 |
if ( pRegion ) |
641 |
if ( pRegion ) |
Lines 671-677
Link Here
|
671 |
if ( !pImp->Construct() ) |
671 |
if ( !pImp->Construct() ) |
672 |
return String(); |
672 |
return String(); |
673 |
|
673 |
|
674 |
EntryData_Impl *pEntry = NULL; |
674 |
DocTempl_EntryData_Impl *pEntry = NULL; |
675 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
675 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
676 |
|
676 |
|
677 |
if ( pRegion ) |
677 |
if ( pRegion ) |
Lines 710-716
Link Here
|
710 |
if ( !pImp->Construct() ) |
710 |
if ( !pImp->Construct() ) |
711 |
return String(); |
711 |
return String(); |
712 |
|
712 |
|
713 |
EntryData_Impl *pEntry = NULL; |
713 |
DocTempl_EntryData_Impl *pEntry = NULL; |
714 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
714 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
715 |
|
715 |
|
716 |
if ( pRegion ) |
716 |
if ( pRegion ) |
Lines 745-751
Link Here
|
745 |
if ( !pImp->Construct() ) |
745 |
if ( !pImp->Construct() ) |
746 |
return String(); |
746 |
return String(); |
747 |
|
747 |
|
748 |
EntryData_Impl *pEntry = NULL; |
748 |
DocTempl_EntryData_Impl *pEntry = NULL; |
749 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
749 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
750 |
|
750 |
|
751 |
if ( pRegion ) |
751 |
if ( pRegion ) |
Lines 799-805
Link Here
|
799 |
// group |
799 |
// group |
800 |
// --**-- perhaps we have to create it ??? |
800 |
// --**-- perhaps we have to create it ??? |
801 |
RegionData_Impl *pRegion = pImp->GetRegion( 0L ); |
801 |
RegionData_Impl *pRegion = pImp->GetRegion( 0L ); |
802 |
EntryData_Impl *pEntry = NULL; |
802 |
DocTempl_EntryData_Impl *pEntry = NULL; |
803 |
|
803 |
|
804 |
if ( pRegion ) |
804 |
if ( pRegion ) |
805 |
pEntry = pRegion->GetEntry( rLongName ); |
805 |
pEntry = pRegion->GetEntry( rLongName ); |
Lines 893-899
Link Here
|
893 |
if ( ! pImp->Construct() ) |
893 |
if ( ! pImp->Construct() ) |
894 |
return; |
894 |
return; |
895 |
|
895 |
|
896 |
EntryData_Impl *pEntry; |
896 |
DocTempl_EntryData_Impl *pEntry; |
897 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
897 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
898 |
|
898 |
|
899 |
// do nothing if there is no region with that index |
899 |
// do nothing if there is no region with that index |
Lines 983-989
Link Here
|
983 |
if ( !pSourceRgn ) |
983 |
if ( !pSourceRgn ) |
984 |
return FALSE; |
984 |
return FALSE; |
985 |
|
985 |
|
986 |
EntryData_Impl *pSource = pSourceRgn->GetEntry( nSourceIdx ); |
986 |
DocTempl_EntryData_Impl *pSource = pSourceRgn->GetEntry( nSourceIdx ); |
987 |
if ( !pSource ) |
987 |
if ( !pSource ) |
988 |
return FALSE; |
988 |
return FALSE; |
989 |
|
989 |
|
Lines 1133-1139
Link Here
|
1133 |
if ( !pSourceRgn ) |
1133 |
if ( !pSourceRgn ) |
1134 |
return FALSE; |
1134 |
return FALSE; |
1135 |
|
1135 |
|
1136 |
EntryData_Impl *pSource = pSourceRgn->GetEntry( nIdx ); |
1136 |
DocTempl_EntryData_Impl *pSource = pSourceRgn->GetEntry( nIdx ); |
1137 |
if ( !pSource ) |
1137 |
if ( !pSource ) |
1138 |
return FALSE; |
1138 |
return FALSE; |
1139 |
|
1139 |
|
Lines 1383-1389
Link Here
|
1383 |
} |
1383 |
} |
1384 |
else |
1384 |
else |
1385 |
{ |
1385 |
{ |
1386 |
EntryData_Impl *pEntry = pRegion->GetEntry( nIdx ); |
1386 |
DocTempl_EntryData_Impl *pEntry = pRegion->GetEntry( nIdx ); |
1387 |
|
1387 |
|
1388 |
if ( !pEntry ) |
1388 |
if ( !pEntry ) |
1389 |
return FALSE; |
1389 |
return FALSE; |
Lines 1479-1485
Link Here
|
1479 |
return FALSE; |
1479 |
return FALSE; |
1480 |
|
1480 |
|
1481 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1481 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1482 |
EntryData_Impl *pEntry = NULL; |
1482 |
DocTempl_EntryData_Impl *pEntry = NULL; |
1483 |
|
1483 |
|
1484 |
if ( !pRegion ) |
1484 |
if ( !pRegion ) |
1485 |
return FALSE; |
1485 |
return FALSE; |
Lines 1589-1595
Link Here
|
1589 |
return NULL; |
1589 |
return NULL; |
1590 |
|
1590 |
|
1591 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1591 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1592 |
EntryData_Impl *pEntry = NULL; |
1592 |
DocTempl_EntryData_Impl *pEntry = NULL; |
1593 |
|
1593 |
|
1594 |
if ( pRegion ) |
1594 |
if ( pRegion ) |
1595 |
pEntry = pRegion->GetEntry( nIdx ); |
1595 |
pEntry = pRegion->GetEntry( nIdx ); |
Lines 1632-1638
Link Here
|
1632 |
return TRUE; |
1632 |
return TRUE; |
1633 |
|
1633 |
|
1634 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1634 |
RegionData_Impl *pRegion = pImp->GetRegion( nRegion ); |
1635 |
EntryData_Impl *pEntry = NULL; |
1635 |
DocTempl_EntryData_Impl *pEntry = NULL; |
1636 |
|
1636 |
|
1637 |
if ( pRegion ) |
1637 |
if ( pRegion ) |
1638 |
pEntry = pRegion->GetEntry( nIdx ); |
1638 |
pEntry = pRegion->GetEntry( nIdx ); |
Lines 1680-1686
Link Here
|
1680 |
if ( ! pImp->Construct() ) |
1680 |
if ( ! pImp->Construct() ) |
1681 |
return FALSE; |
1681 |
return FALSE; |
1682 |
|
1682 |
|
1683 |
EntryData_Impl* pEntry = NULL; |
1683 |
DocTempl_EntryData_Impl* pEntry = NULL; |
1684 |
const USHORT nCount = GetRegionCount(); |
1684 |
const USHORT nCount = GetRegionCount(); |
1685 |
|
1685 |
|
1686 |
for ( USHORT i = 0; i < nCount; ++i ) |
1686 |
for ( USHORT i = 0; i < nCount; ++i ) |
Lines 1744-1750
Link Here
|
1744 |
OUString aPathTo = aFullPath.GetMainURL( INetURLObject::NO_DECODE ); |
1744 |
OUString aPathTo = aFullPath.GetMainURL( INetURLObject::NO_DECODE ); |
1745 |
|
1745 |
|
1746 |
RegionData_Impl *pData = NULL; |
1746 |
RegionData_Impl *pData = NULL; |
1747 |
EntryData_Impl *pEntry = NULL; |
1747 |
DocTempl_EntryData_Impl *pEntry = NULL; |
1748 |
sal_Bool bFound = sal_False; |
1748 |
sal_Bool bFound = sal_False; |
1749 |
|
1749 |
|
1750 |
ULONG nCount = GetRegionCount(); |
1750 |
ULONG nCount = GetRegionCount(); |
Lines 1842-1848
Link Here
|
1842 |
// ----------------------------------------------------------------------- |
1842 |
// ----------------------------------------------------------------------- |
1843 |
// ----------------------------------------------------------------------- |
1843 |
// ----------------------------------------------------------------------- |
1844 |
// ----------------------------------------------------------------------- |
1844 |
// ----------------------------------------------------------------------- |
1845 |
EntryData_Impl::EntryData_Impl( RegionData_Impl* pParent, |
1845 |
DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent, |
1846 |
const OUString& rTitle ) |
1846 |
const OUString& rTitle ) |
1847 |
{ |
1847 |
{ |
1848 |
mpParent = pParent; |
1848 |
mpParent = pParent; |
Lines 1852-1864
Link Here
|
1852 |
} |
1852 |
} |
1853 |
|
1853 |
|
1854 |
// ----------------------------------------------------------------------- |
1854 |
// ----------------------------------------------------------------------- |
1855 |
int EntryData_Impl::Compare( const OUString& rTitle ) const |
1855 |
int DocTempl_EntryData_Impl::Compare( const OUString& rTitle ) const |
1856 |
{ |
1856 |
{ |
1857 |
return maTitle.compareTo( rTitle ); |
1857 |
return maTitle.compareTo( rTitle ); |
1858 |
} |
1858 |
} |
1859 |
|
1859 |
|
1860 |
//------------------------------------------------------------------------ |
1860 |
//------------------------------------------------------------------------ |
1861 |
SfxObjectShellRef EntryData_Impl::CreateObjectShell() |
1861 |
SfxObjectShellRef DocTempl_EntryData_Impl::CreateObjectShell() |
1862 |
{ |
1862 |
{ |
1863 |
if( ! mxObjShell.Is() ) |
1863 |
if( ! mxObjShell.Is() ) |
1864 |
{ |
1864 |
{ |
Lines 1928-1934
Link Here
|
1928 |
} |
1928 |
} |
1929 |
|
1929 |
|
1930 |
//------------------------------------------------------------------------ |
1930 |
//------------------------------------------------------------------------ |
1931 |
BOOL EntryData_Impl::DeleteObjectShell() |
1931 |
BOOL DocTempl_EntryData_Impl::DeleteObjectShell() |
1932 |
{ |
1932 |
{ |
1933 |
BOOL bRet = TRUE; |
1933 |
BOOL bRet = TRUE; |
1934 |
|
1934 |
|
Lines 1963-1969
Link Here
|
1963 |
} |
1963 |
} |
1964 |
|
1964 |
|
1965 |
// ----------------------------------------------------------------------- |
1965 |
// ----------------------------------------------------------------------- |
1966 |
const OUString& EntryData_Impl::GetHierarchyURL() |
1966 |
const OUString& DocTempl_EntryData_Impl::GetHierarchyURL() |
1967 |
{ |
1967 |
{ |
1968 |
if ( !maOwnURL.getLength() ) |
1968 |
if ( !maOwnURL.getLength() ) |
1969 |
{ |
1969 |
{ |
Lines 1981-1987
Link Here
|
1981 |
} |
1981 |
} |
1982 |
|
1982 |
|
1983 |
// ----------------------------------------------------------------------- |
1983 |
// ----------------------------------------------------------------------- |
1984 |
const OUString& EntryData_Impl::GetTargetURL() |
1984 |
const OUString& DocTempl_EntryData_Impl::GetTargetURL() |
1985 |
{ |
1985 |
{ |
1986 |
if ( !maTargetURL.getLength() ) |
1986 |
if ( !maTargetURL.getLength() ) |
1987 |
{ |
1987 |
{ |
Lines 2017-2023
Link Here
|
2017 |
// ----------------------------------------------------------------------- |
2017 |
// ----------------------------------------------------------------------- |
2018 |
RegionData_Impl::~RegionData_Impl() |
2018 |
RegionData_Impl::~RegionData_Impl() |
2019 |
{ |
2019 |
{ |
2020 |
EntryData_Impl *pData = maEntries.First(); |
2020 |
DocTempl_EntryData_Impl *pData = maEntries.First(); |
2021 |
|
2021 |
|
2022 |
while ( pData ) |
2022 |
while ( pData ) |
2023 |
{ |
2023 |
{ |
Lines 2036-2042
Link Here
|
2036 |
|
2036 |
|
2037 |
for ( i=0; i<nCount; i++ ) |
2037 |
for ( i=0; i<nCount; i++ ) |
2038 |
{ |
2038 |
{ |
2039 |
EntryData_Impl *pData = maEntries.GetObject( i ); |
2039 |
DocTempl_EntryData_Impl *pData = maEntries.GetObject( i ); |
2040 |
|
2040 |
|
2041 |
if ( pData->Compare( rTitle ) == 0 ) |
2041 |
if ( pData->Compare( rTitle ) == 0 ) |
2042 |
{ |
2042 |
{ |
Lines 2057-2063
Link Here
|
2057 |
long nEnd = maEntries.Count() - 1; |
2057 |
long nEnd = maEntries.Count() - 1; |
2058 |
long nMid; |
2058 |
long nMid; |
2059 |
|
2059 |
|
2060 |
EntryData_Impl* pMid; |
2060 |
DocTempl_EntryData_Impl* pMid; |
2061 |
|
2061 |
|
2062 |
rFound = sal_False; |
2062 |
rFound = sal_False; |
2063 |
|
2063 |
|
Lines 2099-2105
Link Here
|
2099 |
INetURLObject::ENCODE_ALL ); |
2099 |
INetURLObject::ENCODE_ALL ); |
2100 |
OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::NO_DECODE ); |
2100 |
OUString aLinkURL = aLinkObj.GetMainURL( INetURLObject::NO_DECODE ); |
2101 |
|
2101 |
|
2102 |
EntryData_Impl *pEntry; |
2102 |
DocTempl_EntryData_Impl *pEntry; |
2103 |
sal_Bool bFound = sal_False; |
2103 |
sal_Bool bFound = sal_False; |
2104 |
long nPos = GetEntryPos( rTitle, bFound ); |
2104 |
long nPos = GetEntryPos( rTitle, bFound ); |
2105 |
|
2105 |
|
Lines 2112-2118
Link Here
|
2112 |
if ( pPos ) |
2112 |
if ( pPos ) |
2113 |
nPos = *pPos; |
2113 |
nPos = *pPos; |
2114 |
|
2114 |
|
2115 |
pEntry = new EntryData_Impl( this, rTitle ); |
2115 |
pEntry = new DocTempl_EntryData_Impl( this, rTitle ); |
2116 |
pEntry->SetTargetURL( rTargetURL ); |
2116 |
pEntry->SetTargetURL( rTargetURL ); |
2117 |
pEntry->SetHierarchyURL( aLinkURL ); |
2117 |
pEntry->SetHierarchyURL( aLinkURL ); |
2118 |
maEntries.Insert( pEntry, nPos ); |
2118 |
maEntries.Insert( pEntry, nPos ); |
Lines 2167-2173
Link Here
|
2167 |
} |
2167 |
} |
2168 |
|
2168 |
|
2169 |
// ----------------------------------------------------------------------- |
2169 |
// ----------------------------------------------------------------------- |
2170 |
EntryData_Impl* RegionData_Impl::GetEntry( const OUString& rName ) const |
2170 |
DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const OUString& rName ) const |
2171 |
{ |
2171 |
{ |
2172 |
sal_Bool bFound = sal_False; |
2172 |
sal_Bool bFound = sal_False; |
2173 |
long nPos = GetEntryPos( rName, bFound ); |
2173 |
long nPos = GetEntryPos( rName, bFound ); |
Lines 2179-2187
Link Here
|
2179 |
} |
2179 |
} |
2180 |
|
2180 |
|
2181 |
// ----------------------------------------------------------------------- |
2181 |
// ----------------------------------------------------------------------- |
2182 |
EntryData_Impl* RegionData_Impl::GetByTargetURL( const OUString& rName ) const |
2182 |
DocTempl_EntryData_Impl* RegionData_Impl::GetByTargetURL( const OUString& rName ) const |
2183 |
{ |
2183 |
{ |
2184 |
EntryData_Impl *pEntry; |
2184 |
DocTempl_EntryData_Impl *pEntry; |
2185 |
|
2185 |
|
2186 |
ULONG nCount = maEntries.Count(); |
2186 |
ULONG nCount = maEntries.Count(); |
2187 |
|
2187 |
|
Lines 2196-2202
Link Here
|
2196 |
} |
2196 |
} |
2197 |
|
2197 |
|
2198 |
// ----------------------------------------------------------------------- |
2198 |
// ----------------------------------------------------------------------- |
2199 |
EntryData_Impl* RegionData_Impl::GetEntry( ULONG nIndex ) const |
2199 |
DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( ULONG nIndex ) const |
2200 |
{ |
2200 |
{ |
2201 |
return maEntries.GetObject( nIndex ); |
2201 |
return maEntries.GetObject( nIndex ); |
2202 |
} |
2202 |
} |
Lines 2204-2210
Link Here
|
2204 |
// ----------------------------------------------------------------------- |
2204 |
// ----------------------------------------------------------------------- |
2205 |
void RegionData_Impl::DeleteEntry( ULONG nIndex ) |
2205 |
void RegionData_Impl::DeleteEntry( ULONG nIndex ) |
2206 |
{ |
2206 |
{ |
2207 |
EntryData_Impl *pEntry = maEntries.GetObject( nIndex ); |
2207 |
DocTempl_EntryData_Impl *pEntry = maEntries.GetObject( nIndex ); |
2208 |
|
2208 |
|
2209 |
if ( pEntry ) |
2209 |
if ( pEntry ) |
2210 |
{ |
2210 |
{ |
Lines 2457-2463
Link Here
|
2457 |
|
2457 |
|
2458 |
OUString aId = xContentAccess->queryContentIdentifierString(); |
2458 |
OUString aId = xContentAccess->queryContentIdentifierString(); |
2459 |
|
2459 |
|
2460 |
EntryData_Impl* pEntry = pRegion->GetByTargetURL( aId ); |
2460 |
DocTempl_EntryData_Impl* pEntry = pRegion->GetByTargetURL( aId ); |
2461 |
|
2461 |
|
2462 |
if ( ! pEntry ) |
2462 |
if ( ! pEntry ) |
2463 |
{ |
2463 |
{ |