Kaydet (Commit) 881585c9 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS c03v6_SRC680 (1.13.110); FILE MERGED

2006/09/20 10:04:16 pb 1.13.110.1: fix: #141137# support for readonly paths
üst f96d8824
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: optpath.cxx,v $ * $RCSfile: optpath.cxx,v $
* *
* $Revision: 1.14 $ * $Revision: 1.15 $
* *
* last change: $Author: obo $ $Date: 2006-09-17 04:32:21 $ * last change: $Author: vg $ $Date: 2006-09-26 14:09:50 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -102,6 +102,10 @@ ...@@ -102,6 +102,10 @@
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#endif #endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif #endif
...@@ -139,6 +143,7 @@ using namespace svx; ...@@ -139,6 +143,7 @@ using namespace svx;
#define POSTFIX_INTERNAL String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_internal" ) ) #define POSTFIX_INTERNAL String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_internal" ) )
#define POSTFIX_USER String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_user" ) ) #define POSTFIX_USER String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_user" ) )
#define POSTFIX_WRITABLE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_writable" ) ) #define POSTFIX_WRITABLE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_writable" ) )
#define POSTFIX_READONLY String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "_readonly" ) )
#define VAR_ONE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "%1" ) ) #define VAR_ONE String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "%1" ) )
// struct OptPath_Impl --------------------------------------------------- // struct OptPath_Impl ---------------------------------------------------
...@@ -370,7 +375,8 @@ void SvxPathTabPage::Reset( const SfxItemSet& ) ...@@ -370,7 +375,8 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
{ {
String aStr( SVX_RES( RID_SVXSTR_PATH_NAME_START + i ) ); String aStr( SVX_RES( RID_SVXSTR_PATH_NAME_START + i ) );
String sInternal, sUser, sWritable; String sInternal, sUser, sWritable;
GetPathList( i, sInternal, sUser, sWritable ); sal_Bool bReadOnly = sal_False;
GetPathList( i, sInternal, sUser, sWritable, bReadOnly );
String sTmpPath = sUser; String sTmpPath = sUser;
if ( sTmpPath.Len() > 0 && sWritable.Len() > 0 ) if ( sTmpPath.Len() > 0 && sWritable.Len() > 0 )
sTmpPath += MULTIPATH_DELIMITER; sTmpPath += MULTIPATH_DELIMITER;
...@@ -379,7 +385,7 @@ void SvxPathTabPage::Reset( const SfxItemSet& ) ...@@ -379,7 +385,7 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
aStr += '\t'; aStr += '\t';
aStr += Convert_Impl( aValue ); aStr += Convert_Impl( aValue );
SvLBoxEntry* pEntry = pPathBox->InsertEntry( aStr ); SvLBoxEntry* pEntry = pPathBox->InsertEntry( aStr );
if ( aPathOpt.IsPathReadonly( (SvtPathOptions::Pathes)i ) ) if ( bReadOnly )
{ {
pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImage, BMP_COLOR_NORMAL ); pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImage, BMP_COLOR_NORMAL );
pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImageHC, BMP_COLOR_HIGHCONTRAST ); pPathBox->SetCollapsedEntryBmp( pEntry, pImpl->m_aLockImageHC, BMP_COLOR_HIGHCONTRAST );
...@@ -471,7 +477,8 @@ IMPL_LINK( SvxPathTabPage, StandardHdl_Impl, PushButton *, EMPTYARG ) ...@@ -471,7 +477,8 @@ IMPL_LINK( SvxPathTabPage, StandardHdl_Impl, PushButton *, EMPTYARG )
if ( aOldPath.Len() ) if ( aOldPath.Len() )
{ {
String sInternal, sUser, sWritable, sTemp; String sInternal, sUser, sWritable, sTemp;
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable ); sal_Bool bReadOnly = sal_False;
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
USHORT i; USHORT i;
USHORT nOldCount = aOldPath.GetTokenCount( MULTIPATH_DELIMITER ); USHORT nOldCount = aOldPath.GetTokenCount( MULTIPATH_DELIMITER );
...@@ -523,7 +530,8 @@ IMPL_LINK( SvxPathTabPage, PathHdl_Impl, PushButton *, EMPTYARG ) ...@@ -523,7 +530,8 @@ IMPL_LINK( SvxPathTabPage, PathHdl_Impl, PushButton *, EMPTYARG )
if ( pEntry ) if ( pEntry )
{ {
PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData(); PathUserData_Impl* pPathImpl = (PathUserData_Impl*)pEntry->GetUserData();
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable ); sal_Bool bReadOnly = sal_False;
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
sUser = pPathImpl->sUserPath; sUser = pPathImpl->sUserPath;
sWritable = pPathImpl->sWritablePath; sWritable = pPathImpl->sWritablePath;
} }
...@@ -701,7 +709,8 @@ IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar ) ...@@ -701,7 +709,8 @@ IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxPathTabPage::GetPathList( void SvxPathTabPage::GetPathList(
USHORT _nPathHandle, String& _rInternalPath, String& _rUserPath, String& _rWritablePath ) USHORT _nPathHandle, String& _rInternalPath,
String& _rUserPath, String& _rWritablePath, sal_Bool& _rReadOnly )
{ {
String sCfgName = getCfgName_Impl( _nPathHandle ); String sCfgName = getCfgName_Impl( _nPathHandle );
...@@ -759,6 +768,12 @@ void SvxPathTabPage::GetPathList( ...@@ -759,6 +768,12 @@ void SvxPathTabPage::GetPathList(
::rtl::OUString sWritablePath; ::rtl::OUString sWritablePath;
if ( aAny >>= sWritablePath ) if ( aAny >>= sWritablePath )
_rWritablePath = String( sWritablePath ); _rWritablePath = String( sWritablePath );
// and the readonly flag
sProp = sCfgName;
Reference< XPropertySetInfo > xInfo = pImpl->m_xPathSettings->getPropertySetInfo();
Property aProp = xInfo->getPropertyByName( sProp );
_rReadOnly = ( ( aProp.Attributes & PropertyAttribute::READONLY ) == PropertyAttribute::READONLY );
} }
} }
catch( const Exception& ) catch( const Exception& )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment