Commits

Anonymous committed 990c19f Merge

CWS-TOOLING: integrate CWS os151

Comments (0)

Files changed (8)

svx/inc/svx/xoutbmp.hxx

 #define XOUTBMP_CONTOUR_HORZ			0x00000001L
 #define XOUTBMP_CONTOUR_VERT			0x00000002L
 #define XOUTBMP_CONTOUR_EDGEDETECT		0x00000004L
+#define XOUTBMP_DONT_ADD_EXTENSION      0x00000008L
 
 #define XOUTBMP_DONT_EXPAND_FILENAME	0x10000000L
 #define XOUTBMP_USE_GIF_IF_POSSIBLE		0x20000000L

svx/source/xoutdev/_xoutbmp.cxx

 
 			if( aExt.Len() )
 			{
-				aURL.setExtension( aExt );
+                if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+                    aURL.setExtension( aExt );
 				rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
 				SfxMedium	aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC, sal_True );
 
 				if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) )
 				{
-					aURL.setExtension( aExt );
+                    if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+                        aURL.setExtension( aExt );
 					rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
 					nErr = ExportGraphic( aGraphic, aURL, *pFilter, nFilter, NULL );
 				}

sw/source/core/draw/dflyobj.cxx

 |*
 *************************************************************************/
 
+// --> OD #i102707#
+namespace
+{
+    class RestoreMapMode
+    {
+        public:
+            explicit RestoreMapMode( ViewShell* pViewShell )
+                : mbMapModeRestored( false )
+                , mpOutDev( pViewShell->GetOut() )                    
+            {
+                if ( pViewShell->getPrePostMapMode() != mpOutDev->GetMapMode() )
+                {
+                    mpOutDev->Push(PUSH_MAPMODE);
+                    
+                    GDIMetaFile* pMetaFile = mpOutDev->GetConnectMetaFile();
+                    if ( pMetaFile && 
+                         pMetaFile->IsRecord() && !pMetaFile->IsPause() )
+                    {
+                        ASSERT( false,
+                                "MapMode restoration during meta file creation is somehow suspect - using <SetRelativeMapMode(..)>, but not sure, if correct." )
+                        mpOutDev->SetRelativeMapMode( pViewShell->getPrePostMapMode() );
+                    }
+                    else
+                    {
+                        mpOutDev->SetMapMode( pViewShell->getPrePostMapMode() );
+                    }
+                    
+                    mbMapModeRestored = true;
+                }
+            };
+
+            ~RestoreMapMode()
+            {
+                if ( mbMapModeRestored )
+                {
+                    mpOutDev->Pop();
+                }
+            };            
+
+        private:
+            bool mbMapModeRestored;
+            OutputDevice* mpOutDev;
+    };
+}
+// <--
+
 void SwVirtFlyDrawObj::wrap_DoPaintObject() const
 {
     ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
     // but no paints. IsPaintInProgress() depends on SW repaint, so, as long
     // as SW paints self and calls DrawLayer() for Heaven and Hell, this will
     // be correct
-    if(pShell && pShell->IsDrawingLayerPaintInProgress())
+    if ( pShell && pShell->IsDrawingLayerPaintInProgress() )
     {
         sal_Bool bDrawObject(sal_True);
 
-	    if(!SwFlyFrm::IsPaint((SdrObject*)this, pShell))
+        if ( !SwFlyFrm::IsPaint( (SdrObject*)this, pShell ) )
 	    {
 		    bDrawObject = sal_False;
 	    }
 
-	    if(bDrawObject)
+        if ( bDrawObject )
 	    {
-		    if(!pFlyFrm->IsFlyInCntFrm())
+            if ( !pFlyFrm->IsFlyInCntFrm() )
 		    {
 				// it is also necessary to restore the VCL MapMode from ViewInformation since e.g.
 				// the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this
 				// excludes shears and rotates which are not expressable in MapMode.
-                OutputDevice* pOut = pShell->GetOut();
-
-				pOut->Push(PUSH_MAPMODE);
-				pOut->SetMapMode(pShell->getPrePostMapMode());
+                // OD #i102707# 
+                // new helper class to restore MapMode - restoration, only if 
+                // needed and consideration of paint for meta file creation .
+                RestoreMapMode aRestoreMapModeIfNeeded( pShell );
 
 				// paint the FlyFrame (use standard VCL-Paint)
-			    pFlyFrm->Paint(GetFlyFrm()->Frm());
-
-				pOut->Pop();
+                pFlyFrm->Paint( GetFlyFrm()->Frm() );
 		    }
 	    }
     }

sw/source/ui/app/docsh2.cxx

 		case FN_OUTLINE_TO_CLIPBOARD:
 		case FN_OUTLINE_TO_IMPRESS:
 			{
+				sal_Bool bEnable = IsEnableSetModified();
+				EnableSetModified( sal_False );
 				WriterRef xWrt;
                 // mba: looks as if relative URLs don't make sense here
                 ::GetRTFWriter( 'O', String(), xWrt );
 				pStrm->SetBufferSize( 16348 );
 				SwWriter aWrt( *pStrm, *GetDoc() );
 				ErrCode eErr = aWrt.Write( xWrt );
+				EnableSetModified( bEnable );
 				if( !ERRCODE_TOERROR( eErr ) )
 				{
 					pStrm->Seek( STREAM_SEEK_TO_END );

sw/source/ui/dochdl/swdtflvr.cxx

 
 #define DDE_TXT_ENCODING 	gsl_getSystemTextEncoding()
 
-//---------------------------------------------
-// this struct conforms to the Microsoft
-// OBJECTDESCRIPTOR -> see oleidl.h
-// (MS platform sdk)
-//---------------------------------------------
-
-struct OleObjectDescriptor
-{
-        sal_uInt32      cbSize;
-        ClsId           clsid;
-        sal_uInt32      dwDrawAspect;
-        Size            sizel;
-        Point           pointl;
-        sal_uInt32      dwStatus;
-        sal_uInt32      dwFullUserTypeName;
-        sal_uInt32      dwSrcOfCopy;
-};
-
 class SwTrnsfrDdeLink : public ::sfx2::SvBaseLink
 {
 	String sName;
 	}
 	else if ( nSelection == nsSelectionType::SEL_OLE )
 	{
-		pClpDocFac = new SwDocFac;
+        pClpDocFac = new SwDocFac;
         SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
 		aDocShellRef = new SwDocShell( pDoc, SFX_CREATE_MODE_EMBEDDED);
 		aDocShellRef->DoInitNew( NULL );
 
 		AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
 
+        // --> OD #i98753#
+        // set size of embedded object at the object description structure
+        aObjDesc.maSize = OutputDevice::LogicToLogic( pWrtShell->GetObjSize(), MAP_TWIP, MAP_100TH_MM );
+        // <--
         PrepareOLE( aObjDesc );
 		AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
 
 		Link aOldLink( rSh.GetChgLnk() );
 		rSh.SetChgLnk( Link() );
 
-        SwReader aReader( *pStream, aEmptyStr, String(), *rSh.GetCrsr() );
+        const SwPosition& rInsPos = *rSh.GetCrsr()->Start();
+		SwReader aReader( *pStream, aEmptyStr, String(), *rSh.GetCrsr() );
+		rSh.SaveTblBoxCntnt( &rInsPos );
 		if( IsError( aReader.Read( *pRead )) )
 			nResId = ERR_CLPBRD_READ;
 		else

sw/source/ui/docvw/romenu.cxx

 	SvtPathOptions aPathOpt;
 	String sGrfPath( aPathOpt.GetGraphicPath() );
 
-    FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_SIMPLE, 0 );
+    FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
     Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
 
 //    aExpDlg.SetHelpId(HID_FILEDLG_ROMENU);
 				nFilter = GRFILTER_FORMAT_DONTKNOW;
 			String aFilter( rGF.GetExportFormatShortName( nFilter ) );
 			XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter,
-										XOUTBMP_DONT_EXPAND_FILENAME );
+                                        XOUTBMP_DONT_EXPAND_FILENAME|XOUTBMP_DONT_ADD_EXTENSION );
 			return sPath;
 		}
 	}

