openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1463566 - in /openoffice/branches/sidebar/main: svx/source/sidebar/possize/PosSizePropertyPanel.cxx sw/sdi/_frmsh.sdi sw/source/core/frmedt/feshview.cxx sw/source/ui/shells/frmsh.cxx
Date Tue, 02 Apr 2013 14:36:07 GMT
Author: orw
Date: Tue Apr  2 14:36:07 2013
New Revision: 1463566

URL: http://svn.apache.org/r1463566
Log:
#121795# - position and size property panel - get it working for embedded objects and Writer
graphics

Modified:
    openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
    openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi
    openoffice/branches/sidebar/main/sw/source/core/frmedt/feshview.cxx
    openoffice/branches/sidebar/main/sw/source/ui/shells/frmsh.cxx

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1463566&r1=1463565&r2=1463566&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Tue
Apr  2 14:36:07 2013
@@ -115,7 +115,12 @@ PosSizePropertyPanel::PosSizePropertyPan
     mbInDestructor(false)
 {
 	Initialize();
-	FreeResource();	
+	FreeResource();
+
+    mpBindings->Update( SID_ATTR_TRANSFORM_WIDTH );
+    mpBindings->Update( SID_ATTR_TRANSFORM_HEIGHT );
+    mpBindings->Update( SID_ATTR_TRANSFORM_PROTECT_SIZE );
+    mpBindings->Update( SID_ATTR_METRIC );
 }
 
 

Modified: openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi?rev=1463566&r1=1463565&r2=1463566&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi (original)
+++ openoffice/branches/sidebar/main/sw/sdi/_frmsh.sdi Tue Apr  2 14:36:07 2013
@@ -162,6 +162,11 @@ interface BaseTextFrame
 		StateMethod = GetState ;
 		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
 	]
+	SID_ATTR_TRANSFORM_PROTECT_SIZE
+	[
+		StateMethod = GetState ;
+		DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+	]
 
 	SID_ATTR_ULSPACE // status(final|play)
 	[

Modified: openoffice/branches/sidebar/main/sw/source/core/frmedt/feshview.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/core/frmedt/feshview.cxx?rev=1463566&r1=1463565&r2=1463566&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/source/core/frmedt/feshview.cxx (original)
+++ openoffice/branches/sidebar/main/sw/source/core/frmedt/feshview.cxx Tue Apr  2 14:36:07
2013
@@ -2486,10 +2486,10 @@ sal_uInt8 SwFEShell::IsSelObjProtected( 
 						{
                             // TODO/LATER: use correct aspect
                             const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE
& xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
-                            if ( (FLYPROTECT_CONTENT & eType) && bNeverResize
)
-							{
-								nChk |= FLYPROTECT_SIZE;
-								nChk |= FLYPROTECT_FIXED;
+                            if ( ( (FLYPROTECT_CONTENT & eType) || (FLYPROTECT_SIZE &
eType) ) && bNeverResize )
+                            {
+                                nChk |= FLYPROTECT_SIZE;
+                                nChk |= FLYPROTECT_FIXED;
                             }
 
                             // set FLYPROTECT_POS if it is a Math object anchored 'as char'
and baseline alignment is activated

Modified: openoffice/branches/sidebar/main/sw/source/ui/shells/frmsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/shells/frmsh.cxx?rev=1463566&r1=1463565&r2=1463566&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sw/source/ui/shells/frmsh.cxx (original)
+++ openoffice/branches/sidebar/main/sw/source/ui/shells/frmsh.cxx Tue Apr  2 14:36:07 2013
@@ -35,6 +35,8 @@
 #include <svl/rectitem.hxx>
 #include <svl/ptitem.hxx>
 #include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
 #include <editeng/colritem.hxx>
 #include <editeng/bolnitem.hxx>
 #include <editeng/boxitem.hxx>
@@ -383,6 +385,36 @@ void SwFrameShell::Execute(SfxRequest &r
 			}
 		}
 		break;
+
+        case SID_ATTR_TRANSFORM:
+        {
+            bool bApplyNewSize = false;
+
+            Size aNewSize = aMgr.GetSize();
+            if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_WIDTH, FALSE,
&pItem ) )
+            {
+                aNewSize.setWidth( static_cast< const SfxUInt32Item* >(pItem)->GetValue()
);
+                bApplyNewSize = true;
+            }
+
+            if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_HEIGHT, FALSE,
&pItem ) )
+            {
+                aNewSize.setHeight( static_cast< const SfxUInt32Item* >(pItem)->GetValue()
);
+                bApplyNewSize = true;
+            }
+
+            if ( bApplyNewSize )
+            {
+                aMgr.SetSize( aNewSize );
+            }
+            else
+            {
+                bUpdateMgr = sal_False;
+            }
+
+        }
+        break;
+
         case FN_FORMAT_FRAME_DLG:
         case FN_PROPERTY_WRAP_DLG:
 		{
@@ -638,21 +670,22 @@ void SwFrameShell::Execute(SfxRequest &r
         }
         break;
         // <--
-		default:
-			ASSERT( !this, "falscher Dispatcher" );
-			return;
-	}
-	// Vorlagen-AutoUpdate
-	SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
-	if ( bUpdateMgr )
-	{
-		if(bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt())
-		{
-			rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
-		}
-		else
-			aMgr.UpdateFlyFrm();
-	}
+        default:
+            ASSERT( !this, "falscher Dispatcher" );
+            return;
+    }
+    if ( bUpdateMgr )
+    {
+        SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
+        if ( bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt() )
+        {
+            rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
+        }
+        else
+        {
+            aMgr.UpdateFlyFrm();
+        }
+    }
 
 }
 
