Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarJsonParser.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-04-18 08:46:48 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-04-18 08:46:48 +1000
commit5bf3b20542c62c656cf90c71774189b7ab69fef5 (patch)
tree4c45656a71e5ce719926dde2a336fc4d6109d38b /source/core/StarJsonParser.hpp
parent5d9108c469eb95d0892b70e4545f7204b6301061 (diff)
oops - state must be popped before writing indent
otherwise the closing } on non-empty objects is incorrectly indented
Diffstat (limited to 'source/core/StarJsonParser.hpp')
-rw-r--r--source/core/StarJsonParser.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/core/StarJsonParser.hpp b/source/core/StarJsonParser.hpp
index c7a9cc6..d814edb 100644
--- a/source/core/StarJsonParser.hpp
+++ b/source/core/StarJsonParser.hpp
@@ -521,12 +521,13 @@ public:
}
void endObject() {
- if (currentState() == ObjectElement) {
+ bool isNotEmpty = currentState() == ObjectElement;
+ popState(Object);
+ if (isNotEmpty) {
if (m_pretty)
write('\n');
indent();
}
- popState(Object);
write('}');
}