From 8c895561f63ed7161947a04da8e6a3d3fb195fa7 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Wed, 16 Sep 2009 16:17:27 +0000
Subject: CWS-TOOLING: integrate CWS fwk116 2009-09-03 Mikhail Voytenko
#i101453# write the default values for old entries 2009-09-03 Mikhail
Voytenko #i101453# let the new default value be used 2009-09-03 Mikhail
Voytenko #i101453# revert the change for xslt-transformation, the duplicate
nodes should not be allowed 2009-09-03 Mikhail Voytenko #i101453# allow
duplicate nodes for different modules 2009-09-03 Mikhail Voytenko #i101453#
fix the special mac installation 2009-09-02 Mikhail Voytenko #i101453#
correct the usage of configuration files 2009-09-02 Mikhail Voytenko #i10000#
fix warning 2009-09-02 Mikhail Voytenko #i10000# fix warning 2009-09-02
Mikhail Voytenko #i96918# try to open the file for editing always 2009-09-02
Mikhail Voytenko #i51058# remove unused strings 2009-09-02 Mikhail Voytenko
#i51058# remove unused strings 2009-09-01 Mikhail Voytenko #i10000# fix typo
2009-08-30 Mikhail Voytenko Rebase on DEV300_m56 2009-08-19 Mikhail Voytenko
#i101732# do not generate a transparent bitmap for thumbnail 2009-08-13
Mikhail Voytenko #i101453# do not use system temporary location on Mac
2009-08-13 Mikhail Voytenko #i101453# do not use system temporary location on
Mac 2009-08-07 Mikhail Voytenko #i103617# fix warning 2009-07-31 Carsten
Driesner #i103924# Fix wrong number of arguments 2009-07-31 Mikhail Voytenko
#i101207# integrate the patch 2009-07-31 Mikhail Voytenko #i103783# integrate
the patch; get rid of CRLF 2009-07-31 Mikhail Voytenko #i97969# integrate the
patch 2009-07-27 Carsten Driesner #i103423# Use correct request count in the
ctor. Don't descrease value before checking the request count
---
sfx2/source/doc/docfile.cxx | 16 ++++++++++++++--
sfx2/source/doc/doctemplates.cxx | 10 ++++++++--
sfx2/source/doc/graphhelp.cxx | 27 +--------------------------
3 files changed, 23 insertions(+), 30 deletions(-)
(limited to 'sfx2')
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 23093bfa066f..3fec8e40bfb7 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1231,9 +1231,20 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
if ( !bResult && !IsReadOnly() )
{
// check whether the file is readonly in fs
+ // the check is only necessary if
// do it only for loading, some contents still might have problems with this property, let them not affect the saving
sal_Bool bContentReadonly = sal_False;
- if ( bLoading )
+ if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
+ {
+ // let the stream be opened to check the possibility to open it for editing
+ GetMedium_Impl();
+ }
+
+ // "IsReadOnly" property does not allow to detect whether the file is readonly always
+ // so we try always to open the file for editing
+ // the file is readonly only in case the read-write stream can not be opened
+ SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
+ if ( bLoading && !pWriteStreamItem )
{
try
{
@@ -1244,11 +1255,12 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
{}
}
+ // do further checks only if the file not readonly in fs
if ( !bContentReadonly )
{
+ // the special file locking should be used only for file URLs
if ( ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
{
- // the special file locking should be used only for file URLs
// in case of storing the document should request the output before locking
if ( bLoading )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 7df93afaa63e..099e649506c0 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -72,6 +72,7 @@
#include "sfxurlrelocator.hxx"
#include "doctemplateslocal.hxx"
#include
+#include
#include "doc.hrc"
//-----------------------------------------------------------------------------
@@ -909,7 +910,8 @@ sal_Bool SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU
Content aParent;
- if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), maCmdEnv, aParent ) )
+ uno::Reference< XCommandEnvironment > aQuietEnv;
+ if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), aQuietEnv, aParent ) )
{
for ( sal_Int32 nInd = 0; nInd < 32000; nInd++ )
{
@@ -1919,7 +1921,11 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
aStoreArgs[1].Name = ::rtl::OUString::createFromAscii( "DocumentTitle" );
aStoreArgs[1].Value <<= rTemplateName;
- rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
+ ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation();
+ if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() ))
+ rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs );
+ else
+ rStorable->store();
// the storing was successful, now the old template with the same name can be removed if it existed
if ( aTemplateToRemoveTargetURL.getLength() )
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index f1e6cc80812e..bd0e65830870 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -374,32 +374,7 @@ sal_Bool GraphicHelper::createThumb_Impl( const GDIMetaFile& rMtf,
if ( aBmp.GetBitCount() != 24 )
aBmp.Convert( BMP_CONVERSION_24BIT );
- // create resulting mask bitmap with metafile output set to black
- GDIMetaFile aMonchromeMtf( rMtf.GetMonochromeMtf( COL_BLACK ) );
- aVDev.DrawWallpaper( Rectangle( aNullPt, aSizePix ), Wallpaper( Color( COL_WHITE ) ) );
- aMonchromeMtf.WindStart();
- aMonchromeMtf.Play( &aVDev, aBackPosPix, aDrawSize );
-
- // watch for overlay mask
- if ( pOverlay )
- {
- Bitmap aOverlayMergeBmp( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ) );
-
- // create ANDed resulting mask at overlay area
- if ( pOverlay->IsTransparent() )
- aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), pOverlay->GetMask() );
- else
- {
- aVDev.SetLineColor( COL_BLACK );
- aVDev.SetFillColor( COL_BLACK );
- aVDev.DrawRect( aOverlayRect);
- }
-
- aOverlayMergeBmp.CombineSimple( aVDev.GetBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize() ), BMP_COMBINE_AND );
- aVDev.DrawBitmap( aOverlayRect.TopLeft(), aOverlayRect.GetSize(), aOverlayMergeBmp );
- }
-
- rBmpEx = BitmapEx( aBmp, aVDev.GetBitmap( aNullPt, aVDev.GetOutputSizePixel() ) );
+ rBmpEx = BitmapEx( aBmp );
}
return !rBmpEx.IsEmpty();
--
cgit v1.2.3