@@ -866,14 +899,48 @@ void SwFrameShell::GetState(SfxItemSet& 
                     if ( bParentCntProt )
                         rSet.DisableItem( nWhich );
                 break;
+
+                case SID_ATTR_TRANSFORM:
+                {
+                    rSet.DisableItem( nWhich );
+                }
+                break;
+
+                case SID_ATTR_TRANSFORM_PROTECT_SIZE:
+                {
+                    const sal_uInt8 eProtection = rSh.IsSelObjProtected( FLYPROTECT_SIZE
);
+                    if ( ( eProtection & FLYPROTECT_CONTENT ) ||
+                         ( eProtection & FLYPROTECT_SIZE ) )
+                    {
+                        rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_True
) );
+                    }
+                    else
+                    {
+                        rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_False
) );
+                    }
+                }
+                break;
+
+                case SID_ATTR_TRANSFORM_WIDTH:
+                {
+                    rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, aMgr.GetSize().getWidth()
) );
+                }
+                break;
+
+                case SID_ATTR_TRANSFORM_HEIGHT:
+                {
+                    rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, aMgr.GetSize().getHeight()
) );
+                }
+                break;
+
                 case FN_FORMAT_FRAME_DLG:
                 {
                     const int nSel = rSh.GetSelectionType();
                     if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
-						rSet.DisableItem( nWhich );
+                        rSet.DisableItem( nWhich );
                 }
                 break;
-                // --> OD 2009-07-07 #i73249#
+
                 case FN_TITLE_DESCRIPTION_SHAPE:
                 {
                     SwWrtShell &rWrtSh = GetShell();
@@ -886,14 +953,14 @@ void SwFrameShell::GetState(SfxItemSet& 
 
                 }
                 break;
-                // <--
-				default:
-					/* do nothing */;
-					break;
-			}
-			nWhich = aIter.NextWhich();
-		}
-	}
+
+                default:
+                    /* do nothing */;
+                    break;
+            }
+            nWhich = aIter.NextWhich();
+        }
+    }
 }
 
 /*--------------------------------------------------------------------



Mime
View raw message