summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2000-10-24 13:26:57 +0000
committerOliver Specht <os@openoffice.org>2000-10-24 13:26:57 +0000
commit8a96c8c00ce43a888fcdd2deff7e8cb93d3aee83 (patch)
tree24e138195e5ca97c0cc0a1aae89234c5044d1106
parentd599525a6ec30f218d931691eb56d74304bad6e0 (diff)
#79738# new graphic property: ContourPolyPolygon
-rw-r--r--sw/inc/cmdid.h5
-rw-r--r--sw/inc/unoprnms.hxx8
-rw-r--r--sw/source/core/unocore/unoframe.cxx84
-rw-r--r--sw/source/core/unocore/unomap.cxx16
-rw-r--r--sw/source/core/unocore/unoprnms.cxx7
5 files changed, 94 insertions, 26 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 94e05ca5548c..e80d40300ff5 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -2,9 +2,9 @@
*
* $RCSfile: cmdid.h,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-10-05 12:04:44 $
+ * last change: $Author: os $ $Date: 2000-10-24 14:25:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1116,6 +1116,7 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
#define FN_PARAM_TOX_TYPE (FN_PARAM2+14) /* TOX type in tox dialog*/
#define FN_PARAM_LINK_DISPLAY_NAME (FN_PARAM2+15) /* LinkDisplayName property*/
#define FN_PARAM_NUM_LEVEL (FN_PARAM2+16) /* rtf filter*/
+#define FN_PARAM_COUNTOUR_PP (FN_PARAM2+17) /* contour PolyPolygon*/
/*--------------------------------------------------------------------
Bereich: Druckoptionen
--------------------------------------------------------------------*/
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 7aef94359c59..0a98e127170b 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoprnms.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: os $ $Date: 2000-10-24 09:57:11 $
+ * last change: $Author: os $ $Date: 2000-10-24 14:25:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -313,7 +313,6 @@ extern const SwPropNameLen __FAR_DATA UNO_NAME_IS_AUTO_HEIGHT
extern const SwPropNameLen __FAR_DATA UNO_NAME_SIZE_TYPE ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HINT ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HORI_ORIENT ;
-//extern const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED_ON_EVEN_PAGES;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED_ON_ODD_PAGES;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HORI_ORIENT_RELATION ;
@@ -328,7 +327,6 @@ extern const SwPropNameLen __FAR_DATA UNO_NAME_LEVEL
extern const SwPropNameLen __FAR_DATA UNO_NAME_LINE_INTERVAL ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_LINK_REGION ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_MACRO ;
-extern const SwPropNameLen __FAR_DATA UNO_NAME_MIRROR_PAGE_TOGGLE ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_SPLIT ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_PARA_SPLIT ;
extern const SwPropNameLen __FAR_DATA UNO_NAME_NUMBER_FORMAT ;
@@ -547,6 +545,8 @@ extern const SwPropNameLen __FAR_DATA UNO_NAME_HIDE_FIELD_TIPS;
extern const SwPropNameLen __FAR_DATA UNO_NAME_HEADER_USER_DEFINED_ATTRIBUTES;
extern const SwPropNameLen __FAR_DATA UNO_NAME_FOOTER_USER_DEFINED_ATTRIBUTES;
extern const SwPropNameLen __FAR_DATA UNO_NAME_PARA_SHADOW_FORMAT;
+
+extern const SwPropNameLen __FAR_DATA UNO_NAME_CONTOUR_POLY_POLYGON;
#endif
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 6a2ae20c8b5a..82c2abf76eb5 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoframe.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: os $ $Date: 2000-10-24 10:11:48 $
+ * last change: $Author: os $ $Date: 2000-10-24 14:26:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,15 @@
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
+#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCE_HPP_
+#include <com/sun/star/drawing/PointSequence.hpp>
+#endif
+#ifndef _SV_POLY_HXX //autogen
+#include <vcl/poly.hxx>
+#endif
#ifndef SW_UNOMID_HXX
#include <unomid.h>
#endif
@@ -213,6 +222,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::drawing;
using namespace ::rtl;
@@ -335,9 +345,10 @@ const SfxItemPropertyMap* GetGraphicDescMap()
{ SW_PROP_NAME(UNO_NAME_BORDER_DISTANCE), RES_BOX, &::getCppuType((const sal_Int32*)0), 0, BORDER_DISTANCE|CONVERT_TWIPS },
{ SW_PROP_NAME(UNO_NAME_GRAPHIC_URL), 0, &::getCppuType((const OUString*)0), 0, 0 },
{ SW_PROP_NAME(UNO_NAME_GRAPHIC_FILTER), 0, &::getCppuType((const OUString*)0), 0, 0 },
+ { SW_PROP_NAME(UNO_NAME_CONTOUR_POLY_POLYGON), FN_PARAM_COUNTOUR_PP, &::getCppuType((PointSequenceSequence*)0), PropertyAttribute::MAYBEVOID, 0 },
{0,0,0,0}
};
- #define GRPH_PROP_COUNT 53
+ #define GRPH_PROP_COUNT 54
return aGraphicDescPropertyMap_Impl;
}
@@ -1028,7 +1039,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
(COMPARE_EQUAL == rPropertyName.compareToAscii(UNO_NAME_ALTERNATIVE_TEXT)||
(pCur &&
(pCur->nWID == RES_GRFATR_CROPGRF ||
- pCur->nWID == RES_GRFATR_MIRRORGRF))))
+ pCur->nWID == RES_GRFATR_MIRRORGRF ||
+ pCur->nWID == FN_PARAM_COUNTOUR_PP))))
{
const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
if(pIdx)
@@ -1041,6 +1053,31 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
aValue >>= uTemp;
pNoTxt->SetAlternateText(uTemp);
}
+ else if(pCur->nWID == FN_PARAM_COUNTOUR_PP)
+ {
+ PointSequenceSequence aParam;
+ if(!aValue.hasValue())
+ pNoTxt->SetContour(0);
+ else if(aValue >>= aParam)
+ {
+ PolyPolygon aPoly(aParam.getLength());
+ for(sal_Int32 i = 0; i < aParam.getLength(); i++)
+ {
+ const PointSequence* pPointSeq = aParam.getConstArray();
+ Polygon aSet(pPointSeq[i].getLength());
+ for(sal_Int32 j = 0; j < pPointSeq[i].getLength(); j++)
+ {
+ const awt::Point* pPoints = pPointSeq[i].getConstArray();
+ Point aPoint(MM100_TO_TWIP(pPoints[j].X), MM100_TO_TWIP(pPoints[j].Y));
+ aSet.SetPoint(aPoint, j);
+ }
+ aPoly.Insert( aSet );
+ }
+ pNoTxt->SetContour(&aPoly);
+ }
+ else
+ throw IllegalArgumentException();
+ }
else
{
SfxItemSet aSet(pNoTxt->GetSwAttrSet());
@@ -1182,15 +1219,41 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
if(eType == FLYCNTTYPE_GRF &&
pCur &&
(pCur->nWID == RES_GRFATR_CROPGRF ||
- pCur->nWID == RES_GRFATR_MIRRORGRF))
+ pCur->nWID == RES_GRFATR_MIRRORGRF ||
+ pCur->nWID == FN_PARAM_COUNTOUR_PP ))
{
const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
if(pIdx)
{
SwNodeIndex aIdx(*pIdx, 1);
SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
- SfxItemSet aSet(pNoTxt->GetSwAttrSet());
- aAny = aPropSet.getPropertyValue(rPropertyName, aSet);
+ if(pCur->nWID == FN_PARAM_COUNTOUR_PP)
+ {
+ const PolyPolygon* pContour = pNoTxt->HasContour();
+ if(pContour)
+ {
+ PointSequenceSequence aPtSeq(pContour->Count());
+ PointSequence* pPSeq = aPtSeq.getArray();
+ for(USHORT i = 0; i < pContour->Count(); i++)
+ {
+ const Polygon& rPoly = pContour->GetObject(i);
+ pPSeq[i].realloc(rPoly.GetSize());
+ awt::Point* pPoints = pPSeq[i].getArray();
+ for(USHORT j = 0; j < rPoly.GetSize(); j++)
+ {
+ const Point& rPoint = rPoly.GetPoint(j);
+ pPoints[j].X = TWIP_TO_MM100(rPoint.X());
+ pPoints[j].Y = TWIP_TO_MM100(rPoint.Y());
+ }
+ }
+ aAny <<= aPtSeq;
+ }
+ }
+ else
+ {
+ SfxItemSet aSet(pNoTxt->GetSwAttrSet());
+ aAny = aPropSet.getPropertyValue(rPropertyName, aSet);
+ }
}
}
else if( COMPARE_EQUAL == rPropertyName.compareToAscii(UNO_NAME_GRAPHIC_URL)||
@@ -1655,7 +1718,11 @@ void SwXFrame::attachToRange(const uno::Reference< XTextRange > & xTextRange)
pGFmt->Add(this);
if(sName.Len())
pDoc->SetFlyName((SwFlyFrmFmt&)*pGFmt, sName);
+
}
+ uno::Any* pContourPoly;
+ if(pProps->GetProperty(C2S(UNO_NAME_CONTOUR_POLY_POLYGON), pContourPoly))
+ setPropertyValue(C2U(UNO_NAME_CONTOUR_POLY_POLYGON), *pContourPoly);
if(pProps->GetProperty(C2S(UNO_NAME_ALTERNATIVE_TEXT), pAltText))
setPropertyValue(C2U(UNO_NAME_ALTERNATIVE_TEXT), *pAltText);
}
@@ -2558,6 +2625,9 @@ sal_uInt16 SwXOLEListener::FindEntry( const EventObject& rEvent,SwOLENode** ppNd
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.4 2000/10/24 10:11:48 os
+ graphic mirror properties changed
+
Revision 1.3 2000/10/23 11:52:34 os
property defines according to the expansion
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index f52833581507..f221a493a334 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unomap.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: os $ $Date: 2000-10-24 10:10:40 $
+ * last change: $Author: os $ $Date: 2000-10-24 14:26:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -335,23 +335,20 @@
#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
#include <com/sun/star/lang/Locale.hpp>
#endif
+#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#endif
#ifndef _SVX_PBINITEM_HXX //autogen
#include <svx/pbinitem.hxx>
#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::drawing;
using namespace ::rtl;
SwUnoPropertyMapProvider aSwMapProvider;
-
-
-
-// { SW_PROP_NAME(UNO_NAME_WIDTH), FN_SET_TABLE_WIDTH, &::getCppuType((const long*)0), PROPERTY_NONE},
-// { SW_PROP_NAME(UNO_NAME_GRAPHIC ), RES_BACKGROUND, &, PROPERTY_NONE, MID_GRAPHIC
-// { SW_PROP_NAME(UNO_NAME_PAGE_DESC_NAME), RES_PAGEDESC, &::getCppuType((const String*)0), PROPERTY_NONE, MID_PAGEDESC_PAGEDESCNAME },
-
/******************************************************************************
UI-Maps
******************************************************************************/
@@ -1234,6 +1231,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16
{ SW_PROP_NAME(UNO_NAME_ALTERNATIVE_TEXT), 0, &::getCppuType((const OUString*)0), PROPERTY_NONE , 0 },
{ SW_PROP_NAME(UNO_LINK_DISPLAY_NAME), FN_PARAM_LINK_DISPLAY_NAME, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0xff},
{ SW_PROP_NAME(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, &::getCppuType((uno::Reference<container::XNameContainer>*)0), PropertyAttribute::MAYBEVOID, 0 },
+ { SW_PROP_NAME(UNO_NAME_CONTOUR_POLY_POLYGON), FN_PARAM_COUNTOUR_PP, &::getCppuType((PointSequenceSequence*)0), PropertyAttribute::MAYBEVOID, 0 },
{0,0,0,0}
};
aMapArr[nPropertyId] = aGraphicPropertyMap_Impl;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 714a71fc304d..cb085c2b8423 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoprnms.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: os $ $Date: 2000-10-24 10:00:22 $
+ * last change: $Author: os $ $Date: 2000-10-24 14:26:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -309,7 +309,6 @@ const SwPropNameLen __FAR_DATA UNO_NAME_IS_AUTO_HEIGHT
const SwPropNameLen __FAR_DATA UNO_NAME_SIZE_TYPE (MAP_CHAR_LEN("SizeType"));
const SwPropNameLen __FAR_DATA UNO_NAME_HINT (MAP_CHAR_LEN("Hint"));
const SwPropNameLen __FAR_DATA UNO_NAME_HORI_ORIENT (MAP_CHAR_LEN("HoriOrient"));
-//const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED (MAP_CHAR_LEN("HoriMirrored"));
const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED_ON_EVEN_PAGES (MAP_CHAR_LEN("HoriMirroredOnEvenPages"));
const SwPropNameLen __FAR_DATA UNO_NAME_HORI_MIRRORED_ON_ODD_PAGES (MAP_CHAR_LEN("HoriMirroredOnOddPages"));
const SwPropNameLen __FAR_DATA UNO_NAME_HORI_ORIENT_RELATION (MAP_CHAR_LEN("HoriOrientRelation"));
@@ -324,7 +323,6 @@ const SwPropNameLen __FAR_DATA UNO_NAME_LEVEL
const SwPropNameLen __FAR_DATA UNO_NAME_LINE_INTERVAL (MAP_CHAR_LEN("LineInterval"));
const SwPropNameLen __FAR_DATA UNO_NAME_LINK_REGION (MAP_CHAR_LEN("LinkRegion"));
const SwPropNameLen __FAR_DATA UNO_NAME_MACRO (MAP_CHAR_LEN("Macro"));
-const SwPropNameLen __FAR_DATA UNO_NAME_MIRROR_PAGE_TOGGLE (MAP_CHAR_LEN("MirrorPageToggle"));
const SwPropNameLen __FAR_DATA UNO_NAME_SPLIT (MAP_CHAR_LEN("Split"));
const SwPropNameLen __FAR_DATA UNO_NAME_PARA_SPLIT (MAP_CHAR_LEN("ParaSplit"));
const SwPropNameLen __FAR_DATA UNO_NAME_NUMBER_FORMAT (MAP_CHAR_LEN("NumberFormat"));
@@ -546,3 +544,4 @@ const SwPropNameLen __FAR_DATA UNO_NAME_PARA_IS_NUMBERING_RESTART
const SwPropNameLen __FAR_DATA UNO_NAME_HIDE_FIELD_TIPS (MAP_CHAR_LEN("HideFieldTips"));
const SwPropNameLen __FAR_DATA UNO_NAME_PARA_SHADOW_FORMAT (MAP_CHAR_LEN("ParaShadowFormat"));
+const SwPropNameLen __FAR_DATA UNO_NAME_CONTOUR_POLY_POLYGON (MAP_CHAR_LEN("ContourPolyPolygon"));