Hi,
reading your first mail I thought you wanted to share the attributes
between different Writer documents.

If the attributes should be available in every document you have a bit
more to do.

- You can put the SwFormatPaintBrush implementation to the svx project.
The instance should be accessible e.g. at the SfxApplication.
- Extend the class to fetch not only style names but also style
attributes. The Writer has to provide these attributes separately.
Impress and Calc have to merge these attributes to apply them at the
selected location.
- Create code to copies styles between different Writer documents if a
used style is not already available
- In case of copying attributes from Writer to Imress/Draw/Calc then
merge the style related attributes to the 'hard' attributes.

SwDoc::CopyCharFmt() and SwDoc::CopyTxtColl() are methods in the Writer
to copy character/paragraph styles from one document to another.

HTH,

Oliver

FangYaqiong wrote:
> Hi Oliver,
> I had a look at the codes, but I am not sure where to transport the 
> SwFormatClipboard to. I think maybe I can put it to class SfxViewShell 
> (viewsh,hxx). But it seems not to be a good idea as the views of writer and 
> impress are all inherited from it. And I think the formatpaintbrush should 
> not be used between the writer and impress as it may cause more problems. 
> There should be a place that the views of writer can be inherited but not 
> other views, isn't it?
> Another question is that what else should be transported besides the 
> SwFormatClipboard? What about the struct SwApplyTemplate?
> The third question is that I have no idea about the SwDoc::CopyCharFmt() and 
> SwDoc::CopyTxtColl(), is it should be transported too?
> Hope for your reply,Thank you.
> 
> Best regards,
> Fang 
> 
> 
> 
> 
> 
> 
> FangYaqiong
> 2007-04-24
> 
> 
> 
>> Hi,
>> the paintbrush code is implemented in
>> sw/source/ui/inc/formatclipboard.hxx,
>> sw/source/ui/uiview/formatclipboard.cxx.
>> There's a SwFormatClipboard as member pointer at the SwView.
>>
>> To make the code work between different Writer documents this
>> SwFormatClipboard has to be moved out of the view (SwModule?).
>>
>> The SwFormatClipboard stores the attributes as SfxPoolItems. They can be
>> transported over document borders (maybe with some exceptions).
>> Additionally names of the paragraph and character style are stored. They
>> are a bit harder to transport. There are copy methods
>> SwDoc::CopyCharFmt() and SwDoc::CopyTxtColl() to copy character and
>> paragraph formats from one document to another.
>>
>> Regards,
>>
>> Oliver
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to