CPP-3103: Conditionally uncompiled code unexpectedly formatted
[idea/community.git] / platform / lang-impl / src / com / intellij / psi / impl / source / codeStyle / CodeStyleManagerRunnable.java
index c220e5078f2746c509642ae1c5d4b7e1aae68cee..60e41cc7963544108d5c78764789abc4f644b40e 100644 (file)
@@ -99,7 +99,7 @@ abstract class CodeStyleManagerRunnable<T> {
       myModel = CoreFormatterUtil.buildModel(builder, file, mySettings, myMode);
 
       if (document != null && useDocumentBaseFormattingModel()) {
-        myModel = new DocumentBasedFormattingModel(myModel.getRootBlock(), document, myCodeStyleManager.getProject(), mySettings,
+        myModel = new DocumentBasedFormattingModel(myModel, document, myCodeStyleManager.getProject(), mySettings,
                                                    file.getFileType(), file);
       }