https://bugs.documentfoundation.org/show_bug.cgi?id=90105

            Bug ID: 90105
           Summary: simplify drawing of presentation objects
           Product: libetonyek
           Version: unspecified
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]

The task is to simplify the code by removing one layer of indirection. There is
an interface named IWORKObject, which originally served to save a part of input
that could be later drawn to the RVNGPresentationInterface. This was then drawn
to the output in one go. For that purpose, there are many subclasses of
IWORKObject that wrap various kinds of objects, including their styles etc.
Most of the original indirection is gone now, so this only adds extra code.

In the current code, output is generated on-the-fly during parsing. It still
cannot be done directly to the passed RVNGPresentationInterface (because of
master pages etc.), so it uses IWORKOutputElements (already used in various
other libraries) to save the current "zone" (layer, notes,...)

The task is to go through all subclasses of IWORKObject and move the draw()
code to the function in KEYCollector.cpp that creates (and draws) that object.
This is mostly a straightforward copy; the only complication is that all calls
of RVNGPresentationInterface functions (e.g., openParagraph(), drawPolyline(),
etc.) on the painter object must be replaced by calls of IWORKOutputElements
functions (e.g., addOpenParagraph(), addDrawPolyline(), etc.) on m_currentZone. 

This can be done in smaller chunks, preferably function-by-function.

There are objects that handle larger piece of input (like IWORKText or
IWORKTable). For those, the drawing should probably remain internal, at least
for now. But the respective drawing functions should be changed to take
IWORKOutputElements argument instead of RVNGPresentationInterface.

There is a sample conversion in
https://gerrit.libreoffice.org/gitweb?p=libetonyek.git;a=commit;h=b42f848f77727c678bbb67da9d4b1c3ba98d6f57
.

You should run the test suite (in libetonyek-test repo) after each commit to
ensure there are no regressions.

When the last use of IWORKObject is dropped, the class itself should be
removed. IWORKOutputElementsRedirector should be dropped too, as it is only a
cludge to glue the old and new way together.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to