summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-09-16 16:17:27 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-09-16 16:17:27 +0000
commit8c895561f63ed7161947a04da8e6a3d3fb195fa7 (patch)
tree0c1c450c45fdeb8cdc550eebe3e58ae2f58e57cd /sfx2
parentcb6a7b19436d658990b582c98612d95da8d17afd (diff)
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
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx16
-rw-r--r--sfx2/source/doc/doctemplates.cxx10
-rw-r--r--sfx2/source/doc/graphhelp.cxx27
3 files changed, 23 insertions, 30 deletions
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 <sfx2/docfac.hxx>
+#include <sfx2/docfile.hxx>
#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();