Problem in Bug 93240

Shreyansh Gandhi gandhishrey at gmail.com
Mon Aug 31 21:45:02 PDT 2015


Hi,

I have been working on a patch for EasyHack 93240
<https://bugs.documentfoundation.org/show_bug.cgi?id=93240>  and I have run
into a problem.
All the changes I'll describe are in the sw/source/filter/html directory.

*svxcss1.hxx , svxcss1.cxx , htmlcss1.cxx:-*

   -
   http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/svxcss1.hxx#201
. According
   to the bug description, boost::ptr_vector<..> should be changed to
   std::vector<std::unique_ptr<CSS1Selector> > . aSelectors would be renamed
   to m_Selectors.
   -
   http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/svxcss1.cxx#659
   . In SvcCSS1Parser::SelectorParsed, since pSelector (which is of type
   CSS1Selector*) would be pushed back into m_Selectors now and there is no
   conversion from a normal pointer to a unique_ptr, pSelector itself would
   have to be a unique_ptr. Hence, the StyleParsed method's prototype would
   also be changed.
   -
   http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/htmlcss1.cxx#696
.
   Is another implementation of SvxCSS1Parser::StyleParsed.


Since SvxCSS1Parser inherits CSS1Parser, and the SelectorParsed method is
overloaded, changes are also required in *parcss1.hxx and parcss1.cxx *,
where ParseRule() calls SelectorParsed():-


   -
   http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/parcss1.cxx#739
.
   pSelector (which should become a unique_ptr ) is obtained from
   ParseSelector() (whose return type should also change) and then passed to
   SelectorParsed()
   -
   http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/parcss1.cxx#833
.
   In ParseSelector(), pRoot, pNew and pLast would have to be unique_ptr s
   (initialized to nullptr). Lines 882, 894, 911 and 924 would now have calls
   to std::move. The problem arises in the if block starting at line 936,
   where pRoot and pLast are checked for equality (which should fail for
   unique_ptr s) Also, pRoot and pLast could both be assigned to the object
   owned by pNew, which is not possible.

How should I go about solving this problem?

Regards,
Shreyansh
-- 
Regards,
Shreyansh Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150901/eefa9fd2/attachment.html>


More information about the LibreOffice mailing list