Kaydet (Commit) 94754eb3 authored tarafından Regina Henschel's avatar Regina Henschel

Add missing chart data point ODF1.2 standard symbols

üst a06ccbd9
......@@ -148,7 +148,7 @@ sal_Int32 lcl_getSymbolType( const ::com::sun::star::chart2::Symbol& rSymbol )
nSymbol = ::com::sun::star::chart::ChartSymbolType::AUTO;
break;
case chart2::SymbolStyle_STANDARD:
nSymbol = rSymbol.StandardSymbol%8;
nSymbol = rSymbol.StandardSymbol%15;
break;
case chart2::SymbolStyle_POLYGON://new feature
nSymbol = ::com::sun::star::chart::ChartSymbolType::AUTO;
......
......@@ -1031,8 +1031,6 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
if(pObj)
{
pObj=pObj->Clone();
pPage->NbcInsertObject(pObj);
pView->MarkObj(pObj,pPageView);
if(pSymbolAttr)
{
pObj->SetMergedItemSet(*pSymbolAttr);
......@@ -1041,17 +1039,31 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
{
pObj->SetMergedItemSet(rOutAttrs);
}
pPage->NbcInsertObject(pObj);
// Generate invisible square to give all symbol types a
// bitmap size, which is indepedent from specific glyph
SdrObject *pInvisibleSquare=pSymbolList->GetObj(0);
pInvisibleSquare=pInvisibleSquare->Clone();
pPage->NbcInsertObject(pInvisibleSquare);
pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
pView->MarkAll();
GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
aSymbolGraphic=Graphic(aMeta);
aSymbolSize=pObj->GetSnapRect().GetSize();
aSymbolGraphic.SetPrefSize(aSymbolSize);
aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize());
aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM);
bPrevSym=sal_True;
bEnable=sal_True;
bIgnoreGraphic=sal_True;
pView->UnmarkAll();
pInvisibleSquare=pPage->RemoveObject(1);
SdrObject::Free( pInvisibleSquare);
pObj=pPage->RemoveObject(0);
SdrObject::Free( pObj );
}
......@@ -1078,12 +1090,12 @@ void SvxLineTabPage::Reset( const SfxItemSet& rAttrs )
bPrevSym=sal_True;
}
}
if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),sal_True,&pPoolItem) == SFX_ITEM_SET)
{
aSymbolSize = ((const SvxSizeItem *)pPoolItem)->GetSize();
}
aSymbolRatioCB.Enable(bEnable);
aSymbolHeightFT.Enable(bEnable);
aSymbolWidthFT.Enable(bEnable);
......@@ -1742,6 +1754,15 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
PopupMenu* pPopup = new PopupMenu;
String aEmptyStr;
// Generate invisible square to give all symbols a
// bitmap size, which is indepedent from specific glyph
SdrObject *pInvisibleSquare=pSymbolList->GetObj(0);
pInvisibleSquare=pInvisibleSquare->Clone();
pPage->NbcInsertObject(pInvisibleSquare);
pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
for(long i=0;; ++i)
{
SdrObject *pObj=pSymbolList->GetObj(i);
......@@ -1753,7 +1774,6 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
aGrfNames.Insert(pStr,LIST_APPEND);
//Rectangle aRect(pObj->GetLogicRect());
pPage->NbcInsertObject(pObj);
pView->MarkObj(pObj,pPageView);
if(pSymbolAttr)
{
pObj->SetMergedItemSet(*pSymbolAttr);
......@@ -1762,11 +1782,11 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
{
pObj->SetMergedItemSet(rOutAttrs);
}
pView->MarkAll();
BitmapEx aBitmapEx(pView->GetMarkedObjBitmapEx());
GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
pView->UnmarkAll();
pObj=pPage->RemoveObject(0);
pObj=pPage->RemoveObject(1);
SdrObject::Free(pObj);
SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH);
......@@ -1789,6 +1809,9 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )
Image aImage(aBitmapEx);
pPopup->InsertItem(pInfo->nItemId,*pStr,aImage);
}
pInvisibleSquare=pPage->RemoveObject(0);
SdrObject::Free(pInvisibleSquare);
aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup );
if(!aGrfNames.Count())
aSymbolMB.GetPopupMenu()->EnableItem(MN_SYMBOLS, sal_False);
......
......@@ -446,19 +446,19 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym
// symbol style
cssc::Symbol aSymbol;
aSymbol.Style = cssc::SymbolStyle_STANDARD;
switch( nOoxSymbol )
switch( nOoxSymbol ) // compare with XclChPropSetHelper::WriteMarkerProperties in xlchart.cxx
{
case XML_auto: aSymbol.Style = cssc::SymbolStyle_AUTO; break;
case XML_none: aSymbol.Style = cssc::SymbolStyle_NONE; break;
case XML_square: aSymbol.StandardSymbol = 0; break; // square
case XML_diamond: aSymbol.StandardSymbol = 1; break; // diamond
case XML_triangle: aSymbol.StandardSymbol = 3; break; // arrow up
case XML_x: aSymbol.StandardSymbol = 6; break; // bow tie
case XML_star: aSymbol.StandardSymbol = 7; break; // sand glass
case XML_x: aSymbol.StandardSymbol = 10; break; // X, legacy bow tie
case XML_star: aSymbol.StandardSymbol = 12; break; // asterisk, legacy sand glass
case XML_dot: aSymbol.StandardSymbol = 4; break; // arrow right
case XML_dash: aSymbol.StandardSymbol = 2; break; // arrow down
case XML_circle: aSymbol.StandardSymbol = 4; break; // arrow right
case XML_plus: aSymbol.StandardSymbol = 5; break; // arrow left
case XML_dash: aSymbol.StandardSymbol = 13; break; // horizontal bar, legacy arrow down
case XML_circle: aSymbol.StandardSymbol = 8; break; // circle, legacy arrow right
case XML_plus: aSymbol.StandardSymbol = 11; break; // plus, legacy arrow left
}
// symbol size (points in OOXML, 1/100 mm in Chart2)
......
......@@ -937,10 +937,17 @@ void XclChPropSetHelper::ReadMarkerProperties(
case 1: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DIAMOND; break; // diamond
case 2: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STDDEV; break; // arrow down
case 3: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_TRIANGLE; break; // arrow up
case 4: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CIRCLE; break; // arrow right
case 4: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DOWJ; break; // arrow right, same as import
case 5: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_PLUS; break; // arrow left
case 6: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CROSS; break; // bow tie
case 7: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // sand glass
case 8: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CIRCLE; break; // circle new in LibO3.5
case 9: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DIAMOND; break; // star new in LibO3.5
case 10: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CROSS; break; // X new in LibO3.5
case 11: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_PLUS; break; // plus new in LibO3.5
case 12: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // asterisk new in LibO3.5
case 13: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STDDEV; break; // horizontal bar new in LibO3.5
case 14: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // vertical bar new in LibO3.5
default: rMarkerFmt.mnMarkerType = XclChartHelper::GetAutoMarkerType( nFormatIdx );
}
break;
......@@ -1148,12 +1155,13 @@ void XclChPropSetHelper::WriteMarkerProperties(
case EXC_CHMARKERFORMAT_SQUARE: aApiSymbol.StandardSymbol = 0; break; // square
case EXC_CHMARKERFORMAT_DIAMOND: aApiSymbol.StandardSymbol = 1; break; // diamond
case EXC_CHMARKERFORMAT_TRIANGLE: aApiSymbol.StandardSymbol = 3; break; // arrow up
case EXC_CHMARKERFORMAT_CROSS: aApiSymbol.StandardSymbol = 6; break; // bow tie
case EXC_CHMARKERFORMAT_STAR: aApiSymbol.StandardSymbol = 7; break; // sand glass
case EXC_CHMARKERFORMAT_DOWJ: aApiSymbol.StandardSymbol = 4; break; // arrow right
case EXC_CHMARKERFORMAT_STDDEV: aApiSymbol.StandardSymbol = 2; break; // arrow down
case EXC_CHMARKERFORMAT_CIRCLE: aApiSymbol.StandardSymbol = 4; break; // arrow right
case EXC_CHMARKERFORMAT_PLUS: aApiSymbol.StandardSymbol = 5; break; // arrow left
case EXC_CHMARKERFORMAT_CROSS: aApiSymbol.StandardSymbol = 10; break; // X, legacy bow tie
case EXC_CHMARKERFORMAT_STAR: aApiSymbol.StandardSymbol = 12; break; // asterisk, legacy sand glass
case EXC_CHMARKERFORMAT_DOWJ: aApiSymbol.StandardSymbol = 4; break; // arrow right, same as export
case EXC_CHMARKERFORMAT_STDDEV: aApiSymbol.StandardSymbol = 13; break; // horizontal bar, legacy arrow down
case EXC_CHMARKERFORMAT_CIRCLE: aApiSymbol.StandardSymbol = 8; break; // circle, legacy arrow right
case EXC_CHMARKERFORMAT_PLUS: aApiSymbol.StandardSymbol = 11; break; // plus, legacy arrow left
default: break;
}
// symbol size
......
......@@ -3130,6 +3130,12 @@ namespace xmloff { namespace token {
XML_MARGIN, // #i117001#
// regina, ODF1.2 additional symbols in charts
XML_STAR,
XML_ASTERISK,
XML_HORIZONTAL_BAR,
XML_VERTICAL_BAR,
XML_TOKEN_END
};
......
......@@ -58,6 +58,13 @@ SvXMLSignedEnumMapEntry aXMLChartSymbolNameMap[] =
{ XML_ARROW_LEFT, 5 },
{ XML_BOW_TIE, 6 },
{ XML_HOURGLASS, 7 },
{ XML_CIRCLE, 8 },
{ XML_STAR, 9 },
{ XML_X, 10 },
{ XML_PLUS, 11 },
{ XML_ASTERISK, 12 },
{ XML_HORIZONTAL_BAR, 13 },
{ XML_VERTICAL_BAR, 14 },
{ XML_TOKEN_INVALID, 0 }
};
......
......@@ -3130,6 +3130,12 @@ namespace xmloff { namespace token {
TOKEN( "margin", XML_MARGIN),
// regina, ODF1.2 additional symbols in charts
TOKEN( "star", XML_STAR ),
TOKEN( "asterisk", XML_ASTERISK ),
TOKEN( "horizontal-bar", XML_HORIZONTAL_BAR ),
TOKEN( "vertical-bar", XML_VERTICAL_BAR ),
#if OSL_DEBUG_LEVEL > 0
{ 0, NULL, NULL, XML_TOKEN_END }
#else
......
......@@ -386,6 +386,20 @@ void XMLPropertiesTContext_Impl::StartElement(
nSymbolType = 6;
else if( IsXMLToken( rAttrValue, XML_HOURGLASS ))
nSymbolType = 7;
else if( IsXMLToken( rAttrValue, XML_CIRCLE ))
nSymbolType = 8;
else if( IsXMLToken( rAttrValue, XML_STAR ))
nSymbolType = 9;
else if( IsXMLToken( rAttrValue, XML_X ))
nSymbolType = 10;
else if( IsXMLToken( rAttrValue, XML_PLUS ))
nSymbolType = 11;
else if( IsXMLToken( rAttrValue, XML_ASTERISK ))
nSymbolType = 12;
else if( IsXMLToken( rAttrValue, XML_HORIZONTAL_BAR ))
nSymbolType = 13;
else if( IsXMLToken( rAttrValue, XML_VERTICAL_BAR ))
nSymbolType = 14;
if( nSymbolType >= 0 )
pAttrList->AddAttribute(
......
......@@ -771,6 +771,27 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
case 7:
eToken = XML_HOURGLASS;
break;
case 8:
eToken = XML_CIRCLE;
break;
case 9:
eToken = XML_STAR;
break;
case 10:
eToken = XML_X;
break;
case 11:
eToken = XML_PLUS;
break;
case 12:
eToken = XML_ASTERISK;
break;
case 13:
eToken = XML_HORIZONTAL_BAR;
break;
case 14:
eToken = XML_VERTICAL_BAR;
break;
default:
OSL_ENSURE( false, "invalid named symbol" );
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment