svdoole2.cxx (a5258243) | svdoole2.cxx (079eb148) |
---|---|
1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * --- 748 unchanged lines hidden (view full) --- 757 758TYPEINIT1(SdrOle2Obj,SdrRectObj); 759DBG_NAME(SdrOle2Obj) 760SdrOle2Obj::SdrOle2Obj(FASTBOOL bFrame_) : m_bTypeAsked(false) 761,m_bChart(false) 762{ 763 DBG_CTOR( SdrOle2Obj,NULL); 764 bInDestruction = sal_False; | 1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * --- 748 unchanged lines hidden (view full) --- 757 758TYPEINIT1(SdrOle2Obj,SdrRectObj); 759DBG_NAME(SdrOle2Obj) 760SdrOle2Obj::SdrOle2Obj(FASTBOOL bFrame_) : m_bTypeAsked(false) 761,m_bChart(false) 762{ 763 DBG_CTOR( SdrOle2Obj,NULL); 764 bInDestruction = sal_False; |
765 mbSuppressSetVisAreaSize = false; |
|
765 Init(); 766 bFrame=bFrame_; 767} 768 769// ----------------------------------------------------------------------------- 770SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, FASTBOOL bFrame_) 771 : xObjRef( rNewObjRef ) 772 , m_bTypeAsked(false) 773 , m_bChart(false) 774{ 775 DBG_CTOR( SdrOle2Obj,NULL); 776 bInDestruction = sal_False; | 766 Init(); 767 bFrame=bFrame_; 768} 769 770// ----------------------------------------------------------------------------- 771SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, FASTBOOL bFrame_) 772 : xObjRef( rNewObjRef ) 773 , m_bTypeAsked(false) 774 , m_bChart(false) 775{ 776 DBG_CTOR( SdrOle2Obj,NULL); 777 bInDestruction = sal_False; |
778 mbSuppressSetVisAreaSize = false; |
|
777 Init(); 778 779 bFrame=bFrame_; 780 781 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 782 SetResizeProtect(sal_True); 783 784 // #108759# For math objects, set closed state to transparent --- 5 unchanged lines hidden (view full) --- 790 791SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, FASTBOOL bFrame_) 792 : xObjRef( rNewObjRef ) 793 , m_bTypeAsked(false) 794 , m_bChart(false) 795{ 796 DBG_CTOR( SdrOle2Obj,NULL); 797 bInDestruction = sal_False; | 779 Init(); 780 781 bFrame=bFrame_; 782 783 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 784 SetResizeProtect(sal_True); 785 786 // #108759# For math objects, set closed state to transparent --- 5 unchanged lines hidden (view full) --- 792 793SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, FASTBOOL bFrame_) 794 : xObjRef( rNewObjRef ) 795 , m_bTypeAsked(false) 796 , m_bChart(false) 797{ 798 DBG_CTOR( SdrOle2Obj,NULL); 799 bInDestruction = sal_False; |
800 mbSuppressSetVisAreaSize = false; |
|
798 Init(); 799 800 mpImpl->aPersistName = rNewObjName; 801 bFrame=bFrame_; 802 803 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 804 SetResizeProtect(sal_True); 805 --- 7 unchanged lines hidden (view full) --- 813SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, const Rectangle& rNewRect, FASTBOOL bFrame_) 814 : SdrRectObj(rNewRect) 815 , xObjRef( rNewObjRef ) 816 , m_bTypeAsked(false) 817 , m_bChart(false) 818{ 819 DBG_CTOR( SdrOle2Obj,NULL); 820 bInDestruction = sal_False; | 801 Init(); 802 803 mpImpl->aPersistName = rNewObjName; 804 bFrame=bFrame_; 805 806 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 807 SetResizeProtect(sal_True); 808 --- 7 unchanged lines hidden (view full) --- 816SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubString& rNewObjName, const Rectangle& rNewRect, FASTBOOL bFrame_) 817 : SdrRectObj(rNewRect) 818 , xObjRef( rNewObjRef ) 819 , m_bTypeAsked(false) 820 , m_bChart(false) 821{ 822 DBG_CTOR( SdrOle2Obj,NULL); 823 bInDestruction = sal_False; |
824 mbSuppressSetVisAreaSize = false; |
|
821 Init(); 822 823 mpImpl->aPersistName = rNewObjName; 824 bFrame=bFrame_; 825 826 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 827 SetResizeProtect(sal_True); 828 --- 50 unchanged lines hidden (view full) --- 879 880// ----------------------------------------------------------------------------- 881void SdrOle2Obj::SetAspect( sal_Int64 nAspect ) 882{ 883 xObjRef.SetViewAspect( nAspect ); 884} 885 886// ----------------------------------------------------------------------------- | 825 Init(); 826 827 mpImpl->aPersistName = rNewObjName; 828 bFrame=bFrame_; 829 830 if ( xObjRef.is() && (xObjRef->getStatus( GetAspect() ) & embed::EmbedMisc::EMBED_NEVERRESIZE ) ) 831 SetResizeProtect(sal_True); 832 --- 50 unchanged lines hidden (view full) --- 883 884// ----------------------------------------------------------------------------- 885void SdrOle2Obj::SetAspect( sal_Int64 nAspect ) 886{ 887 xObjRef.SetViewAspect( nAspect ); 888} 889 890// ----------------------------------------------------------------------------- |
891bool SdrOle2Obj::isInplaceActive() const 892{ 893 return xObjRef.is() && embed::EmbedStates::INPLACE_ACTIVE == xObjRef->getCurrentState(); 894} |
|
887 | 895 |
896// ----------------------------------------------------------------------------- 897bool SdrOle2Obj::isUiActive() const 898{ 899 return xObjRef.is() && embed::EmbedStates::UI_ACTIVE == xObjRef->getCurrentState(); 900} 901 902// ----------------------------------------------------------------------------- 903 |
|
888void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf) 889{ 890 if ( pGraphic ) 891 { 892 delete pGraphic; 893 pGraphic = NULL; 894 delete mpImpl->pGraphicObject; 895 mpImpl->pGraphicObject = NULL; --- 848 unchanged lines hidden (view full) --- 1744 } 1745 } 1746} 1747 1748// ----------------------------------------------------------------------------- 1749 1750void SdrOle2Obj::ImpSetVisAreaSize() 1751{ | 904void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf) 905{ 906 if ( pGraphic ) 907 { 908 delete pGraphic; 909 pGraphic = NULL; 910 delete mpImpl->pGraphicObject; 911 mpImpl->pGraphicObject = NULL; --- 848 unchanged lines hidden (view full) --- 1760 } 1761 } 1762} 1763 1764// ----------------------------------------------------------------------------- 1765 1766void SdrOle2Obj::ImpSetVisAreaSize() 1767{ |
1768 // #i118524# do not again set VisAreaSize when the call comes from OLE client (e.g. ObjectAreaChanged) 1769 if(mbSuppressSetVisAreaSize) 1770 return; 1771 |
|
1752 // currently there is no need to recalculate scaling for iconified objects 1753 // TODO/LATER: it might be needed in future when it is possible to change the icon 1754 if ( GetAspect() == embed::Aspects::MSOLE_ICON ) 1755 return; 1756 1757 // the object area of an embedded object was changed, e.g. by user interaction an a selected object 1758 GetObjRef(); 1759 if ( xObjRef.is() ) --- 128 unchanged lines hidden (view full) --- 1888 // if the object needs recompose on resize 1889 // the client site should be created before the resize will take place 1890 // check whether there is no client site and create it if necessary 1891 AddOwnLightClient(); 1892 } 1893 } 1894 1895 SdrRectObj::NbcResize(rRef,xFact,yFact); | 1772 // currently there is no need to recalculate scaling for iconified objects 1773 // TODO/LATER: it might be needed in future when it is possible to change the icon 1774 if ( GetAspect() == embed::Aspects::MSOLE_ICON ) 1775 return; 1776 1777 // the object area of an embedded object was changed, e.g. by user interaction an a selected object 1778 GetObjRef(); 1779 if ( xObjRef.is() ) --- 128 unchanged lines hidden (view full) --- 1908 // if the object needs recompose on resize 1909 // the client site should be created before the resize will take place 1910 // check whether there is no client site and create it if necessary 1911 AddOwnLightClient(); 1912 } 1913 } 1914 1915 SdrRectObj::NbcResize(rRef,xFact,yFact); |
1896 if (aGeo.nShearWink!=0 || aGeo.nDrehWink!=0) { // kleine Korrekturen 1897 if (aGeo.nDrehWink>=9000 && aGeo.nDrehWink<27000) { 1898 aRect.Move(aRect.Left()-aRect.Right(),aRect.Top()-aRect.Bottom()); 1899 } 1900 aGeo.nDrehWink=0; 1901 aGeo.nShearWink=0; 1902 aGeo.nSin=0.0; 1903 aGeo.nCos=1.0; 1904 aGeo.nTan=0.0; 1905 SetRectsDirty(); 1906 } 1907 if( pModel && !pModel->isLocked() ) | 1916 1917 if( pModel && !pModel->isLocked() ) |
1908 ImpSetVisAreaSize(); 1909} 1910 1911// ----------------------------------------------------------------------------- 1912 1913void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo) 1914{ 1915 SdrRectObj::SetGeoData(rGeo); | 1918 ImpSetVisAreaSize(); 1919} 1920 1921// ----------------------------------------------------------------------------- 1922 1923void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo) 1924{ 1925 SdrRectObj::SetGeoData(rGeo); |
1916 if( pModel && !pModel->isLocked() ) | 1926 1927 if( pModel && !pModel->isLocked() ) |
1917 ImpSetVisAreaSize(); 1918} 1919 1920// ----------------------------------------------------------------------------- 1921 1922void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect) 1923{ 1924 SdrRectObj::NbcSetSnapRect(rRect); | 1928 ImpSetVisAreaSize(); 1929} 1930 1931// ----------------------------------------------------------------------------- 1932 1933void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect) 1934{ 1935 SdrRectObj::NbcSetSnapRect(rRect); |
1925 if( pModel && !pModel->isLocked() ) | 1936 1937 if( pModel && !pModel->isLocked() ) |
1926 ImpSetVisAreaSize(); 1927 1928 if ( xObjRef.is() && IsChart() ) 1929 { 1930 //#i103460# charts do not necessaryly have an own size within ODF files, 1931 //for this case they need to use the size settings from the surrounding frame, 1932 //which is made available with this method as there is no other way 1933 xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) ); 1934 } 1935} 1936 1937// ----------------------------------------------------------------------------- 1938 1939void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect) 1940{ 1941 SdrRectObj::NbcSetLogicRect(rRect); | 1938 ImpSetVisAreaSize(); 1939 1940 if ( xObjRef.is() && IsChart() ) 1941 { 1942 //#i103460# charts do not necessaryly have an own size within ODF files, 1943 //for this case they need to use the size settings from the surrounding frame, 1944 //which is made available with this method as there is no other way 1945 xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) ); 1946 } 1947} 1948 1949// ----------------------------------------------------------------------------- 1950 1951void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect) 1952{ 1953 SdrRectObj::NbcSetLogicRect(rRect); |
1942 if( pModel && !pModel->isLocked() ) | 1954 1955 if( pModel && !pModel->isLocked() ) |
1943 ImpSetVisAreaSize(); 1944} 1945 1946Graphic* SdrOle2Obj::GetGraphic() const 1947{ 1948 if ( xObjRef.is() ) 1949 return xObjRef.GetGraphic(); 1950 return pGraphic; --- 12 unchanged lines hidden (view full) --- 1963 return xObjRef.GetSize( pTargetMapMode ); 1964} 1965 1966// ----------------------------------------------------------------------------- 1967 1968void SdrOle2Obj::NbcMove(const Size& rSize) 1969{ 1970 SdrRectObj::NbcMove(rSize); | 1956 ImpSetVisAreaSize(); 1957} 1958 1959Graphic* SdrOle2Obj::GetGraphic() const 1960{ 1961 if ( xObjRef.is() ) 1962 return xObjRef.GetGraphic(); 1963 return pGraphic; --- 12 unchanged lines hidden (view full) --- 1976 return xObjRef.GetSize( pTargetMapMode ); 1977} 1978 1979// ----------------------------------------------------------------------------- 1980 1981void SdrOle2Obj::NbcMove(const Size& rSize) 1982{ 1983 SdrRectObj::NbcMove(rSize); |
1971 if( pModel && !pModel->isLocked() ) | 1984 1985 if( pModel && !pModel->isLocked() ) |
1972 ImpSetVisAreaSize(); 1973} 1974 1975// ----------------------------------------------------------------------------- 1976 1977sal_Bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ) 1978{ 1979 sal_Bool bResult = sal_False; --- 319 unchanged lines hidden --- | 1986 ImpSetVisAreaSize(); 1987} 1988 1989// ----------------------------------------------------------------------------- 1990 1991sal_Bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ) 1992{ 1993 sal_Bool bResult = sal_False; --- 319 unchanged lines hidden --- |