[ooo-build-commit] Branch 'ooo/OOO320' - 3 commits - linguistic/source sfx2/inc sfx2/source svx/source ucb/source xmlhelp/source xmloff/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Mon Nov 23 18:22:53 PST 2009
linguistic/source/hyphdsp.cxx | 14 ++-
linguistic/source/spelldsp.cxx | 11 +-
linguistic/source/thesdsp.cxx | 8 +
sfx2/inc/sfx2/mnuitem.hxx | 9 +-
sfx2/source/doc/docfile.cxx | 11 ++
sfx2/source/doc/makefile.mk | 8 +
sfx2/source/doc/sfxacldetect.cxx | 108 ++++++++++++++++++++++++++
sfx2/source/menu/mnuitem.cxx | 20 ++++
sfx2/source/menu/virtmenu.cxx | 20 ++--
svx/source/cui/cuicharmap.cxx | 5 -
ucb/source/ucp/webdav/DAVResourceAccess.cxx | 5 -
ucb/source/ucp/webdav/NeonSession.cxx | 7 +
xmlhelp/source/cxxhelp/provider/databases.cxx | 20 ++++
xmloff/source/text/txtimp.cxx | 48 +++++------
xmloff/source/text/txtparae.cxx | 31 ++++---
15 files changed, 257 insertions(+), 68 deletions(-)
New commits:
commit 94cdfeb628108625040ea35c596a6742a9778d6d
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Mon Nov 23 17:21:39 2009 +0000
CWS-TOOLING: integrate CWS sw32bf07
2009-11-16 13:33:38 +0100 mst r277514 : #i106930#: thints.cxx: isNestedAny: new empty hints at start/end _not_ nested
2009-11-13 10:55:40 +0100 mst r277494 : #i100658#: SwDocInfoField::Expand(): do not add properties that are not found
2009-11-13 10:38:27 +0100 od r277493 : #i106218# method <XMLTextImportHelper::SetOutlineStyles(..)>
- First collect all paragraph styles chosen for assignment to the outline style.
Then perform the intrinsic assignment.
Reason: side effect of assignment in Writer.
2009-11-13 10:32:21 +0100 od r277492 : #i106218# method <HasOutlineStyleToBeWrittenAsNormalListStyle(..)>
- consider that the outline style itself is set at the parent paragraph style of
one of the to the outline style assigned paragraph styles.
2009-11-13 09:30:06 +0100 os r277490 : #i106730# load styles from source, not from working document
2009-11-13 07:24:13 +0100 os r277489 : #i106859# crash fixed
2009-11-12 15:29:09 +0100 od r277480 : #i103745# method <XMLTextParagraphExport::exportListChange(..)>
- correct handling of restart without start value on list level 1
diff --git a/svx/source/cui/cuicharmap.cxx b/svx/source/cui/cuicharmap.cxx
index a66c7b3..d06d962 100644
--- a/svx/source/cui/cuicharmap.cxx
+++ b/svx/source/cui/cuicharmap.cxx
@@ -71,11 +71,12 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, BOOL bOne, const SfxItemSet*
if ( pItem )
bOne = pItem->GetValue();
+ mpCharMapData = new SvxCharMapData( this, bOne, &DIALOG_MGR() );
+
SFX_ITEMSET_ARG( pSet, pCharItem, SfxInt32Item, SID_ATTR_CHAR, FALSE );
if ( pCharItem )
- SetChar( pItem->GetValue() );
+ SetChar( pCharItem->GetValue() );
- mpCharMapData = new SvxCharMapData( this, bOne, &DIALOG_MGR() );
SFX_ITEMSET_ARG( pSet, pDisableItem, SfxBoolItem, FN_PARAM_2, FALSE );
if ( pDisableItem && pDisableItem->GetValue() )
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 23422c1..5e59f12 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1508,8 +1508,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
return sStyleName;
}
-// --> OD 2006-10-12 #i69629#
-// adjustments to reflect change of internal data structure <mpOutlineStylesCandidates>
void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
sal_Int8 nOutlineLevel )
{
@@ -1560,9 +1558,7 @@ void XMLTextImportHelper::FindOutlineStyleName( ::rtl::OUString& rStyleName,
}
// else: we already had a style name, so we let it pass.
}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel,
const OUString& rStyleName )
{
@@ -1585,16 +1581,13 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel
mpOutlineStylesCandidates[nOutlineLevel-1].push_back( rStyleName );
}
}
-// <--
-// --> OD 2006-10-12 #i69629#
void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) &&
xChapterNumbering.is() &&
!IsInsertMode() )
{
- // --> OD 2007-12-19 #152540#
bool bChooseLastOne( false );
{
if ( GetXMLImport().IsTextDocInOOoFileFormat() )
@@ -1607,15 +1600,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
sal_Int32 nBuild( 0 );
if ( GetXMLImport().getBuildIds( nUPD, nBuild ) )
{
- // --> OD 2008-03-19 #i86058#
// check explicitly on certain versions
bChooseLastOne = ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
( nUPD == 680 && nBuild <= 9073 ); // OOo 2.0 - OOo 2.0.4
- // <--
}
}
}
- // <--
OUString sOutlineStyleName;
{
@@ -1624,8 +1614,15 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
xChapterNumRule->getPropertyValue(sName) >>= sOutlineStyleName;
}
- OUString sEmpty;
- sal_Int32 nCount = xChapterNumbering->getCount();
+ const sal_Int32 nCount = xChapterNumbering->getCount();
+ // --> OD 2009-11-13 #i106218#
+ // First collect all paragraph styles choosen for assignment to each
+ // list level of the outline style, then perform the intrinsic assignment.
+ // Reason: The assignment of a certain paragraph style to a list level
+ // of the outline style causes side effects on the children
+ // paragraph styles in Writer.
+ ::std::vector<OUString> sChosenStyles(nCount);
+ // <--
for( sal_Int32 i=0; i < nCount; ++i )
{
if ( bSetEmptyLevels ||
@@ -1634,17 +1631,12 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
{
// determine, which candidate is one to be assigned to the list
// level of the outline style
- OUString sChoosenStyle( sEmpty );
if ( mpOutlineStylesCandidates &&
!mpOutlineStylesCandidates[i].empty() )
{
- // --> OD 2007-12-19 #152540#
if ( bChooseLastOne )
- // <--
{
- // --> OD 2006-11-06 #i71249# - take last added one
- sChoosenStyle = mpOutlineStylesCandidates[i].back();
- // <--
+ sChosenStyles[i] = mpOutlineStylesCandidates[i].back();
}
else
{
@@ -1655,24 +1647,26 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
sNumberingStyleName,
sOutlineStyleName ) )
{
- sChoosenStyle = mpOutlineStylesCandidates[i][j];
+ sChosenStyles[i] = mpOutlineStylesCandidates[i][j];
break;
}
}
}
}
-
- Sequence < PropertyValue > aProps( 1 );
- PropertyValue *pProps = aProps.getArray();
- pProps->Name = sHeadingStyleName;
- pProps->Value <<= sChoosenStyle;
-
- xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
}
}
+ // --> OD 2009-11-13 #i106218#
+ Sequence < PropertyValue > aProps( 1 );
+ PropertyValue *pProps = aProps.getArray();
+ pProps->Name = sHeadingStyleName;
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ pProps->Value <<= sChosenStyles[i];
+ xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
+ }
+ // <--
}
}
-// <--
void XMLTextImportHelper::SetHyperlink(
SvXMLImport& rImport,
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 69e7392..21df9d3 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -807,6 +807,11 @@ void XMLTextParagraphExport::exportListChange(
}
}
+ const bool bExportODF =
+ ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0;
+ const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion =
+ GetExport().getDefaultVersion();
+
// start a new list
if ( rNextInfo.GetLevel() > 0 )
{
@@ -829,10 +834,6 @@ void XMLTextParagraphExport::exportListChange(
if ( nListLevelsToBeOpened > 0 )
{
- const bool bExportODF =
- ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0;
- const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion =
- GetExport().getDefaultVersion();
const ::rtl::OUString sListStyleName( rNextInfo.GetNumRulesName() );
// Currently only the text documents support <ListId>.
// Thus, for other document types <sListId> is empty.
@@ -1038,16 +1039,14 @@ void XMLTextParagraphExport::exportListChange(
pListElements->Remove( pListElements->Count()-1 );
delete pElem;
- if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() )
+ // --> OD 2009-11-12 #i103745# - only for sub lists
+ if ( rNextInfo.IsRestart() && !rNextInfo.HasStartValue() &&
+ rNextInfo.GetLevel() != 1 )
+ // <--
{
// start new sub list respectively list on same list level
pElem = (*pListElements)[pListElements->Count()-1];
GetExport().EndElement( *pElem, sal_True );
- if ( rNextInfo.GetLevel() == 1 )
- {
- GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME,
- GetExport().EncodeStyleName( rNextInfo.GetNumRulesName() ) );
- }
GetExport().IgnorableWhitespace();
GetExport().StartElement( *pElem, sal_False );
}
@@ -1059,8 +1058,18 @@ void XMLTextParagraphExport::exportListChange(
OUStringBuffer aBuffer;
aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
- aBuffer.makeStringAndClear() );
+ aBuffer.makeStringAndClear() );
+ }
+ // --> OD 2009-11-12 #i103745# - handle restart without start value on list level 1
+ else if ( rNextInfo.IsRestart() && /*!rNextInfo.HasStartValue() &&*/
+ rNextInfo.GetLevel() == 1 )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.append( (sal_Int32)rNextInfo.GetListLevelStartValue() );
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
+ aBuffer.makeStringAndClear() );
}
+ // <--
if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 &&
GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
{
commit ccbbbc821d52f4aea292663f10d8eec5a05f1fa4
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Mon Nov 23 15:37:14 2009 +0000
CWS-TOOLING: integrate CWS tkr29
2009-11-17 09:00:39 +0100 tkr r277528 : #i106766# ::Abort Method disabled
2009-11-12 07:37:32 +0100 tkr r277468 : #i106766# Disable XCommandProcessor::Abort
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index e203c89..f26caae 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -555,8 +555,9 @@ void DAVResourceAccess::GET(
void DAVResourceAccess::ABORT()
throw( DAVException )
{
- initialize();
- m_xSession->ABORT();
+ // 17.11.09 (tkr): abort currently disabled caused by issue i106766
+ // initialize();
+ // m_xSession->ABORT();
}
//=========================================================================
namespace {
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 338d584..2600c10 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -1319,8 +1319,11 @@ void NeonSession::POST( const rtl::OUString & inPath,
void NeonSession::ABORT()
throw ( DAVException )
{
- if (NULL !=m_pHttpSession)
- ne_close_connection(m_pHttpSession);
+ // 11.11.09 (tkr): The following code lines causing crashes if closing a ongoing connection. It turned out that this existing solution doesn't work in multi-threading environments.
+ // So I disabled them in 3.2. . Issue #73893# should fix it in OOo 3.3.
+
+ //if (NULL !=m_pHttpSession)
+ // ne_close_connection(m_pHttpSession);
}
// -------------------------------------------------------------------
commit 0066f54e3b1b17be8da0daf902d6d84b46d4367b
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Mon Nov 23 15:33:39 2009 +0000
CWS-TOOLING: integrate CWS fwk125
2009-11-19 08:11:20 +0100 jsk r277554 : fwk125: #i105760# - removed warnlog, re-enabled autotest e_help.bas
2009-11-16 16:21:49 +0100 tl r277521 : #i106571# fixed locale list for dictionaries to get rid of duplicate entries
2009-11-12 08:47:31 +0100 hde r277469 : rework of hyphenation
2009-11-11 15:25:16 +0100 hde r277462 : rework of hyphenation
2009-11-11 15:24:09 +0100 hde r277461 : rework of hyphenation
2009-11-11 13:52:02 +0100 hde r277453 : new include for hyphenation tools
2009-11-10 12:28:51 +0100 tl r277427 : #i102304# fix for hyphenation dialog
2009-11-10 12:00:10 +0100 mav r277425 : #i10000# A workaround for pch and windows headers conflict
2009-11-10 11:58:32 +0100 mav r277424 : #i10000# A workaround for pch and windows headers conflict
2009-11-09 15:47:59 +0100 kso r277414 : #i16732# fixed url matching.
2009-11-09 11:51:40 +0100 mav r277406 : #i10000# use precompiled headers
2009-11-08 23:53:03 +0100 mav r277399 : #i10000# fix warning
2009-11-08 23:50:23 +0100 mav r277398 : #i10000# adapt for unix
2009-11-08 23:49:52 +0100 mav r277397 : #i10000# adapt for unix
2009-11-08 21:26:06 +0100 mav r277396 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320 at 277373 (milestone: OOO320:m4)
2009-11-06 16:30:27 +0100 ab r277394 : #i106100# Hold references to packages to speed up further calls to getDeployedPackages()
2009-11-06 15:58:48 +0100 mav r277392 : #i102464# check the Windows ACL
2009-11-06 15:58:23 +0100 mav r277391 : #i102464# check the Windows ACL
2009-11-04 11:54:06 +0100 tl r277342 : #i106497# incorrectly found 'supported languages' fixed
2009-11-04 10:40:51 +0100 tl r277335 : #i106571# dictionary updates for Polish and Swedish.
2009-10-28 09:54:41 +0100 tl r277236 : #i106100# context menu performance
2009-10-27 15:47:05 +0100 tl r277213 : #i106100# context menu performance
2009-10-23 17:31:56 +0200 mav r277170 : #i106075# use correct path to inprocserv.dll
2009-10-23 16:07:27 +0200 mav r277168 : #i105760# seek the temporary file to beginning also for URL case
2009-10-23 11:03:58 +0200 mav r277134 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320 at 276942 (milestone: OOO320:m2)
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 7bc8c34..3922e9f 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -275,7 +275,8 @@ Reference< XHyphenatedWord > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
BOOL bWordModified = FALSE;
if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen))
@@ -418,7 +419,8 @@ Reference< XHyphenatedWord > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
BOOL bWordModified = FALSE;
if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2))
@@ -555,7 +557,8 @@ Reference< XPossibleHyphens > SAL_CALL
return xRes;
// search for entry with that language
- LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get();
+ HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -713,8 +716,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this;
- const LangSvcEntries_Hyph *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this;
+ const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
{
aRes = pEntry->aSvcImplNames;
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index e88a509..6f0682e 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -330,7 +330,8 @@ BOOL SpellCheckerDispatcher::isValid_Impl(
return bRes;
// search for entry with that language
- LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get();
+ SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -497,7 +498,8 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
return xRes;
// search for entry with that language
- LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get();
+ SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -847,8 +849,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this;
- const LangSvcEntries_Spell *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this;
+ const SpellSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
aRes = pEntry->aSvcImplNames;
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index 9ba9f9f..3f3e7ed 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -136,7 +136,8 @@ Sequence< Reference< XMeaning > > SAL_CALL
return aMeanings;
// search for entry with that language
- LangSvcEntries_Thes *pEntry = aSvcMap[ nLanguage ].get();
+ ThesSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) );
+ LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (!pEntry)
{
@@ -264,8 +265,9 @@ Sequence< OUString >
// search for entry with that language and use data from that
INT16 nLanguage = LocaleToLanguage( rLocale );
- ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this;
- const LangSvcEntries_Thes *pEntry = pThis->aSvcMap[ nLanguage ].get();
+ ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this;
+ const ThesSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) );
+ const LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL;
if (pEntry)
aRes = pEntry->aSvcImplNames;
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 8ab848b..fd06202 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -90,9 +90,9 @@ public:
virtual void StateChanged( USHORT nSID, SfxItemState eState,
const SfxPoolItem* pState );
- static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & );
- static SfxUnoMenuControl*
- CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* );
+ static SfxMenuControl* CreateControl( USHORT nId, Menu &, SfxBindings & );
+ static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, SfxBindings&, SfxVirtualMenu* );
+ static SfxUnoMenuControl* CreateControl( const String&, USHORT, Menu&, const String& sItemText, const String& sHelpText, SfxBindings&, SfxVirtualMenu* );
static BOOL IsSpecialControl( USHORT nId, SfxModule* );
static void RegisterMenuControl(SfxModule*, SfxMenuCtrlFactory*);
@@ -104,6 +104,9 @@ class SfxUnoMenuControl : public SfxMenuControl
public:
SfxUnoMenuControl( const String&, USHORT nId, Menu&,
SfxBindings&, SfxVirtualMenu* );
+ SfxUnoMenuControl( const String&, USHORT nId, Menu&,
+ const String&, const String&,
+ SfxBindings&, SfxVirtualMenu* );
~SfxUnoMenuControl();
void Select();
};
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f44ac7c..445508e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -155,6 +155,8 @@ using namespace ::com::sun::star::io;
#define MAX_REDIRECT 5
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
+
//==========================================================
namespace {
@@ -1145,6 +1147,15 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
}
catch( uno::Exception )
{}
+
+ if ( !bContentReadonly )
+ {
+ // the file is not readonly, check the ACL
+
+ String aPhysPath;
+ if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
+ bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() );
+ }
}
// do further checks only if the file not readonly in fs
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index 1b42844..66fd031 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -86,11 +86,19 @@ SLOFILES = \
$(SLO)$/DocumentMetadataAccess.obj \
$(SLO)$/Metadatable.obj \
$(SLO)$/sfxmodelfactory.obj \
+ $(SLO)$/sfxacldetect.obj \
$(SLO)$/docstoragemodifylistener.obj \
$(SLO)$/querytemplate.obj
# $(SLO)$/applet.obj \
+.IF "$(GUI)" == "WNT"
+
+#HACK TO DISABLE PCH
+NOOPTFILES= \
+ $(SLO)$/sfxacldetect.obj
+.ENDIF
+
# --- Tagets -------------------------------------------------------
diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
new file mode 100755
index 0000000..94370e9
--- /dev/null
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: shutdowniconw32.cxx,v $
+ * $Revision: 1.48 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifdef WNT
+
+// necessary to include system headers without warnings
+#ifdef _MSC_VER
+#pragma warning(disable:4668 4917)
+#endif
+
+#include <windows.h>
+#include <lmaccess.h>
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath )
+{
+ sal_Bool bResult = sal_False;
+
+ sal_uInt32 nFDSize = 0;
+ GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize );
+ if ( nFDSize )
+ {
+ PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) );
+ if ( GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) )
+ {
+ HANDLE hToken = NULL;
+ if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken )
+ || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) )
+ {
+ HANDLE hImpersonationToken = NULL;
+ if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) )
+ {
+ sal_uInt32 nDesiredAccess = ACCESS_WRITE;
+ GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE };
+ MapGenericMask( &nDesiredAccess, &aGenericMapping );
+
+ PRIVILEGE_SET aPrivilegeSet;
+ sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET );
+
+ sal_uInt32 nGrantedAccess;
+ BOOL bAccessible = TRUE;
+ if ( AccessCheck( pFileDescr,
+ hImpersonationToken,
+ nDesiredAccess,
+ &aGenericMapping,
+ &aPrivilegeSet,
+ &nPrivilegeSetSize,
+ &nGrantedAccess,
+ &bAccessible ) )
+ {
+ bResult = !bAccessible;
+ }
+
+ CloseHandle( hImpersonationToken );
+ }
+
+ CloseHandle( hToken );
+ }
+ }
+
+ free( pFileDescr );
+ }
+
+ return bResult;
+}
+
+#else // this is UNX
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
+{
+ // to be implemented
+ return sal_False;
+}
+
+#endif
+
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 1974c4e..804db9f 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -542,6 +542,13 @@ SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
return new SfxUnoMenuControl( rCmd, nId, rMenu, rBindings, pVirt );
}
+SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
+ USHORT nId, Menu& rMenu, const String& sItemText, const String& sHelpText,
+ SfxBindings& rBindings, SfxVirtualMenu* pVirt)
+{
+ return new SfxUnoMenuControl( rCmd, nId, rMenu, sItemText, sHelpText, rBindings, pVirt);
+}
+
SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt )
: SfxMenuControl( nSlotId, rBindings )
@@ -554,6 +561,19 @@ SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nSlotId,
pUnoCtrl->GetNewDispatch();
}
+SfxUnoMenuControl::SfxUnoMenuControl(
+ const String& rCmd, USHORT nSlotId, Menu& /*rMenu*/,
+ const String& rItemText, const String& rHelpText,
+ SfxBindings& rBindings, SfxVirtualMenu* pVirt)
+ : SfxMenuControl( nSlotId, rBindings )
+{
+ Bind( pVirt, nSlotId, rItemText, rHelpText, rBindings);
+ UnBind();
+ pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
+ pUnoCtrl->acquire();
+ pUnoCtrl->GetNewDispatch();
+}
+
SfxUnoMenuControl::~SfxUnoMenuControl()
{
pUnoCtrl->UnBind();
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 5c42c0e..b9fca30 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -421,8 +421,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
DELETEZ( pPopup );
}
+ const String sItemText = pSVMenu->GetItemText(nSlotId);
+ const String sHelpText = pSVMenu->GetHelpText(nSlotId);
+
if ( pPopup )
{
+
SfxMenuControl *pMnuCtrl =
SfxMenuControl::CreateControl(nSlotId, *pPopup, *pBindings);
@@ -438,10 +442,8 @@ void SfxVirtualMenu::CreateFromSVMenu()
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() );
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId),
- pSVMenu->GetHelpText(nSlotId), *pBindings);
- pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId),
- pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
{
@@ -477,7 +479,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
pMnuCtrl->Bind( this, nSlotId,
*new SfxVirtualMenu(nSlotId, this, *pPopup, bHelpInitialized, *pBindings, bOLE, bResCtor),
- pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId),
+ sItemText, sHelpText,
*pBindings );
}
}
@@ -514,12 +516,12 @@ void SfxVirtualMenu::CreateFromSVMenu()
if ( aCmd.Len() && (( nSlotId < SID_SFX_START ) || ( nSlotId > SHRT_MAX )) )
{
// try to create control via comand name
- pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, *pBindings, this );
+ pMnuCtrl = SfxMenuControl::CreateControl( aCmd, nSlotId, *pSVMenu, sItemText, sHelpText, *pBindings, this );
if ( pMnuCtrl )
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
}
}
@@ -531,13 +533,13 @@ void SfxVirtualMenu::CreateFromSVMenu()
{
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
- (pItems+nPos)->Bind( 0, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ (pItems+nPos)->Bind( 0, nSlotId, sItemText, sHelpText, *pBindings);
}
else
// take default control
pMnuCtrl = (pItems+nPos);
- pMnuCtrl->Bind( this, nSlotId, pSVMenu->GetItemText(nSlotId), pSVMenu->GetHelpText(nSlotId), *pBindings);
+ pMnuCtrl->Bind( this, nSlotId, sItemText, sHelpText, *pBindings);
}
if ( Application::GetSettings().GetStyleSettings().GetUseImagesInMenus() )
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index a03f501..92ad044 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -137,6 +137,19 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
return aRetURL;
}
+
+// Hold Packages to improve performance (#i106100)
+// The PackageManager implementation seems to completely throw away all cached data
+// as soon as the last reference to a XPackage dies. Maybe this should be changed.
+struct ImplPackageSequenceHolder
+{
+ Sequence< Reference< deployment::XPackage > > m_aUserPackagesSeq;
+ Sequence< Reference< deployment::XPackage > > m_aSharedPackagesSeq;
+};
+
+static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
+
+
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
@@ -187,6 +200,8 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
+
+ GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
Databases::~Databases()
@@ -235,6 +250,7 @@ Databases::~Databases()
}
}
+ delete GpPackageSequenceHolder;
}
static bool impl_getZipFile(
@@ -1530,6 +1546,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
m_aUserPackagesSeq = xUserManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aUserPackagesSeq = m_aUserPackagesSeq;
m_bUserPackagesLoaded = true;
}
@@ -1560,6 +1578,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aSharedPackagesSeq = m_aSharedPackagesSeq;
m_bSharedPackagesLoaded = true;
}
More information about the ooo-build-commit
mailing list