Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 1a95731

Browse files
committed
Fix stop tile render, remove log noise
1 parent b6028d7 commit 1a95731

File tree

11 files changed

+52
-32
lines changed

11 files changed

+52
-32
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.8
1+
v0.1.9

libreoffice-core/chart2/source/tools/WrappedPropertySet.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ void SAL_CALL WrappedPropertySet::setPropertyValue( const OUString& rPropertyNam
8989
xInnerPropertySet->setPropertyValue( rPropertyName, rValue );
9090
else
9191
{
92-
SAL_WARN("chart2.tools", "found no inner property set to map to");
92+
// MACRO: Noisy common case {
93+
// SAL_WARN("chart2.tools", "found no inner property set to map to");
94+
// MACRO: }
9395
}
9496
}
9597
catch( const beans::UnknownPropertyException& )
@@ -134,7 +136,9 @@ Any SAL_CALL WrappedPropertySet::getPropertyValue( const OUString& rPropertyName
134136
aRet = xInnerPropertySet->getPropertyValue( rPropertyName );
135137
else
136138
{
137-
SAL_WARN("chart2.tools", "found no inner property set to map to");
139+
// MACRO: Noisy common case {
140+
// SAL_WARN("chart2.tools", "found no inner property set to map to");
141+
// MACRO: }
138142
}
139143
}
140144
catch( const beans::UnknownPropertyException& )

libreoffice-core/desktop/inc/lib/wasm_extensions.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct TileRendererData
3333
const int32_t viewId;
3434
const int32_t tileSize;
3535
const int32_t paintedTileAllocSize;
36-
pthread_t threadId;
36+
const int32_t threadId;
3737

3838
// individual tile paint
3939
_Atomic RenderState state = RenderState::IDLE;
@@ -54,7 +54,7 @@ struct TileRendererData
5454
LibreOfficeKitDocument* doc;
5555

5656
TileRendererData(LibreOfficeKitDocument* doc_, int32_t viewId_, int32_t tileSize_,
57-
uint32_t docWidthTwips_, uint32_t docHeightTwips_, pthread_t threadId_)
57+
uint32_t docWidthTwips_, uint32_t docHeightTwips_, int32_t threadId_)
5858
: viewId(viewId_)
5959
, tileSize(tileSize_)
6060
, paintedTileAllocSize(tileSize_ * tileSize_ * 4)
@@ -78,14 +78,14 @@ struct ExpandedPart
7878

7979
ExpandedPart(std::string path_, std::string content_)
8080
: path(std::move(path_))
81-
, content(std::move(content_)){};
81+
, content(std::move(content_)) {};
8282
};
8383

8484
struct ExpandedDocument
8585
{
8686
std::vector<ExpandedPart> parts;
8787

88-
ExpandedDocument(){};
88+
ExpandedDocument() {};
8989

9090
public:
9191
void addPart(std::string path, std::string content);

libreoffice-core/desktop/source/lib/wasm_extensions.cxx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ static void* tileRendererWorker(void* data_)
9797
break;
9898
}
9999
case RenderState::QUIT:
100+
pthread_exit(nullptr);
100101
return nullptr;
101102
}
102103
}
104+
pthread_exit(nullptr);
103105
return nullptr;
104106
}
105107

@@ -112,14 +114,14 @@ TileRendererData& WasmDocumentExtension::startTileRenderer(int32_t viewId_, int3
112114
{
113115
long w, h;
114116
pClass->getDocumentSize(this, &w, &h);
115-
pthread_t& threadId = tileRendererThreads_.emplace_back();
116-
TileRendererData& data
117-
= tileRendererData_.emplace_back(this, viewId_, tileSize_, w, h, threadId);
118-
if (pthread_create(&threadId, nullptr, tileRendererWorker, &data))
117+
pthread_t& thread = tileRendererThreads_.emplace_back();
118+
TileRendererData& data = tileRendererData_.emplace_back(this, viewId_, tileSize_, w, h,
119+
tileRendererThreads_.size());
120+
if (pthread_create(&thread, nullptr, tileRendererWorker, &data))
119121
{
120122
std::abort();
121123
}
122-
pthread_detach(threadId);
124+
pthread_detach(thread);
123125

124126
return data;
125127
}
@@ -135,18 +137,18 @@ void WasmDocumentExtension::stopTileRenderer(int32_t viewId)
135137
TileRendererData* data = &*it;
136138
changeState(data, RenderState::QUIT);
137139

138-
auto threadIt = std::find_if(tileRendererThreads_.begin(), tileRendererThreads_.end(),
139-
[data](const pthread_t& threadId)
140-
{ return pthread_equal(threadId, data->threadId); });
140+
auto threadIt = tileRendererThreads_[data->threadId];
141141

142-
if (threadIt != tileRendererThreads_.end())
143-
{
144-
pthread_join(*threadIt, nullptr);
145-
tileRendererThreads_.erase(threadIt);
146-
}
142+
pthread_join(threadIt, nullptr);
143+
// Don't erase it, since the position is used as an ID now
144+
// tileRendererThreads_.erase(threadIt);
147145
delete[] data->paintedTile;
148146
delete data;
149147
}
148+
else
149+
{
150+
SAL_WARN("tile", "missing tile render data");
151+
}
150152
}
151153

