Skip to content

Commit 30c04bc

Browse files
committed
Added a method to remove author information from the style.
The code is not used yet.
1 parent bc5c7f8 commit 30c04bc

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

StyleConverterApplication.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void __fastcall TStyleConverterApplication::Run()
8989
try
9090
{
9191
LStyle = Fmx::Styles::TStyleStreaming::LoadFromFile(LInputFileName);
92+
//RemoveAuthorInfo(LStyle);
9293
MemStream = new TMemoryStream();
9394
Fmx::Styles::TStyleStreaming::SaveToStream(
9495
LStyle, MemStream, LStyleFormat);
@@ -99,4 +100,23 @@ void __fastcall TStyleConverterApplication::Run()
99100
delete LStyle;
100101
delete MemStream;
101102
}
102-
}
103+
}
104+
105+
/**
106+
* This method will remove author information from the style.
107+
* @param AObject A style object.
108+
*/
109+
void __fastcall TStyleConverterApplication::RemoveAuthorInfo(Fmx::Types::TFmxObject* AObject)
110+
{
111+
for(int i = 0; i < AObject->ChildrenCount; ++i)
112+
{
113+
TStyleDescription* LDescription = dynamic_cast<TStyleDescription*>(AObject->Children->Items[i]);
114+
if(LDescription != NULL)
115+
{
116+
LDescription->Author = "";
117+
LDescription->AuthorURL = "";
118+
LDescription->AuthorEMail = "";
119+
break;
120+
}
121+
}
122+
}

StyleConverterApplication.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44
//---------------------------------------------------------------------------
55
#include <System.hpp>
66
//---------------------------------------------------------------------------
7+
namespace Fmx
8+
{
9+
namespace Types
10+
{
11+
class TFmxObject;
12+
}
13+
}
14+
715
class PACKAGE TStyleConverterApplication : public System::TObject
816
{
917
typedef System::TObject inherited; /**< Our parent's definition. */
1018

1119
private:
12-
20+
void __fastcall RemoveAuthorInfo(Fmx::Types::TFmxObject* AObject);
1321
protected:
1422

1523
public:

0 commit comments

Comments
 (0)