Commit 758833be authored by Pierre Ducroquet's avatar Pierre Ducroquet

Fix the simpleRootAreaProvider following 4fa0b6e29

The commit 4fa0b6e29d31d7755441b231ea3bf2ef068435b4 introduced
a refactoring of KoTextDocumentLayout that required doing the
caching of rootAreas at the provider level.

A failure to do so led to weird behaviours like missing inputs,
missing rendering and so on in stage and other applications.

Thanks to leinir for reporting the issue.
parent f4c5a56f
......@@ -34,7 +34,7 @@ SimpleRootAreaProvider::SimpleRootAreaProvider(KoTextShapeData *data, TextShape
{
}
KoTextLayoutRootArea *SimpleRootAreaProvider::provide(KoTextDocumentLayout *documentLayout, const RootAreaConstraint &, int, bool *isNewRootArea)
KoTextLayoutRootArea *SimpleRootAreaProvider::provide(KoTextDocumentLayout *documentLayout, const RootAreaConstraint &, int requestedPosition, bool *isNewRootArea)
{
if(m_area == 0) {
*isNewRootArea = true;
......@@ -44,7 +44,10 @@ KoTextLayoutRootArea *SimpleRootAreaProvider::provide(KoTextDocumentLayout *docu
return m_area;
}
*isNewRootArea = false;
if (requestedPosition == 0) {
*isNewRootArea = false;
return m_area;
}
return 0;
}
......
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