152154
void TileRendererData::pushInvalidation(uint32_t invalidation[4])
@@ -297,12 +299,11 @@ WasmDocumentExtension::loadFromExpanded(LibreOfficeKit* pThis,
297299
comphelper::OStorageHelper::SetIsExpandedStorage(true);
298300
comphelper::OStorageHelper::SetExpandedStorage(xStorage);
299301

300-
301302
/*
302303
storage instance MUST be set before storage base
303304
instance and base are the same objects, just casted differently
304305
instance is stored in an uno::Reference while base is stored in a shared_ptr
305-
306+
306307
if the base is released first (as the shared_ptr is set), the uno reference
307308
has a bad time when it tries to access a null object at with it's pointer
308309
*/

libreoffice-core/include/osl/diagnose.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@
6666
*/
6767
#define OSL_LOG_PREFIX SAL_DETAIL_WHERE
6868

69+
6970
/** Prints trace message.
7071
7172
The arguments have the same meaning as the arguments of printf.
7273
*/
7374
#define OSL_TRACE(...) \
74-
SAL_DETAIL_INFO_IF_FORMAT(OSL_DEBUG_LEVEL > 0, "legacy.osl", __VA_ARGS__)
75+
((void)0)
7576

7677
/** @defgroup assert Assertions
7778
@@ -82,11 +83,11 @@
8283

8384
/** If cond is false, reports an error. */
8485
#define OSL_ASSERT(c) \
85-
SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "OSL_ASSERT: %s", #c)
86+
((void)0)
8687
/** If cond is false, reports an error with message msg. */
87-
#define OSL_ENSURE(c, m) SAL_DETAIL_WARN_IF_FORMAT(!(c), "legacy.osl", "%s", m)
88+
#define OSL_ENSURE(c, m) ((void)0)
8889
/** Reports an error with message msg unconditionally. */
89-
#define OSL_FAIL(m) SAL_DETAIL_WARN_IF_FORMAT(sal_True, "legacy.osl", "%s", m)
90+
#define OSL_FAIL(m) ((void)0)
9091

9192
/** Evaluates the expression and if it is false, reports an error. The
9293
expression is evaluated once without regard of the value of
@@ -104,6 +105,7 @@
104105
@endcode
105106
*/
106107
#define OSL_VERIFY(c) do { if (!(c)) OSL_ASSERT(0); } while (0)
108+
// MACRO: }
107109

108110
/** Check the precondition of functions.
109111

libreoffice-core/oox/source/helper/expandedstorage.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,11 @@ void ExpandedStorage::readRelationshipInfo()
769769

770770
if (relFilePaths.empty())
771771
{
772-
SAL_WARN("expandedstorage",
773-
"no relationship info found for base path" << m_basePath.value());
772+
// FIXME: This shouldn't be used for the Configurations2 directory, probably need to pre-init
773+
// writer outside of the document load to prevent this
774+
775+
// SAL_WARN("expandedstorage",
776+
// "no relationship info found for base path" << m_basePath.value());
774777

775778
return;
776779
}

libreoffice-core/sfx2/source/appl/appserv.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ weld::Window* SfxRequest::GetFrameWeld() const
336336
xFrame = GetDocFrame(*this);
337337
if (!xFrame)
338338
{
339-
SAL_WARN("sfx.appl", "no parent for dialogs");
339+
// MACRO: Noisy common case {
340+
// SAL_WARN("sfx.appl", "no parent for dialogs");
341+
// MACRO: }
340342
return nullptr;
341343
}
342344
return Application::GetFrameWeld(xFrame->getContainerWindow());

libreoffice-core/sot/source/sdstor/storage.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,10 @@ SotClipboardFormatId SotStorage::GetFormatID( const css::uno::Reference < css::e
721721

722722
sal_Int32 SotStorage::GetVersion( const css::uno::Reference < css::embed::XStorage >& xStorage )
723723
{
724+
// MACRO: Prevents a common crash. We don't support legacy formats, this will always be 0 {
725+
return 0;
726+
// MACRO: }
727+
724728
SotClipboardFormatId nSotFormatID = SotStorage::GetFormatID( xStorage );
725729
switch( nSotFormatID )
726730
{

libreoffice-core/xmloff/source/chart/SchXMLExport.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3975,7 +3975,9 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference<
39753975
try
39763976
{
39773977
Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
3978-
SAL_WARN_IF( !xDataProvider.is(), "xmloff.chart", "No DataProvider" );
3978+
// FIXME: MACRO: macro common error, but seems like expanded storage related {
3979+
// SAL_WARN_IF( !xDataProvider.is(), "xmloff.chart", "No DataProvider" );
3980+
// FIXME MACRO: }
39793981
if( xDataProvider.is())
39803982
{
39813983
Reference< chart2::data::XDataSource > xDataSource( lcl_pressUsedDataIntoRectangularFormat( xChartDoc, mbHasCategoryLabels ));

libreoffice-core/xmloff/source/text/XMLTextListAutoStylePool.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) :
160160
m_sPrefix = "ML";
161161

162162
Reference<XStyleFamiliesSupplier> xFamiliesSupp(m_rExport.GetModel(), UNO_QUERY);
163-
SAL_WARN_IF(!xFamiliesSupp.is(), "xmloff", "getStyleFamilies() from XModel failed for export!");
163+
// MACRO: Noisy common case {
164+
// SAL_WARN_IF(!xFamiliesSupp.is(), "xmloff", "getStyleFamilies() from XModel failed for export!");
165+
// MACRO: }
164166
Reference< XNameAccess > xFamilies;
165167
if (xFamiliesSupp.is())
166168
xFamilies = xFamiliesSupp->getStyleFamilies();

0 commit comments

Comments
 (0)