sw/source/ui/inc/view.hxx

                     bInMailMerge : 1,
                     bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
                     bOldShellWasPagePreView : 1,
+                    bIsPreviewDoubleClick : 1, // #i114045#
                     bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
 					;
 

sw/source/ui/uiview/view.cxx

     nRightBorderDistance( 0 ),
     bInMailMerge(sal_False),
     bInDtor(sal_False),
-    bOldShellWasPagePreView(sal_False)
+    bOldShellWasPagePreView(sal_False),
+    bIsPreviewDoubleClick(sal_False)
 {
     // OD 18.12.2002 #103492# - According to discussion with MBA and further
     // investigations, no old SfxViewShell will be set as parameter <pOldSh>,
             sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
             nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
             bOldShellWasPagePreView = sal_True;
+            bIsPreviewDoubleClick = sNewCrsrPos.Len() > 0 || nNewPage != USHRT_MAX;
         }
         else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
             bOldShellWasSrcView = sal_True;
 
 void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence, sal_Bool bBrowse )
 {
-    if(GetDocShell()->IsPreview())
+    if(GetDocShell()->IsPreview()||bIsPreviewDoubleClick)
         return;
     //#i43146# go to the last editing position when opening own files
     bool bIsOwnDocument = lcl_IsOwnDocument( *this );
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.